Fix crash when loading Redstone Controller/Emitter from NBT
This commit is contained in:
parent
c2f1f606f2
commit
8b1705f0a0
|
@ -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]
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue