t
This commit is contained in:
parent
71915af23b
commit
db09e4b59b
@ -1,7 +1,9 @@
|
|||||||
package rip.tilly.bedwars.runnables;
|
package rip.tilly.bedwars.runnables;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
@ -51,19 +53,27 @@ public class RespawnRunnable extends BukkitRunnable {
|
|||||||
this.player.playSound(this.player.getLocation(), Sound.ORB_PICKUP, 10F, 1F);
|
this.player.playSound(this.player.getLocation(), Sound.ORB_PICKUP, 10F, 1F);
|
||||||
|
|
||||||
// this.player.getInventory().setArmorContents(this.plugin.getGameManager().getGameArmor(this.playerData, this.playerData.getPlayerTeam().getTeamUpgrades()));
|
// this.player.getInventory().setArmorContents(this.plugin.getGameManager().getGameArmor(this.playerData, this.playerData.getPlayerTeam().getTeamUpgrades()));
|
||||||
for (ItemStack stack : this.plugin.getGameManager().getGameItems(this.playerData.getCurrentGameData(), this.playerData.getPlayerTeam().getTeamUpgrades())) {
|
// for (ItemStack stack : this.plugin.getGameManager().getGameItems(this.playerData.getCurrentGameData(), this.playerData.getPlayerTeam().getTeamUpgrades())) {
|
||||||
this.player.getInventory().addItem(stack);
|
// this.player.getInventory().addItem(stack);
|
||||||
}
|
// }
|
||||||
|
|
||||||
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(this.player.getUniqueId());
|
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(this.player.getUniqueId());
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
if (playerCurrentGameData.getLevelForUpgrade(Upgrade.SHARPENED_SWORDS) == 1) {
|
||||||
|
itemStack.addEnchantment(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);
|
||||||
|
|
||||||
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!"))));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user