From e09aadbb933e90b07b36adf0cfeef7da85445b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9FuzhanK?= <54169162+hardsiamang655@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:21:43 +0300 Subject: [PATCH] Update WorldCommand.java --- .../command/defaults/WorldCommand.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/cn/yescallop/essentialsnk/command/defaults/WorldCommand.java b/src/main/java/cn/yescallop/essentialsnk/command/defaults/WorldCommand.java index 05db7a5..2a08b52 100644 --- a/src/main/java/cn/yescallop/essentialsnk/command/defaults/WorldCommand.java +++ b/src/main/java/cn/yescallop/essentialsnk/command/defaults/WorldCommand.java @@ -28,32 +28,31 @@ public WorldCommand(EssentialsAPI api) { //KailynDev2024® } - public int execute(CommandSender sender, String commandLabel, Map.Entry result, CommandLogger log) { - var args = result.getKey(); + public boolean execute(CommandSender sender, String label, String[] args) { if (!this.testPermission(sender)) { - return 0; + return false; } if (!this.testIngame(sender)) { - return 0; + return false; } - if (args.length() != 1) { + if (args.length != 1) { this.sendUsage(sender); - return 0; + return false; } if (api.hasCooldown(sender)) { - return 1; + return true; } if (api.getServer().getLevelByName(args[0])==null) { sender.sendMessage(TextFormat.RED + Language.translate("commands.world.notfound", args[0])); - return 1; + return true; } else if (!api.getServer().isLevelLoaded(args[0])) { sender.sendMessage(Language.translate("commands.world.loading")); if (!api.getServer().loadLevel(args[0])) { sender.sendMessage(TextFormat.RED + Language.translate("commands.world.unloadable")); - return 0; + return false; } } api.onTP((Player) sender, api.getServer().getLevelByName(args[0]).getSpawnLocation(), Language.translate("commands.generic.teleporting")); - return 1; + return true; } }