feat(command): remove debug command

This commit is contained in:
ineanto 2023-10-10 14:28:06 +02:00
parent 074c07f628
commit 36589747af
2 changed files with 4 additions and 21 deletions

View file

@ -2,7 +2,9 @@ package xyz.atnrch.nicko;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import xyz.atnrch.nicko.command.NickoCommand;
import xyz.atnrch.nicko.config.Configuration; import xyz.atnrch.nicko.config.Configuration;
import xyz.atnrch.nicko.config.ConfigurationManager; import xyz.atnrch.nicko.config.ConfigurationManager;
import xyz.atnrch.nicko.event.PlayerJoinListener; import xyz.atnrch.nicko.event.PlayerJoinListener;
@ -82,10 +84,10 @@ public class NickoBukkit extends JavaPlugin {
} }
} }
/*final PluginCommand command = getCommand("nicko"); final PluginCommand command = getCommand("nicko");
if (command != null) { if (command != null) {
command.setExecutor(new NickoCommand()); command.setExecutor(new NickoCommand());
}*/ }
Structure.addGlobalIngredient('#', new SimpleItem(new ItemBuilder(Material.AIR))); Structure.addGlobalIngredient('#', new SimpleItem(new ItemBuilder(Material.AIR)));
Structure.addGlobalIngredient('%', new SimpleItem(new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE).setDisplayName(" "))); Structure.addGlobalIngredient('%', new SimpleItem(new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE).setDisplayName(" ")));

View file

@ -5,29 +5,15 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import xyz.atnrch.nicko.NickoBukkit;
import xyz.atnrch.nicko.gui.HomeGUI; import xyz.atnrch.nicko.gui.HomeGUI;
import xyz.atnrch.nicko.i18n.I18N; import xyz.atnrch.nicko.i18n.I18N;
import xyz.atnrch.nicko.i18n.I18NDict; import xyz.atnrch.nicko.i18n.I18NDict;
public class NickoCommand implements CommandExecutor { public class NickoCommand implements CommandExecutor {
private String helpMessage = "§cNicko §8§o[{version}] §f- §2Help:\n" +
"§6/nicko §f- §7Open the GUI.\n" +
"§6/nicko help §f- §7Print this help message.\n";
@Override @Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) { public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (sender instanceof Player) { if (sender instanceof Player) {
final Player player = (Player) sender; final Player player = (Player) sender;
if (args.length >= 1) {
if (args[0].equals("debug")) {
new NickoDebugCmd().execute(player, args);
} else {
sendHelpMessage(sender);
}
return false;
}
if (player.isOp() || player.hasPermission("nicko.use") || player.hasPermission("nicko.*")) { if (player.isOp() || player.hasPermission("nicko.use") || player.hasPermission("nicko.*")) {
new HomeGUI(player).open(); new HomeGUI(player).open();
} else { } else {
@ -40,9 +26,4 @@ public class NickoCommand implements CommandExecutor {
sender.sendMessage("This plugin can only be used in-game. Sorry!"); sender.sendMessage("This plugin can only be used in-game. Sorry!");
return false; return false;
} }
public void sendHelpMessage(CommandSender sender) {
helpMessage = helpMessage.replace("{version}", NickoBukkit.getInstance().getPluginMeta().getVersion());
sender.sendMessage(helpMessage);
}
} }