t
This commit is contained in:
		| @ -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)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build()); |         player.getInventory().setHelmet((new ItemBuilder(Material.LEATHER_HELMET)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).addUnbreakable().build()); | ||||||
|         player.getInventory().setChestplate((new ItemBuilder(Material.LEATHER_CHESTPLATE)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build()); |         player.getInventory().setChestplate((new ItemBuilder(Material.LEATHER_CHESTPLATE)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).addUnbreakable().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)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build()); |             player.getInventory().setLeggings((new ItemBuilder(Material.LEATHER_LEGGINGS)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).addUnbreakable().build()); | ||||||
|             player.getInventory().setBoots((new ItemBuilder(Material.LEATHER_BOOTS)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build()); |             player.getInventory().setBoots((new ItemBuilder(Material.LEATHER_BOOTS)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).addUnbreakable().build()); | ||||||
|  |  | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -183,7 +183,7 @@ public class PlayerCurrentGameData { | |||||||
|                 return; |                 return; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         player.getInventory().setLeggings((new ItemBuilder(leggingsMaterial)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build()); |         player.getInventory().setLeggings((new ItemBuilder(leggingsMaterial)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).addUnbreakable().build()); | ||||||
|         player.getInventory().setBoots((new ItemBuilder(bootsMaterial)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).build()); |         player.getInventory().setBoots((new ItemBuilder(bootsMaterial)).color(gameTeam.getPlayerTeam().getColor()).addEnchantments(protection).addUnbreakable().build()); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ import rip.tilly.bedwars.playerdata.PlayerState; | |||||||
| import rip.tilly.bedwars.playerdata.currentgame.PlayerCurrentGameData; | import rip.tilly.bedwars.playerdata.currentgame.PlayerCurrentGameData; | ||||||
| import rip.tilly.bedwars.upgrades.Upgrade; | import rip.tilly.bedwars.upgrades.Upgrade; | ||||||
| import rip.tilly.bedwars.utils.CC; | import rip.tilly.bedwars.utils.CC; | ||||||
|  | import rip.tilly.bedwars.utils.ItemBuilder; | ||||||
|  |  | ||||||
| @AllArgsConstructor | @AllArgsConstructor | ||||||
| public class RespawnRunnable extends BukkitRunnable { | public class RespawnRunnable extends BukkitRunnable { | ||||||
| @ -62,17 +63,17 @@ public class RespawnRunnable extends BukkitRunnable { | |||||||
|             PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData(); |             PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData(); | ||||||
|             playerCurrentGameData.giveTeamArmor(this.player, playerCurrentGameData); |             playerCurrentGameData.giveTeamArmor(this.player, playerCurrentGameData); | ||||||
|  |  | ||||||
|             ItemStack itemStack = new ItemStack(Material.WOOD_SWORD, 1); |             ItemBuilder itemBuilder = new ItemBuilder(Material.WOOD_SWORD).addUnbreakable(); | ||||||
|  |  | ||||||
|             if (playerCurrentGameData.getLevelForUpgrade(Upgrade.SHARPENED_SWORDS) == 1) { |             if (playerCurrentGameData.getLevelForUpgrade(Upgrade.SHARPENED_SWORDS) == 1) { | ||||||
|                 itemStack.addEnchantment(Enchantment.DAMAGE_ALL, 1); |                 itemBuilder.enchantment(Enchantment.DAMAGE_ALL, 1); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (playerCurrentGameData.getLevelForUpgrade(Upgrade.MANIAC_MINER) != 0) { |             if (playerCurrentGameData.getLevelForUpgrade(Upgrade.MANIAC_MINER) != 0) { | ||||||
|                 this.player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 1000000, playerCurrentGameData.getLevelForUpgrade(Upgrade.MANIAC_MINER))); |                 this.player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 1000000, playerCurrentGameData.getLevelForUpgrade(Upgrade.MANIAC_MINER))); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             player.getInventory().addItem(itemStack); |             player.getInventory().addItem(itemBuilder.build()); | ||||||
|  |  | ||||||
|             this.game.getTeams().forEach(team -> team.playingPlayers().filter(player1 -> !this.player.equals(player1)) |             this.game.getTeams().forEach(team -> team.playingPlayers().filter(player1 -> !this.player.equals(player1)) | ||||||
|                     .forEach(matchplayer -> matchplayer.sendMessage(CC.translate(this.gameTeam.getPlayerTeam().getChatColor() + this.player.getName() + " &ehas respawned!")))); |                     .forEach(matchplayer -> matchplayer.sendMessage(CC.translate(this.gameTeam.getPlayerTeam().getChatColor() + this.player.getName() + " &ehas respawned!")))); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Trixkz
					Trixkz