From b00a46b286f9b25d2c943516fd836afac6756ae2 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 10 Oct 2023 11:06:22 +0100 Subject: [PATCH] chore: remove poorly implemented /ps debug loadedchunks command (#4180) - the same (but correctly implemented) functionality exists in other plugins - closes #4140 --- .../java/com/plotsquared/core/command/Debug.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Debug.java b/Core/src/main/java/com/plotsquared/core/command/Debug.java index 1e0090e44..d4c886488 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Debug.java +++ b/Core/src/main/java/com/plotsquared/core/command/Debug.java @@ -29,7 +29,6 @@ import com.plotsquared.core.util.WorldUtil; import com.plotsquared.core.util.entity.EntityCategories; import com.plotsquared.core.util.entity.EntityCategory; import com.plotsquared.core.util.query.PlotQuery; -import com.plotsquared.core.util.task.TaskManager; import com.plotsquared.core.uuid.UUIDMapping; import com.sk89q.worldedit.world.entity.EntityType; import net.kyori.adventure.text.Component; @@ -71,7 +70,7 @@ public class Debug extends SubCommand { TranslatableCaption.of("commandconfig.command_syntax"), TagResolver.resolver( "value", - Tag.inserting(Component.text("/plot debug ")) + Tag.inserting(Component.text("/plot debug ")) ) ); } @@ -85,16 +84,6 @@ public class Debug extends SubCommand { return true; } } - if (args.length > 0 && "loadedchunks".equalsIgnoreCase(args[0])) { - final long start = System.currentTimeMillis(); - player.sendMessage(TranslatableCaption.of("debug.fetching_loaded_chunks")); - TaskManager.runTaskAsync(() -> player.sendMessage(StaticCaption - .of("Loaded chunks: " + this.worldUtil - .getChunkChunks(player.getLocation().getWorldName()) - .size() + " (" + (System.currentTimeMillis() - - start) + "ms) using thread: " + Thread.currentThread().getName()))); - return true; - } if (args.length > 0 && "uuids".equalsIgnoreCase(args[0])) { final Collection mappings = PlotSquared.get().getImpromptuUUIDPipeline().getAllImmediately(); player.sendMessage( @@ -196,7 +185,7 @@ public class Debug extends SubCommand { @Override public Collection tab(final PlotPlayer player, String[] args, boolean space) { - return Stream.of("loadedchunks", "debug-players", "entitytypes") + return Stream.of("debug-players", "entitytypes") .filter(value -> value.startsWith(args[0].toLowerCase(Locale.ENGLISH))) .map(value -> new Command(null, false, value, "plots.admin", RequiredType.NONE, null) { }).collect(Collectors.toList());