Remove jump commands
This commit is contained in:
parent
bccdc7d232
commit
b7bf79ee31
2 changed files with 3 additions and 57 deletions
|
@ -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");
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,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);
|
||||||
|
|
Loading…
Reference in a new issue