PylonFluidBlock

A block that interacts with fluids in some way.

This is a very flexible class which requires you to define exactly how fluid should be input and output. You are responsible for keeping track of any state, like how much fluid is stored.

Most fluid blocks can use PylonFluidBufferBlock or PylonFluidTank instead.

PylonFluidBlock must be implemented by any block that has fluid inputs/outputs. This interface allowed you to request fluids from input points, supply fluids to output points, and specify how to add/remove fluids from your block.

At this time, having multiple inputs/outputs is not supported.

See also

Inheritors

Functions

Link copied to clipboard
open fun fluidAmountRequested(fluid: PylonFluid, deltaSeconds: Double): Double

Returns the amount of the given fluid that the machine wants to receive next tick.

Link copied to clipboard
Link copied to clipboard
open override fun getFacing(): BlockFace?
Link copied to clipboard
open fun getSuppliedFluids(deltaSeconds: Double): Map<PylonFluid, Double>

Returns a map of fluid types - and their corresponding amounts - that can be supplied by the block for this fluid tick. deltaSeconds is the time since the last fluid tick.

Link copied to clipboard
open fun onFluidAdded(fluid: PylonFluid, amount: Double)

amount is always at most getRequestedFluids().get(fluid) and will never be zero or less.

Link copied to clipboard
open fun onFluidRemoved(fluid: PylonFluid, amount: Double)

amount is always at least getSuppliedFluids().get(fluid) and will never be zero or less.