Don't (metaphorically) explode on null explosions

Closes #1423.
This commit is contained in:
Jonathan Coates 2023-05-03 23:38:12 +01:00
parent c0f982dc97
commit db2616d1c0
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
1 changed files with 2 additions and 2 deletions

View File

@ -172,9 +172,9 @@ public void setPlacedBy( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull B
}
@Override
public float getExplosionResistance( BlockState state, IBlockReader world, BlockPos pos, Explosion explosion )
public float getExplosionResistance( BlockState state, IBlockReader world, BlockPos pos, @Nullable Explosion explosion )
{
Entity exploder = explosion.getExploder();
Entity exploder = explosion == null ? null : explosion.getExploder();
if( getFamily() == ComputerFamily.ADVANCED || exploder instanceof LivingEntity || exploder instanceof DamagingProjectileEntity )
{
return 2000;