summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command
diff options
context:
space:
mode:
authorbobby29831 <me@bobby29831.com>2022-05-14 08:47:54 -0500
committerbobby29831 <me@bobby29831.com>2022-05-14 08:47:54 -0500
commit99d31ff71cecb0de3eac175384d9b55312a8a619 (patch)
tree38fa53d6d4ae8e3ca87a92f63c66e920baba7f67 /src/main/java/net/tylermurphy/hideAndSeek/command
parentrefactor: reorganize PlayerInfo without static variables (diff)
downloadkenshinshideandseek-99d31ff71cecb0de3eac175384d9b55312a8a619.tar.gz
kenshinshideandseek-99d31ff71cecb0de3eac175384d9b55312a8a619.tar.bz2
kenshinshideandseek-99d31ff71cecb0de3eac175384d9b55312a8a619.zip
refactor: clean up typos, improperly named variables
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java32
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java2
2 files changed, 17 insertions, 17 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java
index 8114838..3286c74 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java
@@ -40,7 +40,7 @@ public class SetBorder implements ICommand {
return;
}
if (args.length < 3) {
- worldborderEnabled = false;
+ worldBorderEnabled = false;
addToConfig("worldBorder.enabled",false);
saveConfig();
sender.sendMessage(messagePrefix + message("WORLDBORDER_DISABLE"));
@@ -68,26 +68,26 @@ public class SetBorder implements ICommand {
sender.sendMessage(errorPrefix + message("WORLDBORDER_CHANGE_SIZE"));
return;
}
- Vector newWorldborderPosition = new Vector();
+ Vector vec = new Vector();
Player player = (Player) sender;
- newWorldborderPosition.setX(player.getLocation().getBlockX());
- newWorldborderPosition.setY(0);
- newWorldborderPosition.setZ(player.getLocation().getBlockZ());
- if (spawnPosition.distance(newWorldborderPosition) > 100) {
+ vec.setX(player.getLocation().getBlockX());
+ vec.setY(0);
+ vec.setZ(player.getLocation().getBlockZ());
+ if (spawnPosition.distance(vec) > 100) {
sender.sendMessage(errorPrefix + message("WORLDBORDER_POSITION"));
return;
}
- worldborderPosition = newWorldborderPosition;
- worldborderSize = num;
- worldborderDelay = delay;
- worldborderChange = change;
- worldborderEnabled = true;
- addToConfig("worldBorder.x", worldborderPosition.getBlockX());
- addToConfig("worldBorder.z", worldborderPosition.getBlockZ());
- addToConfig("worldBorder.delay", worldborderDelay);
- addToConfig("worldBorder.size", worldborderSize);
+ worldBorderPosition = vec;
+ worldBorderSize = num;
+ worldBorderDelay = delay;
+ worldBorderChange = change;
+ worldBorderEnabled = true;
+ addToConfig("worldBorder.x", worldBorderPosition.getBlockX());
+ addToConfig("worldBorder.z", worldBorderPosition.getBlockZ());
+ addToConfig("worldBorder.delay", worldBorderDelay);
+ addToConfig("worldBorder.size", worldBorderSize);
addToConfig("worldBorder.enabled", true);
- addToConfig("worldBorder.move", worldborderChange);
+ addToConfig("worldBorder.move", worldBorderChange);
sender.sendMessage(messagePrefix + message("WORLDBORDER_ENABLE").addAmount(num).addAmount(delay));
saveConfig();
Main.getInstance().getGame().getBorder().resetWorldBorder(spawnWorld);
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java
index d96252d..1f454d6 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java
@@ -36,7 +36,7 @@ public class SetSpawnLocation implements ICommand {
Player player = (Player) sender;
LocationUtils.setLocation(player, Locations.GAME, vector -> {
- if (worldborderEnabled && vector.distance(worldborderPosition) > 100) {
+ if (worldBorderEnabled && vector.distance(worldBorderPosition) > 100) {
sender.sendMessage(errorPrefix + message("WORLDBORDER_POSITION"));
throw new RuntimeException("World border not enabled or not in valid position!");
}