From 3636255e8adb8e8919eac8cb6643dc97cce0d517 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 14 Jul 2014 23:48:34 -0700 Subject: [PATCH] Fixed bug with DisguiseManager undisguising players. Temp fix for emeralds not triggering in Perk Revealer. --- .../core/disguise/DisguiseManager.java | 9 +++--- .../game/arcade/kit/perks/PerkRevealer.java | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 14ef675c3..552e30ee5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -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) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java index 1611856a6..5a4660c18 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java @@ -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