Class MappedFixedFluidInvView
java.lang.Object
alexiil.mc.lib.attributes.fluid.impl.AbstractPartialFixedFluidInvView
alexiil.mc.lib.attributes.fluid.impl.MappedFixedFluidInvView
- All Implemented Interfaces:
Convertible
,FixedFluidInvView
- Direct Known Subclasses:
MappedFixedFluidInv
-
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, getFixedView, getGroupedInv, getMappedInv, getSubInv, getTank, offerSelfAsAttribute, tankIterable
-
Constructor Details
-
MappedFixedFluidInvView
-
-
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.
-
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.
-