From bc953fa2b56d23cdf457b160597dfa31f73540fa Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 24 Nov 2021 17:06:35 +0100 Subject: [PATCH] Update UpgradesMenu.java --- .../rip/tilly/bedwars/utils/menusystem/menu/UpgradesMenu.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 dc079d7..4a8780e 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 @@ -55,6 +55,8 @@ public class UpgradesMenu extends Menu { Game game = this.main.getGameManager().getGameFromUUID(player.getUniqueId()); + GameTeam gameTeam = game.getTeamByName(playerData.getPlayerTeam().getName()); + if (event.getView().getTitle().equalsIgnoreCase(CC.translate("&eUpgrades Menu"))) { for (UpgradeItem upgradeItem : this.upgradeItems) { if (upgradeItem.getItemStack(player, playerCurrentGameData).getItemMeta().getDisplayName().equalsIgnoreCase(event.getCurrentItem().getItemMeta().getDisplayName())) { @@ -65,7 +67,7 @@ public class UpgradesMenu extends Menu { } if (upgradeItem.canBuy(player, playerCurrentGameData.getLevelForUpgrade(upgradeItem.getUpgrade()) + 1)) { - upgradeItem.buy(player, playerCurrentGameData.getLevelForUpgrade(upgradeItem.getUpgrade()) + 1, game, game.getTeams().get(playerCurrentGameData.getTeamId()), playerCurrentGameData); + upgradeItem.buy(player, playerCurrentGameData.getLevelForUpgrade(upgradeItem.getUpgrade()) + 1, game, gameTeam, playerCurrentGameData); player.updateInventory();