Fixed hammer throw
This commit is contained in:
parent
f0e0d41c42
commit
f0a22d5c36
@ -110,9 +110,11 @@ public class PerkHammerThrow extends Perk implements IThrown
|
|||||||
{
|
{
|
||||||
Item item = itemIterator.next();
|
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();
|
item.remove();
|
||||||
|
|
||||||
itemIterator.remove();
|
itemIterator.remove();
|
||||||
|
|
||||||
Player player = _thrown.get(item);
|
Player player = _thrown.get(item);
|
||||||
@ -120,9 +122,6 @@ public class PerkHammerThrow extends Perk implements IThrown
|
|||||||
if (!Manager.IsAlive(player))
|
if (!Manager.IsAlive(player))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (UtilPlayer.isSpectator(player))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
_thrown.get(item).getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer")));
|
_thrown.get(item).getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user