diff --git a/src/main/java/me/cortex/voxy/common/world/other/Mapper.java b/src/main/java/me/cortex/voxy/common/world/other/Mapper.java index 113554d6..d7d00cf3 100644 --- a/src/main/java/me/cortex/voxy/common/world/other/Mapper.java +++ b/src/main/java/me/cortex/voxy/common/world/other/Mapper.java @@ -363,8 +363,13 @@ public class Mapper { if (compound.getInt("id", -1) != id) { throw new IllegalStateException("Encoded id != expected id"); } - BlockState state = BlockState.CODEC.parse(NbtOps.INSTANCE, compound.getCompound("block_state").orElseThrow()).getOrThrow(); - return new StateEntry(id, state); + var state = BlockState.CODEC.parse(NbtOps.INSTANCE, compound.getCompound("block_state").orElseThrow()); + if (state.isError()) { + Logger.error("Could not decode blockstate setting to air. id:" + id + " error: " + state.error().get().message()); + return new StateEntry(id, Blocks.AIR.getDefaultState()); + } else { + return new StateEntry(id, state.getOrThrow()); + } } catch (IOException e) { throw new RuntimeException(e); }