diff --git a/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/DisplayCaseBlockEntity.java b/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/DisplayCaseBlockEntity.java index a616eb8..d8eddb5 100644 --- a/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/DisplayCaseBlockEntity.java +++ b/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/DisplayCaseBlockEntity.java @@ -68,7 +68,9 @@ public void clear() { public void notifyListeners() { this.markDirty(); - world.updateListeners(getPos(), getCachedState(), getCachedState(), Block.NOTIFY_ALL); + + if(world != null) + world.updateListeners(getPos(), getCachedState(), getCachedState(), Block.NOTIFY_ALL); } @Override diff --git a/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/FillableBookshelfBlockEntity.java b/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/FillableBookshelfBlockEntity.java index 176ad39..318f976 100644 --- a/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/FillableBookshelfBlockEntity.java +++ b/src/main/java/dev/cammiescorner/arcanus/common/blocks/entities/FillableBookshelfBlockEntity.java @@ -75,9 +75,12 @@ public void clear() { public void notifyListeners() { this.markDirty(); - BlockState oldState = getCachedState(); - world.setBlockState(getPos(), world.getBlockState(getPos()).with(FillableBookshelfBlock.BOOK_COUNT, fullSlots())); - world.updateListeners(getPos(), oldState, getCachedState(), Block.NOTIFY_ALL); + + if(world != null) { + BlockState oldState = getCachedState(); + world.setBlockState(getPos(), world.getBlockState(getPos()).with(FillableBookshelfBlock.BOOK_COUNT, fullSlots())); + world.updateListeners(getPos(), oldState, getCachedState(), Block.NOTIFY_ALL); + } } public int fullSlots() { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index cb7f539..2dbfc5c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,7 +30,7 @@ ], "accessWidener": "META-INF/arcanus.accesswidener", "depends": { - "fabricloader": ">=0.12.0-", + "fabricloader": ">=0.11.0-", "fabric": "*", "minecraft": "1.17.x", "cloth-config2": ">=5.0.38",