cleanup code

This commit is contained in:
kforbro
2021-10-26 12:52:40 +03:00
parent d43bde0750
commit cd3d527119
8 changed files with 27 additions and 21 deletions
@@ -55,7 +55,7 @@ public class CommandWhitelistVelocity {
public static void reloadConfig(CommandSource source) {
server.getScheduler().buildTask(plugin, () -> {
reloadConfig();
source.sendMessage(Identity.nil(), CWCommand.miniMessage.parse(getConfigCache().prefix+getConfigCache().config_reloaded));
source.sendMessage(Identity.nil(), CWCommand.miniMessage.parse(getConfigCache().prefix + getConfigCache().config_reloaded));
}).schedule();
}
@@ -65,7 +65,7 @@ public class CommandWhitelistVelocity {
CommandMeta commandMeta = server.getCommandManager().metaBuilder("vcw").build();
server.getCommandManager().register(commandMeta, new VelocityMainCommand());
Metrics metrics = metricsFactory.make(this, 8704);
metrics.addCustomChart(new SimplePie("proxy", ()-> "Velocity"));
metrics.addCustomChart(new SimplePie("proxy", () -> "Velocity"));
}
@Subscribe
@@ -74,7 +74,7 @@ public class CommandWhitelistVelocity {
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
HashSet<String> allowedCommands = CommandWhitelistVelocity.getCommands(player);
event.getRootNode().getChildren().removeIf((commandNode) ->
server.getCommandManager().hasCommand(commandNode.getName())
server.getCommandManager().hasCommand(commandNode.getName())
&& !allowedCommands.contains(commandNode.getName())
);
}
@@ -1,9 +1,9 @@
{
"id":"commandwhitelist",
"name":"CommandWhitelist",
"version":"${project.version}",
"description":"You decide what commands players can use or tab complete on your server!",
"authors":["YouHaveTrouble"],
"dependencies":[],
"main":"eu.endermite.commandwhitelist.velocity.CommandWhitelistVelocity"
"id": "commandwhitelist",
"name": "CommandWhitelist",
"version": "${project.version}",
"description": "You decide what commands players can use or tab complete on your server!",
"authors": ["YouHaveTrouble"],
"dependencies": [],
"main": "eu.endermite.commandwhitelist.velocity.CommandWhitelistVelocity"
}