diff --git a/src/main/java/com/therandomlabs/vanilladeathchest/mixin/ExplosionMixin.java b/src/main/java/com/therandomlabs/vanilladeathchest/mixin/ExplosionMixin.java index 2bbf715..f613d9c 100644 --- a/src/main/java/com/therandomlabs/vanilladeathchest/mixin/ExplosionMixin.java +++ b/src/main/java/com/therandomlabs/vanilladeathchest/mixin/ExplosionMixin.java @@ -49,10 +49,12 @@ public abstract class ExplosionMixin { @Inject(method = "collectBlocksAndDamageEntities", at = @At("TAIL")) private void collectBlocksAndDamageEntities(CallbackInfo info) { - final DeathChestsState deathChestsState = DeathChestsState.get((ServerWorld) world); - getAffectedBlocks().removeIf(pos -> { - final DeathChest deathChest = deathChestsState.getExistingDeathChest(pos); - return deathChest != null && deathChest.isLocked(); - }); + if(this.world instanceof ServerWorld) { + final DeathChestsState deathChestsState = DeathChestsState.get((ServerWorld) world); + getAffectedBlocks().removeIf(pos -> { + final DeathChest deathChest = deathChestsState.getExistingDeathChest(pos); + return deathChest != null && deathChest.isLocked(); + }); + } } }