UltimateStacker/UltimateStacker/src/main/java/com.craftaro.ultimatestacker/commands/CommandSettings.java

50 lines
1.3 KiB
Java
Raw Normal View History

2023-05-25 19:20:03 +02:00
package com.craftaro.ultimatestacker.commands;
2018-11-09 22:26:23 +01:00
2023-05-30 11:21:46 +02:00
import com.craftaro.ultimatestacker.UltimateStacker;
2019-09-03 22:38:00 +02:00
import com.songoda.core.commands.AbstractCommand;
import com.songoda.core.configuration.editor.PluginConfigGui;
2019-09-07 15:29:24 +02:00
import com.songoda.core.gui.GuiManager;
2018-11-09 22:26:23 +01:00
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
2020-06-28 04:12:13 +02:00
import java.util.Collections;
2019-08-19 17:07:10 +02:00
import java.util.List;
2018-11-09 22:26:23 +01:00
public class CommandSettings extends AbstractCommand {
2020-09-01 20:30:08 +02:00
private final UltimateStacker plugin;
private final GuiManager guiManager;
2019-09-03 22:38:00 +02:00
2020-09-01 20:30:08 +02:00
public CommandSettings(UltimateStacker plugin, GuiManager guiManager) {
2020-06-28 04:12:13 +02:00
super(CommandType.PLAYER_ONLY, "Settings");
2019-09-07 15:29:24 +02:00
this.guiManager = guiManager;
2020-09-01 20:30:08 +02:00
this.plugin = plugin;
2018-11-09 22:26:23 +01:00
}
@Override
2019-09-03 22:38:00 +02:00
protected ReturnType runCommand(CommandSender sender, String... args) {
2020-09-01 20:30:08 +02:00
guiManager.showGUI((Player) sender, new PluginConfigGui(plugin));
2018-11-09 22:26:23 +01:00
return ReturnType.SUCCESS;
}
2019-08-19 17:07:10 +02:00
@Override
2019-09-03 22:38:00 +02:00
protected List<String> onTab(CommandSender sender, String... args) {
2020-06-28 04:12:13 +02:00
return Collections.emptyList();
2019-08-19 17:07:10 +02:00
}
2018-11-09 22:26:23 +01:00
@Override
public String getPermissionNode() {
2019-05-30 05:47:26 +02:00
return "ultimatestacker.admin";
2018-11-09 22:26:23 +01:00
}
@Override
public String getSyntax() {
2020-06-28 04:12:13 +02:00
return "settings";
2018-11-09 22:26:23 +01:00
}
@Override
public String getDescription() {
2019-06-02 03:27:51 +02:00
return "Edit the UltimateStacker Settings.";
2018-11-09 22:26:23 +01:00
}
}