Tweaked the command a bit. It works as it should now.

This commit is contained in:
Alco_Rs11 2024-01-19 19:22:24 -05:00
parent 8bf772b502
commit 3c1d0b5564
2 changed files with 11 additions and 2 deletions

View File

@ -55,14 +55,21 @@ public class MobPurgeCMD extends PlexCommand {
int count = purgeMobs(type);
if (type != null) {
PlexUtils.broadcast(messageComponent("removedEntitiesOfTypes", sender.getName(), count, mobName));
PlexLog.debug("All " + count + " valid mobs were removed");
PlexLog.debug("All " + count + " of " + mobName + " were removed");
} else {
PlexUtils.broadcast(messageComponent("removedMobs", sender.getName(), count));
PlexLog.debug("All " + count + " valid mobs were removed");
}
sender.sendMessage(messageComponent("amountOfMobsRemoved", count, (type != null ? mobName : "mob") + multipleS(count)));
return null;
}
public static String multipleS(int count) {
return (count == 1 ? "" : "s");
}
// Removes the mobs.
public int purgeMobs(EntityType type) {
int removed = 0;
for (World world : Bukkit.getWorlds()) {

View File

@ -160,7 +160,9 @@ removedEntitiesOfType: "<gray>Removed {1} {2}"
# 0 - Entity type that is invalid
invalidEntityType: "<gray>Notice: Entity type {0} is invalid!"
noRemovedEntities: "<gray>No entities were removed."
noRemovedMobs: "<gray>No mobs were removed."
# 0 - Number of mobs removed
# 1 - Type of mob removed
amountOfMobsRemoved: "<gray>{0} {1} removed."
notAValidMob: "<red>That is not a valid mob."
notAValidMobButValidEntity: "<red>That is a valid entity, but is not a valid mob."
# 0 - The command sender