make energy servo be fully controlled by redstone

This commit is contained in:
DBotThePony 2023-01-31 00:23:24 +07:00
parent e35a3aaf80
commit 2b9920c8ac
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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
}