Class IngredientComponentTerminalStorageHandlerFluidStack
java.lang.Object
org.cyclops.integratedterminals.capability.ingredient.IngredientComponentTerminalStorageHandlerFluidStack
- All Implemented Interfaces:
IIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer>
public class IngredientComponentTerminalStorageHandlerFluidStack
extends Object
implements IIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer>
Terminal storage handler for fluids.
-
Constructor Summary
ConstructorsConstructorDescriptionIngredientComponentTerminalStorageHandlerFluidStack(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<net.minecraftforge.fluids.FluidStack, Integer> ingredientComponent) -
Method Summary
Modifier and TypeMethodDescriptionvoiddrainActivePlayerStackQuantity(net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.inventory.AbstractContainerMenu container, long quantityIn) Drain the given quantity from the active player stack.voiddrawInstance(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraftforge.fluids.FluidStack instance, long maxQuantity, String label, net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, ContainerScreenTerminalStorage.DrawLayer layer, float partialTick, int x, int y, int mouseX, int mouseY, List<net.minecraft.network.chat.Component> additionalTooltipLines) Draw the given instance in the given gui.voidextractActiveStackFromPlayerInventory(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraft.world.inventory.AbstractContainerMenu container, net.minecraft.world.entity.player.Inventory playerInventory, long moveQuantityPlayerSlot) Move the ingredient in the active player stack to the storage.voidextractMaxFromContainerSlot(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraft.world.inventory.AbstractContainerMenu container, int containerSlot, net.minecraft.world.entity.player.Inventory playerInventory, int limit) Move as much as possible from the given container slot into the storage.formatQuantity(net.minecraftforge.fluids.FluidStack instance) Get a display string for the quantity of the given instance.longgetActivePlayerStackQuantity(net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.inventory.AbstractContainerMenu container) Get the quantity in the active player stack.org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<net.minecraftforge.fluids.FluidStack,Integer> protected org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack,Integer> getFluidStorage(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<net.minecraftforge.fluids.FluidStack, Integer> component, net.minecraftforge.fluids.capability.IFluidHandlerItem fluidHandler) net.minecraft.world.item.ItemStackgetIcon()intintnet.minecraftforge.fluids.FluidStackgetInstance(net.minecraft.world.item.ItemStack itemStack) Get the ingredient instance from the given item.Predicate<net.minecraftforge.fluids.FluidStack>getInstanceFilterPredicate(SearchMode searchMode, String query) Get a predicate for matching instances that apply to the given query string.Collection<IIngredientInstanceSorter<net.minecraftforge.fluids.FluidStack>>longgetMaxQuantity(net.minecraft.world.item.ItemStack itemStack) Get the max instance quantity in the given item.net.minecraftforge.fluids.FluidStackinsertIntoContainer(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraft.world.inventory.AbstractContainerMenu container, int containerSlot, net.minecraftforge.fluids.FluidStack maxInstance, net.minecraft.world.entity.player.Player player, boolean transferFullSelection) Insert the given instance into the container.booleanisInstance(net.minecraft.world.item.ItemStack itemStack) Get the ingredient instance from the given item.intthrowIntoWorld(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraftforge.fluids.FluidStack maxInstance, net.minecraft.world.entity.player.Player player) Throw the given instance into the world.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integratedterminals.api.ingredient.IIngredientComponentTerminalStorageHandler
addQuantityTooltip, insertMaxIntoContainer
-
Constructor Details
-
IngredientComponentTerminalStorageHandlerFluidStack
public IngredientComponentTerminalStorageHandlerFluidStack(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<net.minecraftforge.fluids.FluidStack, Integer> ingredientComponent)
-
-
Method Details
-
getComponent
public org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<net.minecraftforge.fluids.FluidStack,Integer> getComponent()- Specified by:
getComponentin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Returns:
- The ingredient component.
-
getIcon
public net.minecraft.world.item.ItemStack getIcon()- Specified by:
getIconin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Returns:
- The item that can be used to visually represent this ingredient component type.
-
drawInstance
public void drawInstance(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraftforge.fluids.FluidStack instance, long maxQuantity, @Nullable String label, net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, ContainerScreenTerminalStorage.DrawLayer layer, float partialTick, int x, int y, int mouseX, int mouseY, @Nullable List<net.minecraft.network.chat.Component> additionalTooltipLines) Description copied from interface:IIngredientComponentTerminalStorageHandlerDraw the given instance in the given gui.- Specified by:
drawInstancein interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
matrixStack- The matrix stack.instance- An instance.maxQuantity- The maximum allowed quantity of the given instance.label- An optional label that should be rendered instead of the quantity.gui- A gui to render in.layer- The layer to render in.partialTick- The partial tick.x- The slot X position.y- The slot Y position.mouseX- The mouse X position.mouseY- The mouse Y position.additionalTooltipLines- The additional tooltip lines to add.
-
formatQuantity
Description copied from interface:IIngredientComponentTerminalStorageHandlerGet a display string for the quantity of the given instance.- Specified by:
formatQuantityin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.- Returns:
- The formatted quantity.
-
isInstance
public boolean isInstance(net.minecraft.world.item.ItemStack itemStack) Description copied from interface:IIngredientComponentTerminalStorageHandlerGet the ingredient instance from the given item.- Specified by:
isInstancein interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
itemStack- An item.- Returns:
- If the stack represents an ingredient.
-
getInstance
public net.minecraftforge.fluids.FluidStack getInstance(net.minecraft.world.item.ItemStack itemStack) Description copied from interface:IIngredientComponentTerminalStorageHandlerGet the ingredient instance from the given item.- Specified by:
getInstancein interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
itemStack- An item.- Returns:
- An ingredient.
-
getMaxQuantity
public long getMaxQuantity(net.minecraft.world.item.ItemStack itemStack) Description copied from interface:IIngredientComponentTerminalStorageHandlerGet the max instance quantity in the given item.- Specified by:
getMaxQuantityin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
itemStack- An item.- Returns:
- The max quantity.
-
getInitialInstanceMovementQuantity
public int getInitialInstanceMovementQuantity()- Specified by:
getInitialInstanceMovementQuantityin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Returns:
- The number that should be selected when clicking on an instance in the storage terminal.
-
getIncrementalInstanceMovementQuantity
public int getIncrementalInstanceMovementQuantity()- Specified by:
getIncrementalInstanceMovementQuantityin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Returns:
- The number that should be removed when right-clicking when an instance is selected in the storage terminal.
-
throwIntoWorld
public int throwIntoWorld(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraftforge.fluids.FluidStack maxInstance, net.minecraft.world.entity.player.Player player) Description copied from interface:IIngredientComponentTerminalStorageHandlerThrow the given instance into the world.- Specified by:
throwIntoWorldin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
storage- The storage to extract from.maxInstance- The instance to throw.player- The throwing player.- Returns:
- The instance quantity that was thrown.
-
insertIntoContainer
public net.minecraftforge.fluids.FluidStack insertIntoContainer(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraft.world.inventory.AbstractContainerMenu container, int containerSlot, net.minecraftforge.fluids.FluidStack maxInstance, @Nullable net.minecraft.world.entity.player.Player player, boolean transferFullSelection) Description copied from interface:IIngredientComponentTerminalStorageHandlerInsert the given instance into the container.- Specified by:
insertIntoContainerin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
storage- The storage to extract from.container- The container to insert to.containerSlot- The container slot to insert to.maxInstance- The instance to move.player- The player. If null, the container slot will not be picked up by the player if not empty.transferFullSelection- If the selected stack should be moved fully.- Returns:
- The instance quantity that was moved.
-
getFluidStorage
protected org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack,Integer> getFluidStorage(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<net.minecraftforge.fluids.FluidStack, Integer> component, net.minecraftforge.fluids.capability.IFluidHandlerItem fluidHandler) -
extractActiveStackFromPlayerInventory
public void extractActiveStackFromPlayerInventory(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraft.world.inventory.AbstractContainerMenu container, net.minecraft.world.entity.player.Inventory playerInventory, long moveQuantityPlayerSlot) Description copied from interface:IIngredientComponentTerminalStorageHandlerMove the ingredient in the active player stack to the storage.- Specified by:
extractActiveStackFromPlayerInventoryin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
storage- The storage to insert to.playerInventory- The player inventory to extract from.moveQuantityPlayerSlot- The player stack quantity that should be extracted.
-
extractMaxFromContainerSlot
public void extractMaxFromContainerSlot(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<net.minecraftforge.fluids.FluidStack, Integer> storage, net.minecraft.world.inventory.AbstractContainerMenu container, int containerSlot, net.minecraft.world.entity.player.Inventory playerInventory, int limit) Description copied from interface:IIngredientComponentTerminalStorageHandlerMove as much as possible from the given container slot into the storage.- Specified by:
extractMaxFromContainerSlotin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
storage- The storage to insert to.container- The container to insert to.containerSlot- The container slot to insert to.playerInventory- The active player inventory.limit- The max limit. -1 is no limit.
-
getActivePlayerStackQuantity
public long getActivePlayerStackQuantity(net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.inventory.AbstractContainerMenu container) Description copied from interface:IIngredientComponentTerminalStorageHandlerGet the quantity in the active player stack.- Specified by:
getActivePlayerStackQuantityin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
playerInventory- The player inventory.- Returns:
- The quantity.
-
drainActivePlayerStackQuantity
public void drainActivePlayerStackQuantity(net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.inventory.AbstractContainerMenu container, long quantityIn) Description copied from interface:IIngredientComponentTerminalStorageHandlerDrain the given quantity from the active player stack. This will typically only be called client-side, and later confirmed by the server.- Specified by:
drainActivePlayerStackQuantityin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
playerInventory- The player inventory.quantityIn- The quantity to drain.
-
getInstanceFilterPredicate
public Predicate<net.minecraftforge.fluids.FluidStack> getInstanceFilterPredicate(SearchMode searchMode, String query) Description copied from interface:IIngredientComponentTerminalStorageHandlerGet a predicate for matching instances that apply to the given query string.- Specified by:
getInstanceFilterPredicatein interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Parameters:
searchMode- The mode to search underquery- A query string.- Returns:
- An instance matcher.
-
getInstanceSorters
public Collection<IIngredientInstanceSorter<net.minecraftforge.fluids.FluidStack>> getInstanceSorters()- Specified by:
getInstanceSortersin interfaceIIngredientComponentTerminalStorageHandler<net.minecraftforge.fluids.FluidStack,Integer> - Returns:
- The available sorters.
-