Update UpgradesMenu.java

This commit is contained in:
Luca 2021-11-24 17:06:35 +01:00
parent e7b43febac
commit bc953fa2b5

View File

@ -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();