summaryrefslogtreewikicommitdiff
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
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
-rw-r--r--.github/workflows/beta.yml2
-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
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java34
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/game/Board.java6
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/game/Game.java14
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/game/events/Border.java28
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/util/CommandHandler.java2
-rw-r--r--src/main/resources/config.yml4
-rw-r--r--src/main/resources/plugin.yml2
10 files changed, 63 insertions, 63 deletions
diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml
index 5cf7218..80db5b7 100644
--- a/.github/workflows/beta.yml
+++ b/.github/workflows/beta.yml
@@ -30,7 +30,7 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- - name: Upload artificats
+ - name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts-beta
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!");
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java
index 9fdaaa6..7ed8454 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java
@@ -46,9 +46,9 @@ public class Config {
messagePrefix,
errorPrefix,
tauntPrefix,
- worldborderPrefix,
+ worldBorderPrefix,
abortPrefix,
- gameoverPrefix,
+ gameOverPrefix,
warningPrefix,
spawnWorld,
exitWorld,
@@ -62,13 +62,13 @@ public class Config {
spawnPosition,
lobbyPosition,
exitPosition,
- worldborderPosition;
+ worldBorderPosition;
- public static boolean
- nametagsVisible,
+ public static boolean
+ nameTagsVisible,
permissionsRequired,
announceMessagesToNonPlayers,
- worldborderEnabled,
+ worldBorderEnabled,
tauntEnabled,
tauntCountdown,
tauntLast,
@@ -87,10 +87,10 @@ public class Config {
public static int
minPlayers,
- worldborderSize,
- worldborderDelay,
+ worldBorderSize,
+ worldBorderDelay,
currentWorldborderSize,
- worldborderChange,
+ worldBorderChange,
gameLength,
saveMinX,
saveMinZ,
@@ -183,15 +183,15 @@ public class Config {
exitWorld = config.getString("spawns.exit.world");
//World border
- worldborderPosition = new Vector(
+ worldBorderPosition = new Vector(
config.getInt("worldBorder.x"),
0,
config.getInt("worldBorder.z")
);
- worldborderSize = Math.max(100, config.getInt("worldBorder.size"));
- worldborderDelay = Math.max(1, config.getInt("worldBorder.delay"));
- worldborderEnabled = config.getBoolean("worldBorder.enabled");
- worldborderChange = config.getInt("worldBorder.moveAmount");
+ worldBorderSize = Math.max(100, config.getInt("worldBorder.size"));
+ worldBorderDelay = Math.max(1, config.getInt("worldBorder.delay"));
+ worldBorderEnabled = config.getBoolean("worldBorder.enabled");
+ worldBorderChange = config.getInt("worldBorder.moveAmount");
//Prefix
char SYMBOLE = '\u00A7';
@@ -200,9 +200,9 @@ public class Config {
messagePrefix = config.getString("prefix.default").replace("&", SYMBOLE_STRING);
errorPrefix = config.getString("prefix.error").replace("&", SYMBOLE_STRING);
tauntPrefix = config.getString("prefix.taunt").replace("&", SYMBOLE_STRING);
- worldborderPrefix = config.getString("prefix.border").replace("&", SYMBOLE_STRING);
+ worldBorderPrefix = config.getString("prefix.border").replace("&", SYMBOLE_STRING);
abortPrefix = config.getString("prefix.abort").replace("&", SYMBOLE_STRING);
- gameoverPrefix = config.getString("prefix.gameover").replace("&", SYMBOLE_STRING);
+ gameOverPrefix = config.getString("prefix.gameover").replace("&", SYMBOLE_STRING);
warningPrefix = config.getString("prefix.warning").replace("&", SYMBOLE_STRING);
//Map Bounds
@@ -248,7 +248,7 @@ public class Config {
ringingSound = ringingOptional.orElse(XSound.BLOCK_NOTE_BLOCK_PLING);
//Other
- nametagsVisible = config.getBoolean("nametagsVisible");
+ nameTagsVisible = config.getBoolean("nametagsVisible");
permissionsRequired = config.getBoolean("permissionsRequired");
gameLength = config.getInt("gameLength");
pvpEnabled = config.getBoolean("pvp");
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java
index 41950a1..876cb42 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java
@@ -265,7 +265,7 @@ public class Board {
String value = getTeam(player);
board.setLine(String.valueOf(i), line.replace("{TEAM}", value));
} else if (line.contains("{BORDER}")) {
- if (!worldborderEnabled) continue;
+ if (!worldBorderEnabled) continue;
if (worldBorder == null || status == Status.STARTING) {
board.setLine(String.valueOf(i), line.replace("{BORDER}", BORDER_COUNTING.replace("{AMOUNT}", "0")));
} else if (!worldBorder.isRunning()) {
@@ -401,7 +401,7 @@ class CustomBoard {
for(Player player : Main.getInstance().getBoard().getSeekers())
seekerTeam.addEntry(player.getName());
if (Version.atLeast("1.9")) {
- if (nametagsVisible) {
+ if (nameTagsVisible) {
hiderTeam.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.FOR_OWN_TEAM);
seekerTeam.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.FOR_OTHER_TEAMS);
} else {
@@ -409,7 +409,7 @@ class CustomBoard {
seekerTeam.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
}
} else {
- if (nametagsVisible) {
+ if (nameTagsVisible) {
hiderTeam.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
seekerTeam.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OWN_TEAM);
} else {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java
index 15341c0..e81d0e5 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java
@@ -303,7 +303,7 @@ public class Game {
board.reloadGameBoards();
gameTimer--;
}
- if (worldborderEnabled) worldBorder.update();
+ if (worldBorderEnabled) worldBorder.update();
if (tauntEnabled) taunt.update();
if (glowEnabled) glow.update();
}
@@ -336,12 +336,12 @@ public class Game {
private void checkWinConditions() {
if (board.sizeHider() < 1) {
if (hiderLeft) {
- if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_HIDERS_QUIT"));
- else broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_HIDERS_QUIT"));
+ if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameOverPrefix + message("GAME_GAMEOVER_HIDERS_QUIT"));
+ else broadcastMessage(gameOverPrefix + message("GAME_GAMEOVER_HIDERS_QUIT"));
stop(WinType.NONE);
} else {
- if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_HIDERS_FOUND"));
- else broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_HIDERS_FOUND"));
+ if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameOverPrefix + message("GAME_GAMEOVER_HIDERS_FOUND"));
+ else broadcastMessage(gameOverPrefix + message("GAME_GAMEOVER_HIDERS_FOUND"));
stop(WinType.SEEKER_WIN);
}
} else if (board.sizeSeeker() < 1) {
@@ -349,8 +349,8 @@ public class Game {
else broadcastMessage(abortPrefix + message("GAME_GAMEOVER_SEEKERS_QUIT"));
stop(WinType.NONE);
} else if (gameTimer < 1) {
- if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_TIME"));
- else broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_TIME"));
+ if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameOverPrefix + message("GAME_GAMEOVER_TIME"));
+ else broadcastMessage(gameOverPrefix + message("GAME_GAMEOVER_TIME"));
stop(WinType.HIDER_WIN);
}
hiderLeft = false;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/events/Border.java b/src/main/java/net/tylermurphy/hideAndSeek/game/events/Border.java
index aa6beca..647c4b6 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/game/events/Border.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/game/events/Border.java
@@ -13,31 +13,31 @@ public class Border {
private boolean running;
public Border() {
- delay = 60 * worldborderDelay;
+ delay = 60 * worldBorderDelay;
}
public void update() {
if (delay == 30 && !running) {
- Main.getInstance().getGame().broadcastMessage(worldborderPrefix + message("WORLDBORDER_WARN"));
+ Main.getInstance().getGame().broadcastMessage(worldBorderPrefix + message("WORLDBORDER_WARN"));
} else if (delay == 0) {
if (running) {
- delay = 60 * worldborderDelay;
+ delay = 60 * worldBorderDelay;
running = false;
}
- else decreaceWorldborder();
+ else decreaseWorldBorder();
}
delay--;
}
- private void decreaceWorldborder() {
+ private void decreaseWorldBorder() {
if (currentWorldborderSize == 100) return;
- int change = worldborderChange;
- if (currentWorldborderSize-worldborderChange < 100) {
+ int change = worldBorderChange;
+ if (currentWorldborderSize-worldBorderChange < 100) {
change = currentWorldborderSize-100;
}
running = true;
- Main.getInstance().getGame().broadcastMessage(worldborderPrefix + message("WORLDBORDER_DECREASING").addAmount(change));
- currentWorldborderSize -= worldborderChange;
+ Main.getInstance().getGame().broadcastMessage(worldBorderPrefix + message("WORLDBORDER_DECREASING").addAmount(change));
+ currentWorldborderSize -= worldBorderChange;
World world = Bukkit.getWorld(Main.getInstance().getGame().getGameWorld());
assert world != null;
org.bukkit.WorldBorder border = world.getWorldBorder();
@@ -49,15 +49,15 @@ public class Border {
World world = Bukkit.getWorld(worldName);
assert world != null;
org.bukkit.WorldBorder border = world.getWorldBorder();
- if (worldborderEnabled) {
- border.setSize(worldborderSize);
- border.setCenter(worldborderPosition.getX(), worldborderPosition.getZ());
- currentWorldborderSize = worldborderSize;
+ if (worldBorderEnabled) {
+ border.setSize(worldBorderSize);
+ border.setCenter(worldBorderPosition.getX(), worldBorderPosition.getZ());
+ currentWorldborderSize = worldBorderSize;
} else {
border.setSize(30000000);
border.setCenter(0, 0);
}
- delay = 60 * worldborderDelay;
+ delay = 60 * worldBorderDelay;
}
public int getDelay() {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/CommandHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/util/CommandHandler.java
index 3a05ee5..6034607 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/util/CommandHandler.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/util/CommandHandler.java
@@ -82,7 +82,7 @@ public class CommandHandler {
try {
COMMAND_REGISTER.get(args[0].toLowerCase()).execute(sender,Arrays.copyOfRange(args, 1, args.length));
} catch (Exception e) {
- sender.sendMessage(errorPrefix + "An error has occured.");
+ sender.sendMessage(errorPrefix + "An error has occurred.");
e.printStackTrace();
}
}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index c509200..2d76b4a 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -94,8 +94,8 @@ leaveServer: hub
# default: true
mapSaveEnabled: true
-# The worldborder closes every interval, which is evey [delay] in minutes.
-# Thw worldborder starts at [size], and decreases 100 blocks every interval.
+# The world border closes every interval, which is evey [delay] in minutes.
+# Thw world border starts at [size], and decreases 100 blocks every interval.
# x & z are the center location. [enabled] is whenever the border is enabled.
# You can choose if Hiders are warned 30 seconds before the border moves.
worldBorder:
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 93fec0d..b9ad408 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -42,7 +42,7 @@ permissions:
description: Allows you to reload the config
default: op
hideandseek.setborder:
- description: Allows you to set the game worldborder
+ description: Allows you to set the game world border
default: op
hideandseek.setspawn:
description: Allows you to set the game spawn point