Sentry Issue #223489411
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:
parent
c4bb9a23d5
commit
2e23d59702
@ -255,11 +255,15 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
if (GetState() == GameState.Recruit || GetState() == GameState.Prepare)
|
if (GetState() == GameState.Recruit || GetState() == GameState.Prepare)
|
||||||
{
|
{
|
||||||
Projectile proj = event.getEntity();
|
Projectile proj = event.getEntity();
|
||||||
WitherSkull ws = (WitherSkull) proj;
|
|
||||||
|
|
||||||
if (ws.getShooter() instanceof Wither)
|
if (proj instanceof WitherSkull)
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
WitherSkull ws = (WitherSkull) proj;
|
||||||
|
|
||||||
|
if (ws.getShooter() instanceof Wither)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user