Skip to content

Commit

Permalink
Drain no longer requires energy
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielOlvH committed Jun 21, 2022
1 parent 1f9e7cd commit a8b0b92
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
}
Expand Down

0 comments on commit a8b0b92

Please sign in to comment.