diff --git a/src/main/kotlin/net/shadowfacts/phycon/block/redstone_controller/RedstoneControllerBlockEntity.kt b/src/main/kotlin/net/shadowfacts/phycon/block/redstone_controller/RedstoneControllerBlockEntity.kt index 07df638..1640ddf 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/block/redstone_controller/RedstoneControllerBlockEntity.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/block/redstone_controller/RedstoneControllerBlockEntity.kt @@ -28,7 +28,7 @@ class RedstoneControllerBlockEntity: DeviceBlockEntity(PhyBlockEntities.REDSTONE } fun redstoneStateChanged() { - if (world!!.isClient) return + if (world == null || world!!.isClient) return val oldPowered = redstonePowered redstonePowered = cachedState[RedstoneControllerBlock.POWERED] diff --git a/src/main/kotlin/net/shadowfacts/phycon/block/redstone_emitter/RedstoneEmitterBlockEntity.kt b/src/main/kotlin/net/shadowfacts/phycon/block/redstone_emitter/RedstoneEmitterBlockEntity.kt index 077e1fd..0329d43 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/block/redstone_emitter/RedstoneEmitterBlockEntity.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/block/redstone_emitter/RedstoneEmitterBlockEntity.kt @@ -67,8 +67,8 @@ class RedstoneEmitterBlockEntity: DeviceBlockEntity(PhyBlockEntities.REDSTONE_EM } private fun recalculateRedstone() { - if (world!!.isClient) return - + if (world == null || world!!.isClient) return + if (stackToMonitor.isEmpty) { cachedEmittedPower = 0 updateWorld()