From e7f283dc25c4886097c4d718d0b71a2df3c4a130 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 22 Jul 2013 22:36:24 +1200 Subject: [PATCH] Read desc Don't disguise the command sender when doing a radius Fixed saying a incorrect entity count when undisguising --- .../disguise/Commands/DisguiseRadiusCommand.java | 2 ++ .../disguise/Commands/UndisguiseRadiusCommand.java | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java b/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java index 06b692e6..585b169a 100644 --- a/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java +++ b/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java @@ -148,6 +148,8 @@ public class DisguiseRadiusCommand implements CommandExecutor { // Time to use it! int disguisedEntitys = 0; for (Entity entity : ((Player) sender).getNearbyEntities(radius, radius, radius)) { + if (entity == sender) + continue; DisguiseAPI.disguiseToAll(entity, disguise); disguisedEntitys++; } diff --git a/src/me/libraryaddict/disguise/Commands/UndisguiseRadiusCommand.java b/src/me/libraryaddict/disguise/Commands/UndisguiseRadiusCommand.java index 5a8a98c5..354940a2 100644 --- a/src/me/libraryaddict/disguise/Commands/UndisguiseRadiusCommand.java +++ b/src/me/libraryaddict/disguise/Commands/UndisguiseRadiusCommand.java @@ -48,8 +48,12 @@ public class UndisguiseRadiusCommand implements CommandExecutor { } int disguisedEntitys = 0; for (Entity entity : ((Player) sender).getNearbyEntities(radius, radius, radius)) { - DisguiseAPI.undisguiseToAll(entity); - disguisedEntitys++; + if (entity == sender) + continue; + if (DisguiseAPI.isDisguised(entity)) { + DisguiseAPI.undisguiseToAll(entity); + disguisedEntitys++; + } } sender.sendMessage(ChatColor.RED + "Successfully undisguised " + disguisedEntitys + " entities!"); } else