From d854be3e34b979c1a541d922db40099e850fe7ca Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 27 Apr 2020 17:01:26 +0200 Subject: [PATCH] fixed the staff of shadows crashing on magma blocks --- .../java/de/ellpeck/naturesaura/items/ItemCaveFinder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java b/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java index cf60c3b5..52c60732 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java @@ -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);