Fixed bug with DisguiseManager undisguising players.
Temp fix for emeralds not triggering in Perk Revealer.
This commit is contained in:
parent
cb4d436605
commit
3636255e8a
@ -120,6 +120,10 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
if (!_spawnPacketMap.containsKey(entity.getEntityId()))
|
||||
return;
|
||||
|
||||
_spawnPacketMap.remove(entity.getEntityId());
|
||||
_movePacketMap.remove(entity.getEntityId());
|
||||
_moveTempMap.remove(entity.getEntityId());
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (entity == player)
|
||||
@ -130,6 +134,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
|
||||
if (entity instanceof Player)
|
||||
{
|
||||
player.hidePlayer((Player)entity);
|
||||
player.showPlayer((Player)entity);
|
||||
}
|
||||
else
|
||||
@ -137,10 +142,6 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
entityPlayer.playerConnection.sendPacket(new PacketPlayOutSpawnEntityLiving(((CraftLivingEntity)entity).getHandle()));
|
||||
}
|
||||
}
|
||||
|
||||
_spawnPacketMap.remove(entity.getEntityId());
|
||||
_movePacketMap.remove(entity.getEntityId());
|
||||
_moveTempMap.remove(entity.getEntityId());
|
||||
}
|
||||
|
||||
public void reApplyDisguise(final DisguiseBase disguise)
|
||||
|
@ -129,7 +129,38 @@ public class PerkRevealer extends Perk implements IThrown
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
FireworkEffect effect = FireworkEffect
|
||||
.builder()
|
||||
.flicker(false)
|
||||
.withColor(Color.GREEN)
|
||||
.with(FireworkEffect.Type.BALL_LARGE)
|
||||
.trail(false)
|
||||
.build();
|
||||
|
||||
UtilFirework.playFirework(data.GetThrown().getLocation(), effect);
|
||||
|
||||
for(Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if(player == data.GetThrower())
|
||||
continue;
|
||||
|
||||
if(player.getLocation().getWorld() == data.GetThrown().getWorld() && player.getLocation().distanceSquared(data.GetThrown().getLocation()) <= 25)
|
||||
{
|
||||
RevealedPlayerInfo info = getRevealedPlayers().get(player);
|
||||
|
||||
if(info == null)
|
||||
{
|
||||
info = new RevealedPlayerInfo(Manager.GetDisguise().getDisguise(player));
|
||||
getRevealedPlayers().put(player, info);
|
||||
|
||||
Manager.GetDisguise().undisguise(player);
|
||||
}
|
||||
|
||||
info._expirationSeconds = 5;
|
||||
}
|
||||
}
|
||||
|
||||
data.GetThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user