From 56e6cac28f0ed7bf02b974cca85c88faa78b1479 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 27 Dec 2021 13:14:32 -0600 Subject: [PATCH] 1.3.3 rc1 --- .../net/tylermurphy/hideAndSeek/Main.java | 2 +- .../hideAndSeek/command/About.java | 2 +- .../tylermurphy/hideAndSeek/command/Help.java | 2 +- .../hideAndSeek/command/ICommand.java | 2 +- .../tylermurphy/hideAndSeek/command/Join.java | 32 ++----------------- .../hideAndSeek/command/Leave.java | 2 +- .../hideAndSeek/command/Reload.java | 2 +- .../hideAndSeek/command/SaveMap.java | 2 +- .../hideAndSeek/command/SetBorder.java | 2 +- .../hideAndSeek/command/SetBounds.java | 2 +- .../hideAndSeek/command/SetExitLocation.java | 2 +- .../hideAndSeek/command/SetLobbyLocation.java | 2 +- .../hideAndSeek/command/SetSpawnLocation.java | 2 +- .../hideAndSeek/command/Setup.java | 2 +- .../hideAndSeek/command/Start.java | 2 +- .../tylermurphy/hideAndSeek/command/Stop.java | 2 +- .../tylermurphy/hideAndSeek/command/Top.java | 2 +- .../tylermurphy/hideAndSeek/command/Wins.java | 2 +- .../hideAndSeek/configuration/Config.java | 2 +- .../configuration/ConfigManager.java | 2 +- .../hideAndSeek/configuration/Items.java | 2 +- .../configuration/Localization.java | 2 +- .../configuration/LocalizationString.java | 2 +- .../hideAndSeek/database/Database.java | 2 +- .../hideAndSeek/database/PlayerInfo.java | 2 +- .../hideAndSeek/database/PlayerInfoTable.java | 2 +- .../tylermurphy/hideAndSeek/game/Board.java | 2 +- .../hideAndSeek/game/CommandHandler.java | 2 +- .../hideAndSeek/game/EventListener.java | 12 ++++--- .../tylermurphy/hideAndSeek/game/Game.java | 26 ++++++++++++++- .../tylermurphy/hideAndSeek/util/Packet.java | 2 +- .../tylermurphy/hideAndSeek/util/Status.java | 2 +- .../hideAndSeek/util/TabCompleter.java | 2 +- .../hideAndSeek/util/UUIDFetcher.java | 2 +- .../tylermurphy/hideAndSeek/util/WinType.java | 2 +- .../hideAndSeek/world/VoidGenerator.java | 2 +- .../hideAndSeek/world/WorldLoader.java | 2 +- .../resources/lang/localization_de-DE.yml | 1 + .../resources/lang/localization_en-US.yml | 1 + 39 files changed, 71 insertions(+), 69 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/Main.java b/src/main/java/net/tylermurphy/hideAndSeek/Main.java index 3e2daf3..f1b3364 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/Main.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/Main.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java b/src/main/java/net/tylermurphy/hideAndSeek/command/About.java index 4882af2..de1062b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/About.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Help.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Help.java index 379301c..c1934a9 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Help.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Help.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/ICommand.java b/src/main/java/net/tylermurphy/hideAndSeek/command/ICommand.java index edadca9..6404c22 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/ICommand.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/ICommand.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java index c7d5fc2..0ca21d1 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,16 +23,10 @@ import static net.tylermurphy.hideAndSeek.configuration.Config.*; import net.tylermurphy.hideAndSeek.game.Board; import net.tylermurphy.hideAndSeek.game.Game; -import net.tylermurphy.hideAndSeek.util.Status; import org.bukkit.Bukkit; -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.attribute.Attribute; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import java.util.Objects; - import static net.tylermurphy.hideAndSeek.configuration.Localization.*; public class Join implements ICommand { @@ -52,29 +46,7 @@ public class Join implements ICommand { return; } - join(player); - } - - public static void join(Player player){ - if(Game.status == Status.STANDBY) { - player.getInventory().clear(); - Board.addHider(player); - if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player)); - else Game.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player)); - player.teleport(new Location(Bukkit.getWorld(lobbyWorld), lobbyPosition.getX(),lobbyPosition.getY(),lobbyPosition.getZ())); - player.setGameMode(GameMode.ADVENTURE); - Board.createLobbyBoard(player); - Board.reloadLobbyBoards(); - } else { - Board.addSpectator(player); - player.sendMessage(messagePrefix + message("GAME_JOIN_SPECTATOR")); - player.setGameMode(GameMode.SPECTATOR); - Board.createGameBoard(player); - player.teleport(new Location(Bukkit.getWorld("hideandseek_"+spawnWorld), spawnPosition.getX(),spawnPosition.getY(),spawnPosition.getZ())); - } - - player.setFoodLevel(20); - player.setHealth(Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getBaseValue()); + Game.join(player); } public String getLabel() { diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java index 2954f1d..cc4f0b4 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java index 183377f..fc2592b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java index 5878035..c48e1c6 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java index ecbdbef..5f14b20 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetBorder.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetBounds.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetBounds.java index d5f8a64..9f4101a 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetBounds.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetBounds.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java index 6f3364b..7461767 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java index af9c2de..69e5e52 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java index f68fda5..7afe861 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java index 49d1cde..74c29bf 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java index 5a59650..b82e3b5 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java index 329048f..b41277b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java index 10df4bd..760bb2c 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java index 304762e..dfa5338 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java index 6998ffd..524eeac 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java index c950468..84ad5b4 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java index 26c4991..569cae6 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java index dbf7915..d5ae01d 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/LocalizationString.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/LocalizationString.java index 228bb08..3d8bc0f 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/LocalizationString.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/LocalizationString.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java b/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java index 5681f33..602c948 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfo.java b/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfo.java index b59f434..8464b54 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfo.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfo.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java b/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java index f3daa62..e859687 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java index 9df39be..d81e310 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/CommandHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/CommandHandler.java index 7ff7c74..8df3cf2 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/CommandHandler.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/CommandHandler.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java index 4dba35a..4911d5f 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -54,7 +54,7 @@ public class EventListener implements Listener { Game.removeItems(event.getPlayer()); if(Game.isNotSetup()) return; if(autoJoin){ - Join.join(event.getPlayer()); + Game.join(event.getPlayer()); } else if(teleportToExit) { if (event.getPlayer().getWorld().getName().equals("hideandseek_" + spawnWorld) || event.getPlayer().getWorld().getName().equals(lobbyWorld)) { event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ())); @@ -62,8 +62,12 @@ public class EventListener implements Listener { } } else { if (event.getPlayer().getWorld().getName().equals("hideandseek_" + spawnWorld)) { - event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ())); - event.getPlayer().setGameMode(GameMode.ADVENTURE); + if(Game.status != Status.STANDBY){ + Game.join(event.getPlayer()); + } else { + event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ())); + event.getPlayer().setGameMode(GameMode.ADVENTURE); + } } } } diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java index 6ee4cf6..39d6376 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -28,6 +28,7 @@ import net.tylermurphy.hideAndSeek.util.Status; import net.tylermurphy.hideAndSeek.util.WinType; import net.tylermurphy.hideAndSeek.world.WorldLoader; import org.bukkit.*; +import org.bukkit.attribute.Attribute; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Firework; @@ -219,6 +220,29 @@ public class Game { } } + public static void join(Player player){ + if(Game.status == Status.STANDBY) { + player.getInventory().clear(); + Board.addHider(player); + if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player)); + else Game.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player)); + player.teleport(new Location(Bukkit.getWorld(lobbyWorld), lobbyPosition.getX(),lobbyPosition.getY(),lobbyPosition.getZ())); + player.setGameMode(GameMode.ADVENTURE); + Board.createLobbyBoard(player); + Board.reloadLobbyBoards(); + } else { + Board.addSpectator(player); + player.sendMessage(messagePrefix + message("GAME_JOIN_SPECTATOR")); + player.setGameMode(GameMode.SPECTATOR); + Board.createGameBoard(player); + player.teleport(new Location(Bukkit.getWorld("hideandseek_"+spawnWorld), spawnPosition.getX(),spawnPosition.getY(),spawnPosition.getZ())); + player.sendTitle(ChatColor.GRAY + "" + ChatColor.BOLD + "SPECTATING", ChatColor.WHITE + message("SPECTATOR_SUBTITLE").toString(), 10, 70, 20); + } + + player.setFoodLevel(20); + player.setHealth(Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getBaseValue()); + } + public static void removeItems(Player player){ for(ItemStack si : Items.SEEKER_ITEMS) for(ItemStack i : player.getInventory().getContents()) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/Packet.java b/src/main/java/net/tylermurphy/hideAndSeek/util/Packet.java index 9d863f8..18913da 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/Packet.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/Packet.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/Status.java b/src/main/java/net/tylermurphy/hideAndSeek/util/Status.java index 305da9f..44a3e42 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/Status.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/Status.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/TabCompleter.java b/src/main/java/net/tylermurphy/hideAndSeek/util/TabCompleter.java index d793d9e..4c949e1 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/TabCompleter.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/TabCompleter.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/UUIDFetcher.java b/src/main/java/net/tylermurphy/hideAndSeek/util/UUIDFetcher.java index c79f335..ef65af3 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/UUIDFetcher.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/UUIDFetcher.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/WinType.java b/src/main/java/net/tylermurphy/hideAndSeek/util/WinType.java index f633d1b..3c555cc 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/WinType.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/WinType.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java b/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java index 1e75be7..7f29d6a 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java b/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java index 5d84ceb..5d6e377 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java @@ -5,7 +5,7 @@ * * Kenshins Hide and Seek free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * he Free Software Foundation, either version 3 of the License. + * he Free Software Foundation version 3. * * Kenshins Hide and Seek is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/main/resources/lang/localization_de-DE.yml b/src/main/resources/lang/localization_de-DE.yml index 49e5f5e..b48aa4e 100644 --- a/src/main/resources/lang/localization_de-DE.yml +++ b/src/main/resources/lang/localization_de-DE.yml @@ -58,6 +58,7 @@ Localization: STOP: "Das Spiel wurde gestoppt." HIDERS_SUBTITLE: "Verstecke dich gut vor den Seekern!" SEEKERS_SUBTITLE: "Finde alle Hider!" + SPECTATOR_SUBTITLE: "Du bist mitten im spiel beigetreten." BOUNDS_WRONG_WORLD: "Führe diesen Befehl bitte in der Spielwelt aus." BOUNDS: "Grenzen erfolgreich an dieser Position gesetzt. ({AMOUNT}/2)" NOT_AT_ZERO: "Bitte nicht an einer Position setzen, die eine Koordinate bei 0 enthält." diff --git a/src/main/resources/lang/localization_en-US.yml b/src/main/resources/lang/localization_en-US.yml index 1a2a25a..93cbd4e 100644 --- a/src/main/resources/lang/localization_en-US.yml +++ b/src/main/resources/lang/localization_en-US.yml @@ -58,6 +58,7 @@ Localization: STOP: "Game has been force stopped." HIDERS_SUBTITLE: "Hide away from the seekers" SEEKERS_SUBTITLE: "Eliminate all hiders" + SPECTATOR_SUBTITLE: "You joined mid-game." BOUNDS_WRONG_WORLD: "Please run this command in the game world." BOUNDS: "Successfully set bounds at this position ({AMOUNT}/2)." NOT_AT_ZERO: "Please do not set at a location containing a coordinate at 0."