From a8b0b9275f1318ac63899e483f36a59c081e5e6b Mon Sep 17 00:00:00 2001 From: GabrielOlvH Date: Mon, 20 Jun 2022 22:00:00 -0300 Subject: [PATCH] Drain no longer requires energy --- .../me/steven/indrev/blockentities/farms/DrainBlockEntity.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/me/steven/indrev/blockentities/farms/DrainBlockEntity.kt b/src/main/kotlin/me/steven/indrev/blockentities/farms/DrainBlockEntity.kt index ebc25e1a..8cdd2819 100644 --- a/src/main/kotlin/me/steven/indrev/blockentities/farms/DrainBlockEntity.kt +++ b/src/main/kotlin/me/steven/indrev/blockentities/farms/DrainBlockEntity.kt @@ -36,10 +36,10 @@ class DrainBlockEntity(tier: Tier, pos: BlockPos, state: BlockState) : MachineBl override fun machineTick() { val world = world ?: return val fluidComponent = fluidComponent ?: return - if (world.time % 20 != 0L || !fluidComponent[0].isEmpty) return + if (ticks % 20 == 0 || !fluidComponent[0].isEmpty) return val fluidState = world.getFluidState(pos.up()) - if (fluidState?.isEmpty == false && canUse(config.energyCost)) { + if (fluidState?.isEmpty == false) { val range = getWorkingArea() // DOWN is intentionally excluded val directions = arrayOf(Direction.UP, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) @@ -65,7 +65,6 @@ class DrainBlockEntity(tier: Tier, pos: BlockPos, state: BlockState) : MachineBl val drained = block.drainFluid(world, pos, blockState) if (drained != Fluids.EMPTY) { fluidComponent[0].insert(FluidVariant.of(drained), bucket, true) - use(config.energyCost) return } }