Compare commits

..

2 commits

Author SHA1 Message Date
b7bf79ee31
Remove jump commands 2025-01-05 12:45:36 +01:00
bccdc7d232
Remove spawn command 2025-01-05 11:41:49 +01:00
3 changed files with 5 additions and 73 deletions

View file

@ -56,20 +56,11 @@ public class Configuration {
chance = config.getDouble("chance"); chance = config.getDouble("chance");
attackDamage = config.getDouble("attackDamage"); attackDamage = config.getDouble("attackDamage");
attackDelay = config.getInt("attackDelay"); attackDelay = config.getInt("attackDelay");
jumpMode = config.getInt("jumpMode"); jumpMode = config.getInt("jumpMode");
jumpCondition = config.getInt("jumpCondition"); jumpCondition = config.getInt("jumpCondition");
jumpDelay = config.getInt("jumpDelay"); jumpDelay = config.getInt("jumpDelay");
jumpHeight = config.getDouble("jumpHeight", defaultJumpHeight());
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);
}
double _attackReach = config.getDouble("attackReach"); double _attackReach = config.getDouble("attackReach");
double _attackVerticalReach = config.getDouble("attackVerticalReach"); 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.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -20,13 +19,11 @@ import java.util.Map;
public class GiantsCommand implements CommandExecutor { public class GiantsCommand implements CommandExecutor {
private final GiantsPlugin plugin; private final GiantsPlugin plugin;
private final Configuration configuration;
private final UpdateCommand updateCommand; private final UpdateCommand updateCommand;
public GiantsCommand(GiantsPlugin plugin, Configuration configuration, UpdateCommand updateCommand) { public GiantsCommand(GiantsPlugin plugin, UpdateCommand updateCommand) {
this.plugin = plugin; this.plugin = plugin;
this.configuration = configuration;
this.updateCommand = updateCommand; this.updateCommand = updateCommand;
} }
@ -46,19 +43,7 @@ public class GiantsCommand implements CommandExecutor {
Player player = sender instanceof Player ? (Player) sender : null; Player player = sender instanceof Player ? (Player) sender : null;
if (action.equals("spawn")) { if (action.equals("serialize")) {
sender.sendMessage("This command is deprecated. Use /summon giant instead");
if (player != null) {
if (plugin.isSpawnableAt(player.getLocation())) {
sender.sendMessage("Spawned a Giant");
player.getWorld().spawnEntity(player.getLocation(), EntityType.GIANT);
} else {
sender.sendMessage("No space here for a Giant");
}
} else {
sender.sendMessage("Only players can use this command.");
}
} else if (action.equals("serialize")) {
if (player != null) { if (player != null) {
ItemStack itemStack = player.getInventory().getItemInMainHand(); ItemStack itemStack = player.getInventory().getItemInMainHand();
@ -96,48 +81,6 @@ public class GiantsCommand implements CommandExecutor {
} else { } else {
sender.sendMessage("Only players can use this command."); 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")) { } else if (action.equals("update")) {
if (updateCommand != null) if (updateCommand != null)
updateCommand.onCommand(sender, command, label, args); updateCommand.onCommand(sender, command, label, args);

View file

@ -9,10 +9,8 @@ load: STARTUP
commands: commands:
giants: giants:
description: Utility command for Giants description: Utility command for Giants
permissions: permissions:
giants.command.spawn:
description: Permits /giants spawn
default: op
giants.command.serialize: giants.command.serialize:
description: Permits /giants serialize description: Permits /giants serialize
default: op default: op