Check if fired projectile is a WitherSkull before casting

Steps to reproduce:
1) Go to Wither Assult
2) Fire enderpearl
This commit is contained in:
samczsun 2017-02-26 13:45:45 -05:00 committed by cnr
parent c4bb9a23d5
commit 2e23d59702

View File

@ -255,6 +255,9 @@ public class WitherGame extends TeamGame implements IBlockRestorer
if (GetState() == GameState.Recruit || GetState() == GameState.Prepare)
{
Projectile proj = event.getEntity();
if (proj instanceof WitherSkull)
{
WitherSkull ws = (WitherSkull) proj;
if (ws.getShooter() instanceof Wither)
@ -263,6 +266,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
}
}
}
}
@EventHandler
public void handleCustomBlockPlace(BlockPlaceEvent event)