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() {
|
fun redstoneStateChanged() {
|
||||||
if (world!!.isClient) return
|
if (world == null || world!!.isClient) return
|
||||||
|
|
||||||
val oldPowered = redstonePowered
|
val oldPowered = redstonePowered
|
||||||
redstonePowered = cachedState[RedstoneControllerBlock.POWERED]
|
redstonePowered = cachedState[RedstoneControllerBlock.POWERED]
|
||||||
|
|
|
@ -67,8 +67,8 @@ class RedstoneEmitterBlockEntity: DeviceBlockEntity(PhyBlockEntities.REDSTONE_EM
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun recalculateRedstone() {
|
private fun recalculateRedstone() {
|
||||||
if (world!!.isClient) return
|
if (world == null || world!!.isClient) return
|
||||||
|
|
||||||
if (stackToMonitor.isEmpty) {
|
if (stackToMonitor.isEmpty) {
|
||||||
cachedEmittedPower = 0
|
cachedEmittedPower = 0
|
||||||
updateWorld()
|
updateWorld()
|
||||||
|
|
Loading…
Reference in New Issue