Fix Redstone Controller not updating when mode is changed

This commit is contained in:
Shadowfacts 2021-03-09 18:34:13 -05:00
parent b78eb192de
commit e646e1e7c2
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,10 @@ class RedstoneControllerBlockEntity: DeviceBlockEntity(PhyBlockEntities.REDSTONE
var managedDevices = Array<IPAddress?>(5) { null }
var redstoneMode = RedstoneMode.HIGH
set(value) {
field = value
redstoneStateChanged()
}
private var redstonePowered = false
@ -24,6 +28,8 @@ class RedstoneControllerBlockEntity: DeviceBlockEntity(PhyBlockEntities.REDSTONE
}
fun redstoneStateChanged() {
if (world!!.isClient) return
val oldPowered = redstonePowered
redstonePowered = cachedState[RedstoneControllerBlock.POWERED]