fixed the staff of shadows crashing on magma blocks

This commit is contained in:
Ellpeck 2020-04-27 17:01:26 +02:00
parent 081ffb365c
commit d854be3e34

View file

@ -35,8 +35,12 @@ public class ItemCaveFinder extends ItemImpl {
for (int z = -range; z <= range; z++) {
BlockPos offset = pos.add(x, y, z);
BlockState state = worldIn.getBlockState(offset);
if (!state.getBlock().canCreatureSpawn(state, worldIn, offset, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, null))
try {
if (!state.getBlock().canCreatureSpawn(state, worldIn, offset, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, null))
continue;
} catch (Exception e) {
continue;
}
BlockPos offUp = offset.up();
BlockState stateUp = worldIn.getBlockState(offUp);