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
A sub-view of an existing
FixedFluidInvView
.-
Field Summary
Fields inherited from class alexiil.mc.lib.attributes.fluid.impl.AbstractPartialFixedFluidInvView
inv
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddListener(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.protected int
getInternalTank(int tank)
int
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
-
SubFixedFluidInvView
-
-
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.
-