Read desc

Don't disguise the command sender when doing a radius
Fixed saying a incorrect entity count when undisguising
This commit is contained in:
Andrew 2013-07-22 22:36:24 +12:00
parent d3da599ea8
commit e7f283dc25
2 changed files with 8 additions and 2 deletions

View File

@ -148,6 +148,8 @@ public class DisguiseRadiusCommand implements CommandExecutor {
// Time to use it! // Time to use it!
int disguisedEntitys = 0; int disguisedEntitys = 0;
for (Entity entity : ((Player) sender).getNearbyEntities(radius, radius, radius)) { for (Entity entity : ((Player) sender).getNearbyEntities(radius, radius, radius)) {
if (entity == sender)
continue;
DisguiseAPI.disguiseToAll(entity, disguise); DisguiseAPI.disguiseToAll(entity, disguise);
disguisedEntitys++; disguisedEntitys++;
} }

View File

@ -48,9 +48,13 @@ public class UndisguiseRadiusCommand implements CommandExecutor {
} }
int disguisedEntitys = 0; int disguisedEntitys = 0;
for (Entity entity : ((Player) sender).getNearbyEntities(radius, radius, radius)) { for (Entity entity : ((Player) sender).getNearbyEntities(radius, radius, radius)) {
if (entity == sender)
continue;
if (DisguiseAPI.isDisguised(entity)) {
DisguiseAPI.undisguiseToAll(entity); DisguiseAPI.undisguiseToAll(entity);
disguisedEntitys++; disguisedEntitys++;
} }
}
sender.sendMessage(ChatColor.RED + "Successfully undisguised " + disguisedEntitys + " entities!"); sender.sendMessage(ChatColor.RED + "Successfully undisguised " + disguisedEntitys + " entities!");
} else } else
sender.sendMessage(ChatColor.RED + "You are forbidden to use this command!"); sender.sendMessage(ChatColor.RED + "You are forbidden to use this command!");