Fixed hammer throw

This commit is contained in:
Mysticate 2015-10-15 23:02:51 -04:00
parent f0e0d41c42
commit f0a22d5c36

View File

@ -110,9 +110,11 @@ public class PerkHammerThrow extends Perk implements IThrown
{
Item item = itemIterator.next();
if (item.getTicksLived() > 200 || !item.isValid())
if (item == null || item.getTicksLived() > 200 || !item.isValid() || item.isDead())
{
if (item != null)
item.remove();
itemIterator.remove();
Player player = _thrown.get(item);
@ -120,9 +122,6 @@ public class PerkHammerThrow extends Perk implements IThrown
if (!Manager.IsAlive(player))
continue;
if (UtilPlayer.isSpectator(player))
continue;
_thrown.get(item).getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer")));
}
}