From 5a633c1ad2b428b482718d5c8dbdf0f35440f9df Mon Sep 17 00:00:00 2001 From: TiagoFar78 Date: Tue, 26 Mar 2024 21:34:04 +0000 Subject: [PATCH] small bugs fixed --- .../net/tiagofar78/prisonescape/game/PrisonEscapeGame.java | 4 ++++ .../net/tiagofar78/prisonescape/game/phases/Finished.java | 2 +- .../net/tiagofar78/prisonescape/game/phases/Ongoing.java | 2 +- .../net/tiagofar78/prisonescape/game/phases/Waiting.java | 2 +- .../prisonescape/game/prisonbuilding/PrisonBuilding.java | 6 +++--- .../prisonescape/managers/MessageLanguageManager.java | 4 ++-- src/main/resources/languages/english.yml | 4 ++-- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/tiagofar78/prisonescape/game/PrisonEscapeGame.java b/src/main/java/net/tiagofar78/prisonescape/game/PrisonEscapeGame.java index eecc4e2e..b7e61125 100644 --- a/src/main/java/net/tiagofar78/prisonescape/game/PrisonEscapeGame.java +++ b/src/main/java/net/tiagofar78/prisonescape/game/PrisonEscapeGame.java @@ -377,6 +377,10 @@ public void playerMove(String playerName, PrisonEscapeLocation loc) { return; } + if (!_prisionersTeam.isOnTeam(player)) { + return; + } + if (player.hasEscaped()) { return; } diff --git a/src/main/java/net/tiagofar78/prisonescape/game/phases/Finished.java b/src/main/java/net/tiagofar78/prisonescape/game/phases/Finished.java index ab6fead1..e80eadc8 100644 --- a/src/main/java/net/tiagofar78/prisonescape/game/phases/Finished.java +++ b/src/main/java/net/tiagofar78/prisonescape/game/phases/Finished.java @@ -9,7 +9,7 @@ public Phase next() { @Override public boolean isClockStopped() { - return false; + return true; } @Override diff --git a/src/main/java/net/tiagofar78/prisonescape/game/phases/Ongoing.java b/src/main/java/net/tiagofar78/prisonescape/game/phases/Ongoing.java index 5bd9d547..80cd29d8 100644 --- a/src/main/java/net/tiagofar78/prisonescape/game/phases/Ongoing.java +++ b/src/main/java/net/tiagofar78/prisonescape/game/phases/Ongoing.java @@ -9,7 +9,7 @@ public Phase next() { @Override public boolean isClockStopped() { - return true; + return false; } @Override diff --git a/src/main/java/net/tiagofar78/prisonescape/game/phases/Waiting.java b/src/main/java/net/tiagofar78/prisonescape/game/phases/Waiting.java index aacfcd3a..5d119a92 100644 --- a/src/main/java/net/tiagofar78/prisonescape/game/phases/Waiting.java +++ b/src/main/java/net/tiagofar78/prisonescape/game/phases/Waiting.java @@ -9,7 +9,7 @@ public Phase next() { @Override public boolean isClockStopped() { - return false; + return true; } @Override diff --git a/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/PrisonBuilding.java b/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/PrisonBuilding.java index 49c4f5f3..79933f9f 100644 --- a/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/PrisonBuilding.java +++ b/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/PrisonBuilding.java @@ -70,9 +70,9 @@ public PrisonEscapeLocation getWaitingLobbyLocation() { } public boolean isOutsidePrison(PrisonEscapeLocation loc) { - return loc.getX() > _prisonTopLeftCorner.getX() || _prisonBottomRightCorner.getX() < loc.getX() || - loc.getY() > _prisonTopLeftCorner.getY() || _prisonBottomRightCorner.getY() < loc.getY() || - loc.getZ() > _prisonTopLeftCorner.getZ() || _prisonBottomRightCorner.getZ() < loc.getZ(); + return loc.getX() > _prisonTopLeftCorner.getX() || loc.getX() < _prisonBottomRightCorner.getX() || + loc.getY() > _prisonTopLeftCorner.getY() || loc.getY() < _prisonBottomRightCorner.getY() || + loc.getZ() > _prisonTopLeftCorner.getZ() || loc.getZ() < _prisonBottomRightCorner.getZ(); } public PrisonEscapeLocation getPoliceSpawnLocation(int index) { diff --git a/src/main/java/net/tiagofar78/prisonescape/managers/MessageLanguageManager.java b/src/main/java/net/tiagofar78/prisonescape/managers/MessageLanguageManager.java index e088e5ac..8c022e89 100644 --- a/src/main/java/net/tiagofar78/prisonescape/managers/MessageLanguageManager.java +++ b/src/main/java/net/tiagofar78/prisonescape/managers/MessageLanguageManager.java @@ -167,9 +167,9 @@ private MessageLanguageManager(String language) { _policeWonSubtitle = createMessage(messages.getString(announcementPath + "PoliceWonSubtitle")); _victoryWord = messages.getString(announcementPath + "VictoryWord"); _defeatWord = messages.getString(announcementPath + "DefeatWord"); - _gameResultMessage = createMessage(messages.getStringList(announcementPath + "GameResultMessage")); + _gameResultMessage = createMessage(messages.getStringList(announcementPath + "GameResult")); _playerEscapedMessage = createMessage(messages.getString(announcementPath + "PlayerEscaped")); - _gameCancelledNotEnoughPlayers = createMessage(messages.getString(announcementPath + "GameCancelledForFewPlayers")); + _gameCancelledNotEnoughPlayers = createMessage(messages.getString(announcementPath + "GameCancelledFewPlayers")); String errorPath = messagePath + "Errors."; _notAllowedMessage = createMessage(messages.getString(errorPath + "NotAllowed")); diff --git a/src/main/resources/languages/english.yml b/src/main/resources/languages/english.yml index dd352c09..892871af 100644 --- a/src/main/resources/languages/english.yml +++ b/src/main/resources/languages/english.yml @@ -38,7 +38,7 @@ Messages: PoliceWonSubtitle: "&f{PLAYERS} was still in prison" VictoryWord: "Victory" DefeatWord: "Defeat" - GameResultMessage: + GameResult: - "&6===================================" - "" - " &f&l{RESULT}" @@ -48,7 +48,7 @@ Messages: - "" - "&6===================================" PlayerEscaped: "&ePlayer &f{PLAYER} &eescaped the prison." - GameCancelledFewPlayersMessage: "&cThe game was cancelled because there were not enough players." + GameCancelledFewPlayers: "&cThe game was cancelled because there were not enough players." Errors: NotAllowed: "&cYou don't have permission to do that." CommandForPlayers: "&cOnly players have permission to use this command."