Class GroupedFluidInvViewFixedWrapper
java.lang.Object
alexiil.mc.lib.attributes.fluid.impl.GroupedFluidInvViewFixedWrapper
- All Implemented Interfaces:
GroupedFluidInvView
,OpenWrapper
- Direct Known Subclasses:
GroupedFluidInvFixedWrapper
public class GroupedFluidInvViewFixedWrapper extends java.lang.Object implements GroupedFluidInvView, OpenWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.fluid.GroupedFluidInvView
GroupedFluidInvView.FluidInvStatistic
-
Constructor Summary
Constructors Constructor Description GroupedFluidInvViewFixedWrapper(FixedFluidInvView inv)
-
Method Summary
Modifier and Type Method Description ListenerToken
addListener_F(FluidInvAmountChangeListener_F listener, ListenerRemovalToken removalToken)
Adds the given listener to this inventory, such that theFluidInvAmountChangeListener.onChange(GroupedFluidInvView, FluidKey, int, int)
will be called every time that this inventory changes.GroupedFluidInvView.FluidInvStatistic
getStatistics(FluidFilter filter)
java.util.Set<FluidKey>
getStoredFluids()
FluidAmount
getTotalCapacity_F()
java.lang.Object
getWrapped()
protected FixedFluidInvView
inv()
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.GroupedFluidInvView
addListener, getAmount, getAmount, getAmount_F, getAmount_F, getCapacity, getCapacity_F, getGroupedView, getSpace, getSpace_F, getStatistics, getTotalCapacity
-
Constructor Details
-
Method Details
-
inv
-
getWrapped
public java.lang.Object getWrapped()- Specified by:
getWrapped
in interfaceOpenWrapper
- Returns:
- The object that this wraps, or null if the wrapped object cannot be converted cleanly without exposing
additional details.
For example LBA's
Inventory
toFixedItemInvView
wrapper (FixedInventoryViewVanillaWrapper
) implements this to return theInventory
, but theSidedInventory
variant (FixedSidedInventoryVanillaWrapper
) returns null, as it is not possible to cleanly open the original inventory without exposing additional slots.
-
getStatistics
- Specified by:
getStatistics
in interfaceGroupedFluidInvView
- Parameters:
filter
- The filter to check on.- Returns:
- Statistics about the currently stored amount, capacity, and space for everything that matches the given filter.
-
getStoredFluids
- Specified by:
getStoredFluids
in interfaceGroupedFluidInvView
- Returns:
- a set containing all of the
FluidKey
's that are stored in the inventory.
-
getTotalCapacity_F
- Specified by:
getTotalCapacity_F
in interfaceGroupedFluidInvView
- Returns:
- The total capacity for every
FluidKey
that can be stored in this inventory.NOTE: This value might not be equal to the sum of
GroupedFluidInvView.getCapacity(FluidKey)
overGroupedFluidInvView.getStoredFluids()
!
-
addListener_F
public ListenerToken addListener_F(FluidInvAmountChangeListener_F listener, ListenerRemovalToken removalToken)Description copied from interface:GroupedFluidInvView
Adds the given listener to this inventory, such that theFluidInvAmountChangeListener.onChange(GroupedFluidInvView, FluidKey, int, int)
will be called every time that this inventory changes. However if this inventory doesn't support listeners then this will return a nulltoken
.- Specified by:
addListener_F
in interfaceGroupedFluidInvView
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.
-