diff --git a/src/main/java/world/bentobox/limits/calculators/Results.java b/src/main/java/world/bentobox/limits/calculators/Results.java index ffa37d1..b2c01e0 100644 --- a/src/main/java/world/bentobox/limits/calculators/Results.java +++ b/src/main/java/world/bentobox/limits/calculators/Results.java @@ -1,8 +1,7 @@ package world.bentobox.limits.calculators; -import java.util.concurrent.atomic.AtomicLong; - import org.bukkit.Material; +import org.bukkit.entity.EntityType; import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; @@ -23,8 +22,7 @@ public class Results { TIMEOUT } final Multiset mdCount = HashMultiset.create(); - // AtomicLong and AtomicInteger must be used because they are changed by multiple concurrent threads - AtomicLong rawBlockCount = new AtomicLong(0); + final Multiset entityCount = HashMultiset.create(); final Result state; @@ -41,6 +39,7 @@ public class Results { public Multiset getMdCount() { return mdCount; } + /** * @return the state */ @@ -48,4 +47,11 @@ public class Results { return state; } + /** + * @return the entityCount + */ + public Multiset getEntityCount() { + return entityCount; + } + } \ No newline at end of file diff --git a/src/main/java/world/bentobox/limits/commands/CalcCommand.java b/src/main/java/world/bentobox/limits/commands/CalcCommand.java index 17b0b92..c4cb0ee 100644 --- a/src/main/java/world/bentobox/limits/commands/CalcCommand.java +++ b/src/main/java/world/bentobox/limits/commands/CalcCommand.java @@ -14,7 +14,7 @@ import world.bentobox.limits.calculators.Pipeliner; /** * - * @author YellowZaki + * @author YellowZaki, tastybento */ public class CalcCommand extends CompositeCommand { @@ -59,13 +59,13 @@ public class CalcCommand extends CompositeCommand { return false; } else { //Calculate - user.sendRawMessage("Now recounting. This could take a while, please wait..."); + user.sendMessage("island.limits.recount.now-recounting"); new Pipeliner(addon).addIsland(island).thenAccept(results -> { if (results == null) { - user.sendRawMessage("Already counting..."); + user.sendMessage("island.limits.recount.in-progress"); } else { switch (results.getState()) { - case TIMEOUT -> user.sendRawMessage("Time out when recounting. Is the island really big?"); + case TIMEOUT -> user.sendMessage("admin.limits.calc.timeout"); default -> user.sendMessage("admin.limits.calc.finished"); } } diff --git a/src/main/java/world/bentobox/limits/commands/RecountCommand.java b/src/main/java/world/bentobox/limits/commands/RecountCommand.java index 4f5e77d..5f31c8b 100644 --- a/src/main/java/world/bentobox/limits/commands/RecountCommand.java +++ b/src/main/java/world/bentobox/limits/commands/RecountCommand.java @@ -60,13 +60,13 @@ public class RecountCommand extends CompositeCommand { public boolean execute(User user, String label, List args) { // Set cooldown setCooldown(user.getUniqueId(), addon.getConfig().getInt("cooldown", 120)); - user.sendRawMessage("Now recounting. This could take a while, please wait..."); + user.sendMessage("island.limits.recount.now-recounting"); new Pipeliner(addon).addIsland(island).thenAccept(results -> { if (results == null) { - user.sendRawMessage("Already counting..."); + user.sendMessage("island.limits.recount.in-progress"); } else { switch (results.getState()) { - case TIMEOUT -> user.sendRawMessage("Time out when recounting. Is the island really big?"); + case TIMEOUT -> user.sendMessage("admin.limits.calc.timeout"); default -> user.sendMessage("admin.limits.calc.finished"); } } diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 211b49a..e1b9488 100755 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -19,7 +19,7 @@ admin: calc: parameters: "" description: "recalculate the island limits for player" - finished: "&aIsland recalc finished successfully!" + finished: "&a Island recalc finished successfully!" island: limits: @@ -30,4 +30,7 @@ island: no-limits: "&cNo limits set in this world" recount: description: "recounts limits for your island" + now-recounting: "&b Now recounting. This could take a while, please wait..." + in-progress: "&c Island recound is in progress. Please wait..." + time-out: "&c Time out when recounting. Is the island really big?"