T - The instance type.M - The matching condition parameter.public interface IIngredientComponentTerminalStorageHandler<T,M>
| Modifier and Type | Method and Description |
|---|---|
default void |
addQuantityTooltip(java.util.List<net.minecraft.util.text.ITextComponent> lines,
T instance)
Show the quantity of the given instance on the second tooltip line.
|
void |
drainActivePlayerStackQuantity(net.minecraft.entity.player.PlayerInventory playerInventory,
long quantity)
Drain the given quantity from the active player stack.
|
void |
drawInstance(T instance,
long maxQuantity,
java.lang.String label,
net.minecraft.client.gui.screen.inventory.ContainerScreen gui,
ContainerScreenTerminalStorage.DrawLayer layer,
float partialTick,
int x,
int y,
int mouseX,
int mouseY,
java.util.List<net.minecraft.util.text.ITextComponent> additionalTooltipLines)
Draw the given instance in the given gui.
|
void |
extractActiveStackFromPlayerInventory(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage,
net.minecraft.entity.player.PlayerInventory playerInventory,
long moveQuantityPlayerSlot)
Move the ingredient in the active player stack to the storage.
|
void |
extractMaxFromContainerSlot(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage,
net.minecraft.inventory.container.Container container,
int containerSlot,
net.minecraft.entity.player.PlayerInventory playerInventory)
Move as much as possible from the given container slot into the storage.
|
java.lang.String |
formatQuantity(T instance)
Get a display string for the quantity of the given instance.
|
long |
getActivePlayerStackQuantity(net.minecraft.entity.player.PlayerInventory playerInventory)
Get the quantity in the active player stack.
|
org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> |
getComponent() |
net.minecraft.item.ItemStack |
getIcon() |
int |
getIncrementalInstanceMovementQuantity() |
int |
getInitialInstanceMovementQuantity() |
T |
getInstance(net.minecraft.item.ItemStack itemStack)
Get the ingredient instance from the given item.
|
java.util.function.Predicate<T> |
getInstanceFilterPredicate(SearchMode searchMode,
java.lang.String query)
Get a predicate for matching instances that apply to the given query string.
|
java.util.Collection<IIngredientInstanceSorter<T>> |
getInstanceSorters() |
long |
getMaxQuantity(net.minecraft.item.ItemStack itemStack)
Get the max instance quantity in the given item.
|
T |
insertIntoContainer(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage,
net.minecraft.inventory.container.Container container,
int containerSlot,
T maxInstance,
net.minecraft.entity.player.PlayerEntity player,
boolean transferFullSelection)
Insert the given instance into the container.
|
default void |
insertMaxIntoContainer(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage,
net.minecraft.inventory.container.Container container,
int containerSlotStart,
int containerSlotEnd,
T instance)
Insert as much as possible from the given instance prototype into the container.
|
boolean |
isInstance(net.minecraft.item.ItemStack itemStack)
Get the ingredient instance from the given item.
|
int |
throwIntoWorld(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage,
T maxInstance,
net.minecraft.entity.player.PlayerEntity player)
Throw the given instance into the world.
|
org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> getComponent()
net.minecraft.item.ItemStack getIcon()
void drawInstance(T instance, long maxQuantity, @Nullable java.lang.String label, net.minecraft.client.gui.screen.inventory.ContainerScreen gui, ContainerScreenTerminalStorage.DrawLayer layer, float partialTick, int x, int y, int mouseX, int mouseY, @Nullable java.util.List<net.minecraft.util.text.ITextComponent> additionalTooltipLines)
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.default void addQuantityTooltip(java.util.List<net.minecraft.util.text.ITextComponent> lines,
T instance)
lines - Tooltip linesinstance - An instance.java.lang.String formatQuantity(T instance)
instance - An instance.boolean isInstance(net.minecraft.item.ItemStack itemStack)
itemStack - An item.T getInstance(net.minecraft.item.ItemStack itemStack)
itemStack - An item.long getMaxQuantity(net.minecraft.item.ItemStack itemStack)
itemStack - An item.int getInitialInstanceMovementQuantity()
int getIncrementalInstanceMovementQuantity()
int throwIntoWorld(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage, T maxInstance, net.minecraft.entity.player.PlayerEntity player)
storage - The storage to extract from.maxInstance - The instance to throw.player - The throwing player.default void insertMaxIntoContainer(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage, net.minecraft.inventory.container.Container container, int containerSlotStart, int containerSlotEnd, T instance)
storage - The storage to insert to.container - The container to extract from.containerSlotStart - The container slot to start from.containerSlotEnd - The container slot to end at (exclusive).instance - The instance to move.T insertIntoContainer(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage, net.minecraft.inventory.container.Container container, int containerSlot, T maxInstance, @Nullable net.minecraft.entity.player.PlayerEntity player, boolean transferFullSelection)
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.void extractActiveStackFromPlayerInventory(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage, net.minecraft.entity.player.PlayerInventory playerInventory, long moveQuantityPlayerSlot)
storage - The storage to insert to.playerInventory - The player inventory to extract from.moveQuantityPlayerSlot - The player stack quantity that should be extracted.void extractMaxFromContainerSlot(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M> storage, net.minecraft.inventory.container.Container container, int containerSlot, net.minecraft.entity.player.PlayerInventory playerInventory)
storage - The storage to insert to.container - The container to insert to.containerSlot - The container slot to insert to.playerInventory - The active player inventory.long getActivePlayerStackQuantity(net.minecraft.entity.player.PlayerInventory playerInventory)
playerInventory - The player inventory.void drainActivePlayerStackQuantity(net.minecraft.entity.player.PlayerInventory playerInventory,
long quantity)
playerInventory - The player inventory.quantity - The quantity to drain.java.util.function.Predicate<T> getInstanceFilterPredicate(SearchMode searchMode, java.lang.String query)
searchMode - The mode to search underquery - A query string.java.util.Collection<IIngredientInstanceSorter<T>> getInstanceSorters()