From 76a41c4c6cecdf92b3abbf63bdc1d9d76031a245 Mon Sep 17 00:00:00 2001 From: Infinityy <120841985+Inf1nityy@users.noreply.github.com> Date: Sat, 26 Oct 2024 18:41:42 +0200 Subject: [PATCH 1/2] make your code work, you're welcome --- src/main/java/com/nexia/base/player/PlayerDataManager.java | 4 ++++ src/main/java/com/nexia/core/utilities/time/ServerTime.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/nexia/base/player/PlayerDataManager.java b/src/main/java/com/nexia/base/player/PlayerDataManager.java index 3b72aa2c..ebeb64a1 100644 --- a/src/main/java/com/nexia/base/player/PlayerDataManager.java +++ b/src/main/java/com/nexia/base/player/PlayerDataManager.java @@ -13,6 +13,7 @@ import com.nexia.minigames.games.base.player.WLKSavedPlayerData; import com.nexia.minigames.games.bedwars.util.player.BedwarsPlayerData; import com.nexia.minigames.games.bedwars.util.player.BedwarsSavedPlayerData; +import com.nexia.minigames.games.bridge.util.player.BridgePlayerData; import com.nexia.minigames.games.duels.util.player.DuelsPlayerData; import com.nexia.minigames.games.duels.util.player.DuelsSavedPlayerData; import com.nexia.minigames.games.football.util.player.FootballPlayerData; @@ -76,6 +77,9 @@ public static void init() { // <----------- SkyWars ---------------> new PlayerDataManager(NexiaCore.SKYWARS_DATA_MANAGER, "skywars", WLKSavedPlayerData.class, SkywarsPlayerData.class); + + // <----------- Bridge ---------------> + new PlayerDataManager(NexiaCore.BRIDGE_DATA_MANAGER, "bridge", WLKSavedPlayerData.class, BridgePlayerData.class); } public PlayerData get(NexiaPlayer player) { diff --git a/src/main/java/com/nexia/core/utilities/time/ServerTime.java b/src/main/java/com/nexia/core/utilities/time/ServerTime.java index 1739b031..6d1e4bff 100644 --- a/src/main/java/com/nexia/core/utilities/time/ServerTime.java +++ b/src/main/java/com/nexia/core/utilities/time/ServerTime.java @@ -19,6 +19,7 @@ import com.nexia.minigames.games.bedwars.areas.BwAreas; import com.nexia.minigames.games.bedwars.areas.BwDimension; import com.nexia.minigames.games.bedwars.shop.BwLoadShop; +import com.nexia.minigames.games.bridge.BridgeGame; import com.nexia.minigames.games.duels.DuelGameHandler; import com.nexia.minigames.games.duels.DuelsGame; import com.nexia.minigames.games.duels.team.TeamDuelsGame; @@ -77,6 +78,7 @@ public static void firstTick(MinecraftServer server) { SkywarsGame.firstTick(); OitcGame.firstTick(); + BridgeGame.firstTick(); DuelGameHandler.starting(); } @@ -103,6 +105,7 @@ public static void everyTick() { SkyFfaBlocks.tick(); FootballGame.tick(); OitcGame.tick(); + BridgeGame.tick(); if (totalTickCount % 5 == 0) { FfaClassicUtil.INSTANCE.fiveTick(); @@ -126,6 +129,7 @@ static void everySecond() { OitcGame.second(); FootballGame.second(); SkywarsGame.second(); + BridgeGame.second(); try { for (DuelsGame game : DuelGameHandler.duelsGames) { if (game == null) return; From 37a2c5f35ce781478cb13036ac5a3d9cb1d16765 Mon Sep 17 00:00:00 2001 From: database-test <143010276+database-test@users.noreply.github.com> Date: Sat, 26 Oct 2024 17:06:47 -0400 Subject: [PATCH 2/2] hope to fix map more now maybe --- .../com/nexia/minigames/games/bridge/BridgeGame.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nexia/minigames/games/bridge/BridgeGame.java b/src/main/java/com/nexia/minigames/games/bridge/BridgeGame.java index 56f38097..9867c538 100644 --- a/src/main/java/com/nexia/minigames/games/bridge/BridgeGame.java +++ b/src/main/java/com/nexia/minigames/games/bridge/BridgeGame.java @@ -58,10 +58,10 @@ public class BridgeGame { public static ArrayList queue = new ArrayList<>(); public static boolean isStarted = false; public static boolean isEnding = false; + public static UUID gameUUID = UUID.randomUUID(); private static BridgeTeam winnerTeam = null; private static int endTime = 5; - public static void leave(NexiaPlayer player) { BridgePlayerData data = (BridgePlayerData) PlayerDataManager.getDataManager(BRIDGE_DATA_MANAGER).get(player); BridgeGame.spectator.remove(player); @@ -162,8 +162,8 @@ public static void giveKit(NexiaPlayer player) { player.unwrap().setSlot(0, sword); player.unwrap().setSlot(1, bow); player.unwrap().setSlot(2, arrow); + player.unwrap().setSlot(3, blocks); player.unwrap().setSlot(4, blocks); - player.unwrap().setSlot(5, blocks); player.unwrap().setSlot(6, pickaxe); player.unwrap().setSlot(8, gap); @@ -184,10 +184,11 @@ public static void second() { for (NexiaPlayer player : BridgeGame.getViewers()) { player.runCommand("/hub", 0, false); } - + deleteWorld(gameUUID.toString()); BridgeGame.resetAll(); } + BridgeGame.endTime--; } else { BridgeGame.updateInfo(); @@ -348,6 +349,9 @@ public static void joinQueue(NexiaPlayer player) { } public static void endGame(BridgeTeam winnerTeam) { + + deleteWorld(gameUUID.toString()); + BridgeGame.isEnding = true; if (winnerTeam == null) { @@ -658,7 +662,7 @@ public static void deleteWorld(String id) { public static void firstTick() { resetAll(); - UUID gameUUID = UUID.randomUUID(); + map.structureMap.pasteMap(createWorld(gameUUID.toString(), true)); }