diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java index e1c55d9c5..50cca3ecf 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java @@ -27,6 +27,7 @@ package com.plotsquared.bukkit; import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.core.command.MainCommand; +import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.PlotPlayer; import org.bukkit.command.Command; @@ -42,6 +43,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Locale; public class BukkitCommand implements CommandExecutor, TabCompleter { @@ -63,7 +65,7 @@ public class BukkitCommand implements CommandExecutor, TabCompleter { @Override public List onTabComplete( - CommandSender commandSender, Command command, String s, + CommandSender commandSender, Command command, String label, String[] args ) { if (!(commandSender instanceof Player)) { @@ -73,8 +75,11 @@ public class BukkitCommand implements CommandExecutor, TabCompleter { if (args.length == 0) { return Collections.singletonList("plots"); } + if (!Settings.Enabled_Components.TAB_COMPLETED_ALIASES.contains(label.toLowerCase(Locale.ENGLISH))) { + return List.of(); + } Collection objects = - MainCommand.getInstance().tab(player, args, s.endsWith(" ")); + MainCommand.getInstance().tab(player, args, label.endsWith(" ")); if (objects == null) { return null; }