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,8 +48,12 @@ 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)) {
DisguiseAPI.undisguiseToAll(entity); if (entity == sender)
disguisedEntitys++; continue;
if (DisguiseAPI.isDisguised(entity)) {
DisguiseAPI.undisguiseToAll(entity);
disguisedEntitys++;
}
} }
sender.sendMessage(ChatColor.RED + "Successfully undisguised " + disguisedEntitys + " entities!"); sender.sendMessage(ChatColor.RED + "Successfully undisguised " + disguisedEntitys + " entities!");
} else } else