Fixed bug with DisguiseManager undisguising players.

Temp fix for emeralds not triggering in Perk Revealer.
This commit is contained in:
Jonathan Williams 2014-07-14 23:48:34 -07:00
parent cb4d436605
commit 3636255e8a
2 changed files with 36 additions and 4 deletions

View File

@ -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)

View File

@ -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