From 0bcb3dee0e820a36b30be4c4c0b47e5fdda57160 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 17 May 2022 19:48:24 -0400 Subject: [PATCH] 1.4.3 Release Canidate 1 --- .../java/net/tylermurphy/hideAndSeek/Main.java | 15 +++++++++++---- .../tylermurphy/hideAndSeek/command/Debug.java | 6 ++++-- .../hideAndSeek/game/PlayerLoader.java | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/Main.java b/src/main/java/net/tylermurphy/hideAndSeek/Main.java index f60659d..7bd86cb 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/Main.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/Main.java @@ -57,13 +57,24 @@ public class Main extends JavaPlugin implements Listener { public Main() { super(); instance = this; + + Config.loadConfig(); + Localization.loadLocalization(); + Items.loadItems(); + board = new Board(); database = new Database(); } protected Main(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) { super(loader, description, dataFolder, file); + instance = this; + + Config.loadConfig(); + Localization.loadLocalization(); + Items.loadItems(); + board = new Board(); database = new Database(); } @@ -72,10 +83,6 @@ public class Main extends JavaPlugin implements Listener { this.registerListeners(); - Config.loadConfig(); - Localization.loadLocalization(); - Items.loadItems(); - CommandHandler.registerCommands(); game = new Game(board); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Debug.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Debug.java index c1cec56..1275ceb 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Debug.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Debug.java @@ -38,7 +38,8 @@ public class Debug implements ICommand { } Main.getInstance().getBoard().addHider(player); PlayerLoader.loadHider(player, Main.getInstance().getGame().getGameWorld()); - PlayerLoader.resetPlayer(player, Main.getInstance().getBoard()); + if(Main.getInstance().getGame().getStatus() != Status.STARTING) + PlayerLoader.resetPlayer(player, Main.getInstance().getBoard()); })); debugMenu.setItem(1, createOption(1, XMaterial.GOLDEN_CHESTPLATE.parseMaterial(), "&cBecome a &lSeeker", 1, player -> { if(mapSaveEnabled) { @@ -46,7 +47,8 @@ public class Debug implements ICommand { } Main.getInstance().getBoard().addSeeker(player); PlayerLoader.loadSeeker(player, Main.getInstance().getGame().getGameWorld()); - PlayerLoader.resetPlayer(player, Main.getInstance().getBoard()); + if(Main.getInstance().getGame().getStatus() != Status.STARTING) + PlayerLoader.resetPlayer(player, Main.getInstance().getBoard()); })); debugMenu.setItem(2, createOption(2, XMaterial.IRON_CHESTPLATE.parseMaterial(), "&8Become a &lSpectator", 1, player -> { if(mapSaveEnabled) { diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/PlayerLoader.java b/src/main/java/net/tylermurphy/hideAndSeek/game/PlayerLoader.java index 0ce7ac7..19a48f4 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/PlayerLoader.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/PlayerLoader.java @@ -123,6 +123,8 @@ public class PlayerLoader { } private static void loadPlayer(Player player){ + player.setFlying(false); + player.setAllowFlight(false); player.setGameMode(GameMode.ADVENTURE); player.getInventory().clear(); for(PotionEffect effect : player.getActivePotionEffects()) {