mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2025-02-11 23:40:13 +00:00
Added affected count to /ro.
This commit is contained in:
parent
0ec8c5bc32
commit
7a7bd72127
1 changed files with 6 additions and 4 deletions
|
@ -64,21 +64,23 @@ public class Command_ro extends TFM_Command
|
|||
}
|
||||
}
|
||||
|
||||
int affected = 0;
|
||||
|
||||
if (target_player == null)
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Removing all " + from_material.name() + " within " + radius + " blocks of all players.", senderIsConsole);
|
||||
TFM_Util.adminAction(sender.getName(), "Removing all " + from_material.name() + " within " + radius + " blocks of all players. Brace for lag...", senderIsConsole);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_Util.replaceBlocks(p.getLocation(), from_material, Material.AIR, radius);
|
||||
affected += TFM_Util.replaceBlocks(p.getLocation(), from_material, Material.AIR, radius);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Removing all " + from_material.name() + " within " + radius + " blocks of " + target_player.getName() + ".", senderIsConsole);
|
||||
TFM_Util.replaceBlocks(target_player.getLocation(), from_material, Material.AIR, radius);
|
||||
affected += TFM_Util.replaceBlocks(target_player.getLocation(), from_material, Material.AIR, radius);
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Remove complete.", senderIsConsole);
|
||||
TFM_Util.adminAction(sender.getName(), "Remove complete. " + affected + " blocks removed.", senderIsConsole);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue