Class SubFixedFluidInvView
java.lang.Object
alexiil.mc.lib.attributes.fluid.impl.AbstractPartialFixedFluidInvView
alexiil.mc.lib.attributes.fluid.impl.SubFixedFluidInvView
- All Implemented Interfaces:
Convertible
,FixedFluidInvView
- Direct Known Subclasses:
SubFixedFluidInv
public class SubFixedFluidInvView extends AbstractPartialFixedFluidInvView
A sub-view of an existing
FixedFluidInvView
.-
Field Summary
Fields inherited from class alexiil.mc.lib.attributes.fluid.impl.AbstractPartialFixedFluidInvView
inv
-
Constructor Summary
Constructors Constructor Description SubFixedFluidInvView(FixedFluidInvView inv, int fromIndex, int toIndex)
-
Method Summary
Modifier and Type Method Description ListenerToken
addListener(FluidInvTankChangeListener listener, ListenerRemovalToken removalToken)
Adds the given listener to this inventory, such that theFluidInvTankChangeListener.onChange(FixedFluidInvView, int, FluidVolume, FluidVolume)
will be called every time that this inventory changes.FixedFluidInvView
getFixedView()
protected int
getInternalTank(int tank)
int
getTankCount()
Methods inherited from class alexiil.mc.lib.attributes.fluid.impl.AbstractPartialFixedFluidInvView
getFilterForTank, getInvFluid, getMaxAmount, getMaxAmount_F, isFluidValidForTank
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface alexiil.mc.lib.attributes.fluid.FixedFluidInvView
convertTo, fluidIterable, getGroupedInv, getMappedInv, getSubInv, getTank, offerSelfAsAttribute, tankIterable
-
Constructor Details
-
Method Details
-
getInternalTank
protected int getInternalTank(int tank)- Specified by:
getInternalTank
in classAbstractPartialFixedFluidInvView
- Returns:
- The tank that the internal
AbstractPartialFixedFluidInvView.inv
should use.
-
getTankCount
public int getTankCount()- Returns:
- The number of tanks in this inventory.
-
getFixedView
- Returns:
- An object that only implements
FixedFluidInvView
, and does not expose the modification methods thatFixedFluidInv
does. Implementations that don't expose any modification methods themselves should override this method to just return themselves.
-
addListener
public ListenerToken addListener(FluidInvTankChangeListener listener, ListenerRemovalToken removalToken)Description copied from interface:FixedFluidInvView
Adds the given listener to this inventory, such that theFluidInvTankChangeListener.onChange(FixedFluidInvView, int, FluidVolume, FluidVolume)
will be called every time that this inventory changes. However if this inventory doesn't support listeners then this will return a nulltoken
.removalToken
- A token that will be called whenever the given listener is removed from this inventory (or if this inventory itself is unloaded or otherwise invalidated).- Returns:
- A token that represents the listener, or null if the listener could not be added.
-