Fix crash when loading Redstone Controller/Emitter from NBT

This commit is contained in:
Shadowfacts 2021-03-10 18:08:57 -05:00
parent c2f1f606f2
commit 8b1705f0a0
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 3 additions and 3 deletions

View File

@ -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]

View File

@ -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()