diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java index 52c286f..205cf6a 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java @@ -12,7 +12,6 @@ import rip.tilly.bedwars.generators.Generator; import rip.tilly.bedwars.generators.GeneratorType; import rip.tilly.bedwars.playerdata.PlayerData; import rip.tilly.bedwars.playerdata.PlayerState; -import rip.tilly.bedwars.playerdata.currentgame.PlayerCurrentGameData; import rip.tilly.bedwars.runnables.GameRunnable; import rip.tilly.bedwars.utils.CC; import rip.tilly.bedwars.utils.CustomLocation; @@ -80,9 +79,6 @@ public class GameStartListener implements Listener { playerData.setTeamId(team.getId()); playerData.setPlayerTeam(team.getPlayerTeam()); - PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData(); - playerCurrentGameData.setTeamId(team.getId()); - playerData.setPlayerState(PlayerState.PLAYING); CustomLocation locationA = game.getCopiedArena().getA(); diff --git a/src/main/java/rip/tilly/bedwars/playerdata/currentgame/PlayerCurrentGameData.java b/src/main/java/rip/tilly/bedwars/playerdata/currentgame/PlayerCurrentGameData.java index 186c3e8..c72c605 100644 --- a/src/main/java/rip/tilly/bedwars/playerdata/currentgame/PlayerCurrentGameData.java +++ b/src/main/java/rip/tilly/bedwars/playerdata/currentgame/PlayerCurrentGameData.java @@ -34,8 +34,6 @@ public class PlayerCurrentGameData { private int axeLevel = 0; private boolean shears = false; - private int teamId; - private ArmorType armorType = ArmorType.LEATHER; private Map armor = new HashMap(); diff --git a/src/main/java/rip/tilly/bedwars/utils/menusystem/menu/UpgradesMenu.java b/src/main/java/rip/tilly/bedwars/utils/menusystem/menu/UpgradesMenu.java index 4a8780e..021dc1d 100644 --- a/src/main/java/rip/tilly/bedwars/utils/menusystem/menu/UpgradesMenu.java +++ b/src/main/java/rip/tilly/bedwars/utils/menusystem/menu/UpgradesMenu.java @@ -16,6 +16,7 @@ import rip.tilly.bedwars.utils.menusystem.PlayerMenuUtil; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Level; public class UpgradesMenu extends Menu { @@ -53,9 +54,13 @@ public class UpgradesMenu extends Menu { PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData(); - Game game = this.main.getGameManager().getGameFromUUID(player.getUniqueId()); + Game game = this.main.getGameManager().getGame(player.getUniqueId()); + if (game == null) { + this.main.getLogger().log(Level.INFO, "GAME == NULL"); + return; + } - GameTeam gameTeam = game.getTeamByName(playerData.getPlayerTeam().getName()); + GameTeam gameTeam = game.getTeams().get(playerData.getTeamId()); if (event.getView().getTitle().equalsIgnoreCase(CC.translate("&eUpgrades Menu"))) { for (UpgradeItem upgradeItem : this.upgradeItems) {