From 38923d79788821816e2dd5bd82c167022ff4450d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 3 Mar 2025 22:17:20 +0700 Subject: [PATCH] Fix flywheel battery not marking chunk dirty when energy level changes --- .../mc/otm/block/entity/tech/FlywheelBatteryBlockEntity.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/FlywheelBatteryBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/FlywheelBatteryBlockEntity.kt index 1ec935423..13fee1bae 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/FlywheelBatteryBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/FlywheelBatteryBlockEntity.kt @@ -37,6 +37,13 @@ class FlywheelBatteryBlockEntity(blockPos: BlockPos, blockState: BlockState) : M private var multiblock: ShapedMultiblock? = null private var lastHeight = -1 var batteryLevel = Decimal.ZERO + set(value) { + if (field != value) { + field = value + markDirtyFast() + } + } + private var cachedChargeEfficiency = Decimal.ONE val formed: Boolean