mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
cleanup code
This commit is contained in:
+2
-2
@@ -8,7 +8,6 @@ import eu.endermite.commandwhitelist.waterfall.listeners.BungeeChatEventListener
|
||||
import eu.endermite.commandwhitelist.waterfall.listeners.BungeeTabcompleteListener;
|
||||
import eu.endermite.commandwhitelist.waterfall.listeners.WaterfallDefineCommandsListener;
|
||||
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
@@ -30,7 +29,7 @@ public final class CommandWhitelistWaterfall extends Plugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
plugin = this;
|
||||
getLogger().info("Running on "+ ChatColor.DARK_AQUA+getProxy().getName());
|
||||
getLogger().info("Running on " + ChatColor.DARK_AQUA + getProxy().getName());
|
||||
loadConfig();
|
||||
audiences = BungeeAudiences.create(this);
|
||||
Metrics metrics = new Metrics(this, 8704);
|
||||
@@ -53,6 +52,7 @@ public final class CommandWhitelistWaterfall extends Plugin {
|
||||
public static CommandWhitelistWaterfall getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public static ConfigCache getConfigCache() {
|
||||
return configCache;
|
||||
}
|
||||
|
||||
+3
-3
@@ -52,7 +52,7 @@ public class BungeeMainCommand extends Command implements TabExecutor {
|
||||
else
|
||||
audiences.sender(sender).sendMessage(CWCommand.miniMessage.parse(configCache.prefix + configCache.group_doesnt_exist));
|
||||
} else
|
||||
audiences.sender(sender).sendMessage(Component.text("/"+label+" add <group> <command>"));
|
||||
audiences.sender(sender).sendMessage(Component.text("/" + label + " add <group> <command>"));
|
||||
return;
|
||||
case REMOVE:
|
||||
if (!sender.hasPermission(CWPermission.ADMIN.permission())) {
|
||||
@@ -65,7 +65,7 @@ public class BungeeMainCommand extends Command implements TabExecutor {
|
||||
else
|
||||
audiences.sender(sender).sendMessage(CWCommand.miniMessage.parse(configCache.prefix + configCache.group_doesnt_exist));
|
||||
} else
|
||||
audiences.sender(sender).sendMessage(Component.text("/"+label+" remove <group> <command>"));
|
||||
audiences.sender(sender).sendMessage(Component.text("/" + label + " remove <group> <command>"));
|
||||
return;
|
||||
case HELP:
|
||||
default:
|
||||
@@ -84,6 +84,6 @@ public class BungeeMainCommand extends Command implements TabExecutor {
|
||||
for (Map.Entry<String, Command> command : CommandWhitelistWaterfall.getPlugin().getProxy().getPluginManager().getCommands()) {
|
||||
serverCommands.add(command.getValue().getName());
|
||||
}
|
||||
return CWCommand.commandSuggestions(CommandWhitelistWaterfall.getConfigCache(), serverCommands, args, sender.hasPermission(CWPermission.RELOAD.permission()),sender.hasPermission(CWPermission.ADMIN.permission()));
|
||||
return CWCommand.commandSuggestions(CommandWhitelistWaterfall.getConfigCache(), serverCommands, args, sender.hasPermission(CWPermission.RELOAD.permission()), sender.hasPermission(CWPermission.ADMIN.permission()));
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -6,7 +6,6 @@ import eu.endermite.commandwhitelist.common.ConfigCache;
|
||||
import eu.endermite.commandwhitelist.common.commands.CWCommand;
|
||||
import eu.endermite.commandwhitelist.waterfall.CommandWhitelistWaterfall;
|
||||
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
Reference in New Issue
Block a user