From e646e1e7c24958e05a8810eb4556936fc6c7e59f Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 9 Mar 2021 18:34:13 -0500 Subject: [PATCH] Fix Redstone Controller not updating when mode is changed --- .../redstone_controller/RedstoneControllerBlockEntity.kt | 6 ++++++ 1 file changed, 6 insertions(+) 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 75cee55..07df638 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 @@ -17,6 +17,10 @@ class RedstoneControllerBlockEntity: DeviceBlockEntity(PhyBlockEntities.REDSTONE var managedDevices = Array(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]