Skip to content

Commit

Permalink
chore: remove poorly implemented /ps debug loadedchunks command (#4180)
Browse files Browse the repository at this point in the history
- the same (but correctly implemented) functionality exists in other plugins
 - closes #4140
  • Loading branch information
dordsor21 authored Oct 10, 2023
1 parent 44b1127 commit b00a46b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Core/src/main/java/com/plotsquared/core/command/Debug.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
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;
Expand Down Expand Up @@ -71,7 +70,7 @@ public boolean onCommand(PlotPlayer<?> player, String[] args) {
TranslatableCaption.of("commandconfig.command_syntax"),
TagResolver.resolver(
"value",
Tag.inserting(Component.text("/plot debug <loadedchunks | player | debug-players | entitytypes | msg>"))
Tag.inserting(Component.text("/plot debug <player | debug-players | entitytypes | msg>"))
)
);
}
Expand All @@ -85,16 +84,6 @@ public boolean onCommand(PlotPlayer<?> player, String[] args) {
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<UUIDMapping> mappings = PlotSquared.get().getImpromptuUUIDPipeline().getAllImmediately();
player.sendMessage(
Expand Down Expand Up @@ -196,7 +185,7 @@ public boolean onCommand(PlotPlayer<?> player, String[] args) {

@Override
public Collection<Command> 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());
Expand Down

0 comments on commit b00a46b

Please sign in to comment.