Enum EmptyItemExtractable
java.lang.Object
java.lang.Enum<EmptyItemExtractable>
alexiil.mc.lib.attributes.item.impl.EmptyItemExtractable
- All Implemented Interfaces:
ItemExtractable
,NullVariant
,java.io.Serializable
,java.lang.Comparable<EmptyItemExtractable>
,java.lang.constant.Constable
public enum EmptyItemExtractable extends java.lang.Enum<EmptyItemExtractable> implements ItemExtractable, NullVariant
An
ItemExtractable
that never returns any items from
attemptExtraction(ItemFilter, int, Simulation)
.-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description NULL
AnItemExtractable
that should be treated as equal to null in all circumstances - that is any checks that depend on an object being extractable should be considered FALSE for this instance.SUPPLIER
AnItemExtractable
that informs callers that it will push items into a nearbyItemInsertable
, but doesn't expose any other item based attributes. -
Method Summary
Modifier and Type Method Description net.minecraft.item.ItemStack
attemptExtraction(ItemFilter filter, int maxCount, Simulation simulation)
ItemExtractable
getPureExtractable()
java.lang.String
toString()
static EmptyItemExtractable
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static EmptyItemExtractable[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from interface alexiil.mc.lib.attributes.item.ItemExtractable
attemptAnyExtraction, couldExtractAnything, extract, extract, extract, filtered
-
Enum Constant Details
-
NULL
AnItemExtractable
that should be treated as equal to null in all circumstances - that is any checks that depend on an object being extractable should be considered FALSE for this instance. -
SUPPLIER
AnItemExtractable
that informs callers that it will push items into a nearbyItemInsertable
, but doesn't expose any other item based attributes.The buildcraft quarry is a good example of this - it doesn't have any inventory slots itself and it pushes items out of it as it mines them from the world, but item pipes should still connect to it so that it can insert into them.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
attemptExtraction
public net.minecraft.item.ItemStack attemptExtraction(ItemFilter filter, int maxCount, Simulation simulation)Description copied from interface:ItemExtractable
- Specified by:
attemptExtraction
in interfaceItemExtractable
maxCount
- The maximum number of items that can be extracted. Negative numbers throw an exception.simulation
- IfSimulation.SIMULATE
then this should return the same result that a call withSimulation.ACTION
would do, but without modifying anything else.- Returns:
- A new, independent
ItemStack
that was extracted.
-
getPureExtractable
- Specified by:
getPureExtractable
in interfaceItemExtractable
- Returns:
- An object that only implements
ItemExtractable
, and does not expose any of the other modification methods that sibling or subclasses offer (likeItemInsertable
orGroupedItemInv
.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Enum<EmptyItemExtractable>
-