Package alexiil.mc.lib.attributes.item
Interface ItemExtractable
- All Known Subinterfaces:
GroupedItemInv,ItemTransferable,LimitedGroupedItemInv
- All Known Implementing Classes:
CombinedGroupedItemInv,CombinedItemExtractable,DelegatingGroupedItemInv,DirectFixedItemInv,EmptyGroupedItemInv,EmptyItemExtractable,EmptyItemTransferable,FilteredItemExtractable,FilteredItemTransferable,FullFixedItemInv,GroupedItemInvFixedWrapper,ItemExtractableProjectileEntity,ItemTransferableItemEntity,SimpleFixedItemInv,SimpleFixedItemInvExtractable,SimpleGroupedItemInv,SimpleLimitedGroupedItemInv,SingleCopyingItemSlot,SingleItemSlot
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines an object that can have items extracted from it.
-
Method Summary
Modifier and TypeMethodDescriptiondefault net.minecraft.item.ItemStackattemptAnyExtraction(int maxAmount, Simulation simulation) net.minecraft.item.ItemStackattemptExtraction(ItemFilter filter, int maxAmount, Simulation simulation) default booleandefault net.minecraft.item.ItemStackextract(int maxAmount) Attempt to extract *any*ItemStackfrom this.default net.minecraft.item.ItemStackextract(ItemFilter filter, int maxAmount) default net.minecraft.item.ItemStackextract(net.minecraft.item.ItemStack filter, int maxAmount) default ItemExtractablefiltered(ItemFilter filter) default ItemExtractable
-
Method Details
-
attemptExtraction
net.minecraft.item.ItemStack attemptExtraction(ItemFilter filter, int maxAmount, Simulation simulation) - Parameters:
maxAmount- The maximum number of items that can be extracted. Negative numbers throw an exception.simulation- IfSimulation.SIMULATEthen this should return the same result that a call withSimulation.ACTIONwould do, but without modifying anything else.- Returns:
- A new, independent
ItemStackthat was extracted.
-
attemptAnyExtraction
-
extract
Attempt to extract *any*ItemStackfrom this thatmatchesthe givenItemFilter.This is equivalent to calling
attemptExtraction(ItemFilter, int, Simulation)with aSimulationparameter ofACTION.- Parameters:
maxAmount- The maximum number of items that can be extracted. Negative numbers throw an exception.- Returns:
- A new, independent
ItemStackthat was extracted.
-
extract
default net.minecraft.item.ItemStack extract(net.minecraft.item.ItemStack filter, int maxAmount) Attempt to extract *any*ItemStackfrom this that isequalto the givenItemStack.This is equivalent to calling
attemptExtraction(ItemFilter, int, Simulation)with anItemFilterparameter ofExactItemStackFilterand aSimulationparameter ofACTION.- Parameters:
maxAmount- The maximum number of items that can be extracted. Negative numbers throw an exception.- Returns:
- A new, independent
ItemStackthat was extracted.
-
extract
default net.minecraft.item.ItemStack extract(int maxAmount) Attempt to extract *any*ItemStackfrom this.This is equivalent to calling
attemptExtraction(ItemFilter, int, Simulation)with anItemFilterparameter ofConstantItemFilter.ANYTHINGand aSimulationparameter ofACTION.- Parameters:
maxAmount- The maximum number of items that can be extracted. Negative numbers throw an exception.- Returns:
- A new, independent
ItemStackthat was extracted.
-
couldExtractAnything
default boolean couldExtractAnything()- Returns:
- True if
attemptAnyExtraction(1, SIMULATE) returns a non-emptyItemStack.
-
filtered
- Returns:
- A new
ItemExtractablethat has an additional filter applied to limit the items extracted from it.
-
getPureExtractable
- Returns:
- An object that only implements
ItemExtractable, and does not expose any of the other modification methods that sibling or subclasses offer (likeItemInsertableorGroupedItemInv.
-