Kit items are now unbreakable

This commit is contained in:
Sam 2016-08-04 17:29:01 +01:00
parent bd00ac8446
commit 24c1e5fc3b
7 changed files with 29 additions and 12 deletions

View File

@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.quiver.Quiver;
@ -68,8 +69,8 @@ public class KitBarrage extends ProgressingKit
private static final ItemStack IN_HAND = new ItemStack(Material.IRON_AXE);
private static final ItemStack[] PLAYER_ITEMS = {
new ItemStack(Material.IRON_AXE),
new ItemStack(Material.BOW),
new ItemBuilder(Material.IRON_AXE).setUnbreakable(true).build(),
new ItemBuilder(Material.BOW).setUnbreakable(true).build(),
};
public KitBarrage(ArcadeManager manager)

View File

@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.quiver.Quiver;
@ -69,8 +70,8 @@ public class KitBeserker extends ProgressingKit
private static final ItemStack IN_HAND = new ItemStack(Material.IRON_SWORD);
private static final ItemStack[] PLAYER_ITEMS = {
new ItemStack(Material.IRON_SWORD),
new ItemStack(Material.BOW),
new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build(),
new ItemBuilder(Material.BOW).setUnbreakable(true).build(),
};
public KitBeserker(ArcadeManager manager)

View File

@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.quiver.Quiver;
@ -54,8 +55,8 @@ public class KitHeadHunter extends ProgressingKit
private static final ItemStack IN_HAND = new ItemStack(Material.STONE_SWORD);
private static final ItemStack[] PLAYER_ITEMS = {
new ItemStack(Material.STONE_SWORD),
new ItemStack(Material.BOW),
new ItemBuilder(Material.STONE_SWORD).setUnbreakable(true).build(),
new ItemBuilder(Material.BOW).setUnbreakable(true).build(),
};
public KitHeadHunter(ArcadeManager manager)

View File

@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.quiver.Quiver;
@ -68,8 +69,8 @@ public class KitNecromancer extends ProgressingKit
private static final ItemStack IN_HAND = new ItemStack(Material.BONE);
private static final ItemStack[] PLAYER_ITEMS = {
new ItemStack(Material.IRON_AXE),
new ItemStack(Material.BOW),
new ItemBuilder(Material.IRON_AXE).setUnbreakable(true).build(),
new ItemBuilder(Material.BOW).setUnbreakable(true).build(),
};
public KitNecromancer(ArcadeManager manager)

View File

@ -80,7 +80,7 @@ public class KitNewNinja extends ProgressingKit
private static final ItemStack IN_HAND = new ItemStack(Material.GOLD_SWORD);
private static final ItemStack[] PLAYER_ITEMS = {
new ItemStack(Material.GOLD_SWORD),
new ItemBuilder(Material.GOLD_SWORD).setUnbreakable(true).build(),
};
public KitNewNinja(ArcadeManager manager)

View File

@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.quiver.Quiver;
@ -71,8 +72,8 @@ public class KitPyromancer extends ProgressingKit
private static final ItemStack IN_HAND = new ItemStack(Material.BLAZE_POWDER);
private static final ItemStack[] PLAYER_ITEMS = {
new ItemStack(Material.IRON_AXE),
new ItemStack(Material.BOW),
new ItemBuilder(Material.IRON_AXE).setUnbreakable(true).build(),
new ItemBuilder(Material.BOW).setUnbreakable(true).build(),
};
public KitPyromancer(ArcadeManager manager)

View File

@ -22,6 +22,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.quiver.kits.KitNewNinja;
import nautilus.game.arcade.kit.Perk;
@ -140,9 +141,20 @@ public class PerkShurikens extends Perk implements IThrown
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, _damage, false, false, false, data.getThrower().getName(), GetName());
if (data.getThrower() instanceof Player)
if (data.getThrower() instanceof Player && target instanceof Player)
{
Player player = (Player) data.getThrower();
Player targetPlayer = (Player) target;
if (Manager.GetGame() instanceof TeamGame)
{
TeamGame game = (TeamGame) Manager.GetGame();
if (game.GetTeam(player).equals(game.GetTeam(targetPlayer)))
{
return;
}
}
player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1F, 1.2F);
}