Skip to content

Commit

Permalink
Deny tab-complete for KeepSpawnLoaded command when don't have permission
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew121410 committed Oct 19, 2023
1 parent faac32a commit e496c21
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public KeepSpawnLoaded(World16Essentials plugin) {

this.plugin.getCommand("keepspawnloaded").setExecutor(this);
this.plugin.getCommand("keepspawnloaded").setTabCompleter((commandSender, command, s, strings) -> {
if (!(commandSender instanceof Player player)) return null;
if (!player.hasPermission("world16.keepspawnloaded")) return null;

if (strings.length == 1) {
return Arrays.asList("true", "false");
}
Expand Down

0 comments on commit e496c21

Please sign in to comment.