chore: remove poorly implemented /ps debug loadedchunks command (#4180)

- the same (but correctly implemented) functionality exists in other plugins
 - closes #4140
This commit is contained in:
Jordan 2023-10-10 11:06:22 +01:00 committed by GitHub
parent 44b1127181
commit b00a46b286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 13 deletions

View File

@ -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 <loadedchunks | player | debug-players | entitytypes | msg>"))
Tag.inserting(Component.text("/plot debug <player | debug-players | entitytypes | msg>"))
)
);
}
@ -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<UUIDMapping> mappings = PlotSquared.get().getImpromptuUUIDPipeline().getAllImmediately();
player.sendMessage(
@ -196,7 +185,7 @@ public class Debug extends SubCommand {
@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());