mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Fix magic missile crash. closes #54
This commit is contained in:
1 parent
ebf399edaa
commit
ab3bc85f20
1 file changed
+17
-4
@@ -181,10 +181,23 @@ public class EntityMagicMissile extends EntityThrowable {
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition pos) {
|
||||
Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
|
||||
if(!(block instanceof BlockBush) && !(block instanceof BlockLeaves) && (pos.entityHit == null || getTargetEntity() == pos.entityHit))
|
||||
setDead();
|
||||
switch (pos.typeOfHit) {
|
||||
case BLOCK: {
|
||||
Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
if(!(block instanceof BlockBush) && !(block instanceof BlockLeaves))
|
||||
setDead();
|
||||
break;
|
||||
}
|
||||
case ENTITY: {
|
||||
if (pos.entityHit == getTargetEntity())
|
||||
setDead();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
setDead();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user