Attempt to improve the tab completion for Plex

This commit is contained in:
2024-01-20 01:48:17 -06:00
parent c9d954d1c0
commit 8710b478c1
33 changed files with 231 additions and 102 deletions

View File

@ -108,18 +108,22 @@ public class EntityWipeCMD extends PlexCommand
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
{
List<String> entities = new ArrayList<>();
for (World world : Bukkit.getWorlds())
if (silentCheckPermission(sender, this.getPermission()))
{
for (Entity entity : world.getEntities())
List<String> entities = new ArrayList<>();
for (World world : Bukkit.getWorlds())
{
if (entity.getType() != EntityType.PLAYER)
for (Entity entity : world.getEntities())
{
entities.add(entity.getType().name());
if (entity.getType() != EntityType.PLAYER)
{
entities.add(entity.getType().name());
}
}
}
return entities.stream().toList();
}
return entities.stream().toList();
return Collections.emptyList();
}
private Integer parseInt(CommandSender sender, String string)