From b7bf79ee31830ade43f1fe0eaf07e9f980756849 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 5 Jan 2025 12:45:36 +0100 Subject: [PATCH] Remove jump commands --- .../java/eu/m724/giants/Configuration.java | 13 +---- .../java/eu/m724/giants/GiantsCommand.java | 47 +------------------ 2 files changed, 3 insertions(+), 57 deletions(-) diff --git a/src/main/java/eu/m724/giants/Configuration.java b/src/main/java/eu/m724/giants/Configuration.java index a754743..f7c5986 100644 --- a/src/main/java/eu/m724/giants/Configuration.java +++ b/src/main/java/eu/m724/giants/Configuration.java @@ -56,20 +56,11 @@ public class Configuration { chance = config.getDouble("chance"); attackDamage = config.getDouble("attackDamage"); attackDelay = config.getInt("attackDelay"); + jumpMode = config.getInt("jumpMode"); jumpCondition = config.getInt("jumpCondition"); jumpDelay = config.getInt("jumpDelay"); - - if (jumpMode != 0) { - jumpHeight = config.getDouble("jumpHeight", -1); - if (jumpHeight == -1) { - jumpHeight = defaultJumpHeight(); - } - logger.info("Jumping is experimental."); - logger.info("Jump mode: " + jumpMode); - logger.info("Jump condition: " + jumpCondition); - logger.info("Jump height: " + jumpHeight); - } + jumpHeight = config.getDouble("jumpHeight", defaultJumpHeight()); double _attackReach = config.getDouble("attackReach"); double _attackVerticalReach = config.getDouble("attackVerticalReach"); diff --git a/src/main/java/eu/m724/giants/GiantsCommand.java b/src/main/java/eu/m724/giants/GiantsCommand.java index 2d9f26a..36c690b 100644 --- a/src/main/java/eu/m724/giants/GiantsCommand.java +++ b/src/main/java/eu/m724/giants/GiantsCommand.java @@ -5,7 +5,6 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -20,13 +19,11 @@ import java.util.Map; public class GiantsCommand implements CommandExecutor { private final GiantsPlugin plugin; - private final Configuration configuration; private final UpdateCommand updateCommand; - public GiantsCommand(GiantsPlugin plugin, Configuration configuration, UpdateCommand updateCommand) { + public GiantsCommand(GiantsPlugin plugin, UpdateCommand updateCommand) { this.plugin = plugin; - this.configuration = configuration; this.updateCommand = updateCommand; } @@ -84,48 +81,6 @@ public class GiantsCommand implements CommandExecutor { } else { sender.sendMessage("Only players can use this command."); } - } else if (action.equals("jm")) { // TODO remove - if (args.length > 1) { - int mode = Integer.parseInt(args[1]); - configuration.jumpMode = mode; - - sender.sendMessage("Jump mode set to " + mode); - sender.sendMessage("This command doesn't check if it's valid, an invalid value turns off jumping."); - - if (configuration.jumpHeight == -1) { - configuration.jumpHeight = configuration.defaultJumpHeight(); - sender.sendMessage("Jump height set to " + configuration.jumpHeight + ". Modify it with /giants jumpheight"); - } - } else { - sender.sendMessage("Jump mode: " + configuration.jumpMode); - } - } else if (action.equals("jh")) { - if (args.length > 1) { - double height = Double.parseDouble(args[1]); - configuration.jumpHeight = height; - - sender.sendMessage("Jump height set to " + height); - } else { - sender.sendMessage("Jump height: " + configuration.jumpHeight); - } - } else if (action.equals("jc")) { - if (args.length > 1) { - int condition = Integer.parseInt(args[1]); - configuration.jumpCondition = condition; - - sender.sendMessage("Jump condition set to " + condition); - } else { - sender.sendMessage("Jump condition: " + configuration.jumpCondition); - } - } else if (action.equals("jd")) { - if (args.length > 1) { - int delay = Integer.parseInt(args[1]); - configuration.jumpDelay = delay; - - sender.sendMessage("Jump delay set to " + delay); - } else { - sender.sendMessage("Jump delay: " + configuration.jumpDelay); - } } else if (action.equals("update")) { if (updateCommand != null) updateCommand.onCommand(sender, command, label, args);