Rebar Fluid Tank
A common pattern is a 'fluid tank' which can only store one fluid at a time, but can store many types of fluids. RebarFluidTank implements this pattern.
You must call setCapacity for this block to work.
As with RebarFluidBufferBlock, you do not need to handle saving buffers or implement any of the RebarFluidBlock methods for this; this is all done automatically.
Properties
Functions
Returns false if any entity is unloaded or does not exist.
Checks if adding a certain amount of fluid would result in a valid fluid amount.
Checks if adding a certain amount of fluid of a certain type would result in a valid fluid amount.
Checks if a new amount of fluid is greater than zero and fits inside the tank.
Creates a fluid input point. Call in your place constructor. Should be called at most once per block.
Returns the amount of the given fluid that the machine wants to receive next tick.
Returns a list of fluid types - and their corresponding amounts - that can be supplied by the block for this fluid tick.
Returns false if the block holds no entity with the provided name, the entity is unloaded or does not physically exist.
Called as the block is being broken. At this point, the block break cannot be cancelled, but the physical block has not yet been broken or removed from io.github.pylonmc.rebar.block.BlockStorage.
amount is always at most getRequestedFluids().get(fluid) and will never be zero or less.
amount is always at least getSuppliedFluids().get(fluid) and will never be zero or less.
Called after the block has been broken. At this point, the block has been physically removed, block drops have been dropped, and the block has been removed from io.github.pylonmc.rebar.block.BlockStorage.
Called before the block is broken. Note this is not called for Deletions as those are not cancellable.
Removes from the tank only if the new amount of fluid is greater than zero and fits in the tank.
Sets the capacity of the fluid tank
Sets the type of fluid in the fluid tank