- Added messages.yml for all plugin messages with customizable prefix - Added commands.yml for custom commands (discord, website, store, rules, heal, clearinventory) - Added serverselector.yml for GUI server selector menu - Added data.yml for persistent data storage (chat_locked, spawn location) - Updated ConfigManager to load all config files - Updated ChatLockManager to use data.yml instead of chatlock.dat - Updated SpawnManager to use data.yml instead of spawn.yml - Updated all commands to use messages.yml - Updated listeners to use messages.yml - Removed duplicate config files from root directory - Added CONFIG_GUIDE.md documentation
44 lines
1.5 KiB
Java
44 lines
1.5 KiB
Java
package com.loki.lohub.commands;
|
|
|
|
import com.loki.lohub.LoHub;
|
|
import com.loki.lohub.utils.TextUtil;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandExecutor;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
public class LoHubCommand implements CommandExecutor {
|
|
|
|
private final LoHub plugin;
|
|
|
|
public LoHubCommand(LoHub plugin) {
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
@Override
|
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
|
if (!sender.hasPermission("lohub.admin")) {
|
|
sender.sendMessage(TextUtil.colorize(plugin.getConfigManager().getMessage("general.no-permission")));
|
|
return true;
|
|
}
|
|
|
|
if (args.length == 0) {
|
|
sender.sendMessage(TextUtil.colorize("&7LoHub v" + plugin.getDescription().getVersion()));
|
|
sender.sendMessage(TextUtil.colorize(plugin.getConfigManager().getMessage("commands.usage-lohub")));
|
|
return true;
|
|
}
|
|
|
|
if (args[0].equalsIgnoreCase("reload")) {
|
|
plugin.getConfigManager().reload();
|
|
plugin.getHotbarManager().reload();
|
|
plugin.getAnnouncementManager().reload();
|
|
plugin.getScoreboardManager().stop();
|
|
plugin.getTablistManager().stop();
|
|
plugin.getScoreboardManager().start();
|
|
plugin.getTablistManager().start();
|
|
sender.sendMessage(TextUtil.colorize(plugin.getConfigManager().getMessage("general.config-reloaded")));
|
|
return true;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|