From 2b9920c8ac84af64f786340ba1b7c50eb11b5397 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 31 Jan 2023 00:23:24 +0700 Subject: [PATCH] make energy servo be fully controlled by redstone --- .../mc/otm/block/entity/tech/EnergyServoBlockEntity.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyServoBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyServoBlockEntity.kt index 85d942161..aa6fcbdd5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyServoBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyServoBlockEntity.kt @@ -68,10 +68,16 @@ class EnergyServoBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matte } override fun extractEnergy(howMuch: Decimal, simulate: Boolean): Decimal { + if (redstoneControl.isBlockedByRedstone) + return Decimal.ZERO + return container[SLOT_DISCHARGE].energy?.extractEnergy(howMuch, simulate) ?: Decimal.ZERO } override fun receiveEnergy(howMuch: Decimal, simulate: Boolean): Decimal { + if (redstoneControl.isBlockedByRedstone) + return Decimal.ZERO + return container[SLOT_CHARGE].energy?.receiveEnergy(howMuch, simulate) ?: Decimal.ZERO }