t
This commit is contained in:
parent
248d378161
commit
71915af23b
@ -11,6 +11,7 @@ import rip.tilly.bedwars.game.GameState;
|
|||||||
import rip.tilly.bedwars.game.GameTeam;
|
import rip.tilly.bedwars.game.GameTeam;
|
||||||
import rip.tilly.bedwars.generators.Generator;
|
import rip.tilly.bedwars.generators.Generator;
|
||||||
import rip.tilly.bedwars.playerdata.PlayerData;
|
import rip.tilly.bedwars.playerdata.PlayerData;
|
||||||
|
import rip.tilly.bedwars.playerdata.currentgame.PlayerCurrentGameData;
|
||||||
import rip.tilly.bedwars.utils.CC;
|
import rip.tilly.bedwars.utils.CC;
|
||||||
import rip.tilly.bedwars.utils.PlayerUtil;
|
import rip.tilly.bedwars.utils.PlayerUtil;
|
||||||
|
|
||||||
@ -37,10 +38,15 @@ public class GameEndListener implements Listener {
|
|||||||
PlayerUtil.clearPlayer(player);
|
PlayerUtil.clearPlayer(player);
|
||||||
|
|
||||||
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId());
|
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId());
|
||||||
|
|
||||||
|
PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData();
|
||||||
|
|
||||||
playerData.setLastDamager(null);
|
playerData.setLastDamager(null);
|
||||||
playerData.getCurrentGameData().setGameKills(0);
|
playerData.getCurrentGameData().setGameKills(0);
|
||||||
playerData.getCurrentGameData().setGameBedsDestroyed(0);
|
playerData.getCurrentGameData().setGameBedsDestroyed(0);
|
||||||
|
|
||||||
|
playerCurrentGameData.getUpgrades().clear();
|
||||||
|
|
||||||
String winnerTitle = CC.translate("&aVICTORY!");
|
String winnerTitle = CC.translate("&aVICTORY!");
|
||||||
String losingTitle = CC.translate("&cDEFEAT!");
|
String losingTitle = CC.translate("&cDEFEAT!");
|
||||||
String subTitle = CC.translate(winningTeam.getPlayerTeam().getChatColor() + winningTeam.getPlayerTeam().getName() + " &fhas won the game!");
|
String subTitle = CC.translate(winningTeam.getPlayerTeam().getChatColor() + winningTeam.getPlayerTeam().getName() + " &fhas won the game!");
|
||||||
|
@ -151,14 +151,14 @@ public class PlayerCurrentGameData {
|
|||||||
|
|
||||||
GameTeam gameTeam = game.getTeams().get(playerData.getTeamId());
|
GameTeam gameTeam = game.getTeams().get(playerData.getTeamId());
|
||||||
|
|
||||||
player.getInventory().setHelmet((new ItemBuilder(Material.LEATHER_HELMET)).durability(gameTeam.getPlayerTeam().getColorData()).addEnchantments(protection).build());
|
player.getInventory().setHelmet((new ItemBuilder(Material.LEATHER_HELMET)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build());
|
||||||
player.getInventory().setChestplate((new ItemBuilder(Material.LEATHER_CHESTPLATE)).durability(gameTeam.getPlayerTeam().getColorData()).addEnchantments(protection).build());
|
player.getInventory().setChestplate((new ItemBuilder(Material.LEATHER_CHESTPLATE)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build());
|
||||||
|
|
||||||
ArmorType armorType = this.getArmorType(player);
|
ArmorType armorType = this.getArmorType(player);
|
||||||
|
|
||||||
if (armorType == ArmorType.LEATHER) {
|
if (armorType == ArmorType.LEATHER) {
|
||||||
player.getInventory().setLeggings((new ItemBuilder(Material.LEATHER_LEGGINGS)).durability(gameTeam.getPlayerTeam().getColorData()).addEnchantments(protection).build());
|
player.getInventory().setLeggings((new ItemBuilder(Material.LEATHER_LEGGINGS)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build());
|
||||||
player.getInventory().setBoots((new ItemBuilder(Material.LEATHER_BOOTS)).durability(gameTeam.getPlayerTeam().getColorData()).addEnchantments(protection).build());
|
player.getInventory().setBoots((new ItemBuilder(Material.LEATHER_BOOTS)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ public class PlayerCurrentGameData {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.getInventory().setLeggings((new ItemBuilder(leggingsMaterial)).durability(gameTeam.getPlayerTeam().getColorData()).addEnchantments(protection).build());
|
player.getInventory().setLeggings((new ItemBuilder(leggingsMaterial)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build());
|
||||||
player.getInventory().setBoots((new ItemBuilder(bootsMaterial)).durability(gameTeam.getPlayerTeam().getColorData()).addEnchantments(protection).build());
|
player.getInventory().setBoots((new ItemBuilder(bootsMaterial)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ import rip.tilly.bedwars.utils.menusystem.PlayerMenuUtil;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
public class UpgradesMenu extends Menu {
|
public class UpgradesMenu extends Menu {
|
||||||
|
|
||||||
@ -55,8 +54,8 @@ public class UpgradesMenu extends Menu {
|
|||||||
PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData();
|
PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData();
|
||||||
|
|
||||||
Game game = this.main.getGameManager().getGame(player.getUniqueId());
|
Game game = this.main.getGameManager().getGame(player.getUniqueId());
|
||||||
|
|
||||||
if (game == null) {
|
if (game == null) {
|
||||||
this.main.getLogger().log(Level.INFO, "GAME == NULL");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ public class UpgradesMenu extends Menu {
|
|||||||
if (upgradeItem.canBuy(player, playerCurrentGameData.getLevelForUpgrade(upgradeItem.getUpgrade()) + 1)) {
|
if (upgradeItem.canBuy(player, playerCurrentGameData.getLevelForUpgrade(upgradeItem.getUpgrade()) + 1)) {
|
||||||
upgradeItem.buy(player, playerCurrentGameData.getLevelForUpgrade(upgradeItem.getUpgrade()) + 1, game, gameTeam, playerCurrentGameData);
|
upgradeItem.buy(player, playerCurrentGameData.getLevelForUpgrade(upgradeItem.getUpgrade()) + 1, game, gameTeam, playerCurrentGameData);
|
||||||
|
|
||||||
player.updateInventory();
|
new UpgradesMenu(this.main.getPlayerMenuUtil(player)).open(player);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user