Remove jump commands

This commit is contained in:
Minecon724 2025-01-05 12:45:36 +01:00
parent bccdc7d232
commit b7bf79ee31
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
2 changed files with 3 additions and 57 deletions

View file

@ -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");

View file

@ -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);