Rebar Fluid Buffer Block
Allows for creating 'fluid buffers' in a block, which have a capacity and can be filled and emptied by fluid connections.
In more detail: Usually, fluid machines store fluids in internal 'buffers.' For example, the press has an internal buffer used to store plant oil, of size 1000mB by default. This is a common enough thing that we created a new interface to handle it: RebarFluidBufferBlock. This interface allows your block to easily manage fluid buffers.
You will need to call createFluidBuffer when your block is placed and specify the buffer's fluid type, capacity, whether it can take in fluids from input points, and whether it can supply fluids to output points.
You do not need to handle saving buffers or implement any of the RebarFluidBlock methods for this; this is all done automatically.
Functions
Adds to a fluid buffer only if the new amount of fluid is greater than or equal to zero and fits in the buffer.
Returns false if any entity is unloaded or does not exist.
Checks if a new amount of fluid is greater than zero and fits inside the corresponding buffer.
Creates a fluid buffer with the specified fluid type and capacity
Creates a fluid input point. Call in your place constructor. Should be called at most once per block.
Deletes a fluid buffer
Returns the amount of fluid stored in a buffer
Returns the amount of the given fluid that the machine wants to receive next tick.
Returns the capacity of a buffer
Returns the amount of space remaining in a fluid buffer
Returns a map of fluid types - and their corresponding amounts - that can be supplied by the block for this fluid tick.
Returns whether a buffer exists for this fluid
Returns false if the block holds no entity with the provided name, the entity is unloaded or does not physically exist.
In the case of a vanilla BlockBreakEvent this is called during the monitor priority
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.
In the case of a vanilla BlockBreakEvent this is called during the monitor priority
Called before the block is broken. Note this is not called for Deletions as those are not cancellable.
Removes from a fluid buffer only if the new amount of fluid is greater than zero and fits in the buffer.
Sets a fluid buffer only if the new amount of fluid is greater than or equal to zero and fits in the buffer.
Sets the new capacity of a buffer. Any existing fluid will not be removed, so you may end up with a buffer containing more fluid than it technically has capacity for.