public class IngredientAny extends java.lang.Object implements IIngredient
Modifier and Type | Field and Description |
---|---|
static IngredientAny |
INSTANCE |
static java.lang.Object |
INTERNAL_ANY |
Modifier and Type | Method and Description |
---|---|
IIngredient |
amount(int amount)
Returns a new ingredient with the given stack size.
|
IItemStack |
applyNewTransform(IItemStack item) |
IItemStack |
applyTransform(IItemStack item,
IPlayer byPlayer)
Applies transformations after crafting, if any, to the given item.
|
boolean |
contains(IIngredient ingredient)
Check if this ingredient contains all possible values for the given
ingredient.
|
int |
getAmount()
Gets the amount.
|
java.lang.Object |
getInternal()
Gets the internal item backing this ingredient.
|
IItemStack[] |
getItemArray()
Gets all possible items for this ingredient as Array.
|
java.util.List<IItemStack> |
getItems()
Gets all possible items for this ingredient.
|
java.util.List<ILiquidStack> |
getLiquids()
Gets all possible liquids for this ingredient.
|
java.lang.String |
getMark()
Gets the mark of the ingredient.
|
boolean |
hasNewTransformers()
Checks if this ingredient has (or could have) any transformatiosns.
|
boolean |
hasTransformers() |
IIngredient |
marked(java.lang.String mark)
Returns a new ingredient marked with the given name.
|
boolean |
matches(IItemStack item)
Checks if this ingredient matches the given item.
|
boolean |
matches(ILiquidStack liquid)
Checks if this ingredient matches the given liquid.
|
boolean |
matchesExact(IItemStack item)
Checks if this ingredient matches the given item.
|
IIngredient |
only(IItemCondition condition)
Returns a new ingredient with the given condition added to it.
|
IIngredient |
or(IIngredient ingredient)
Combines multiple ingredients into a single one.
|
java.lang.String |
toCommandString() |
java.lang.String |
toString() |
IIngredient |
transform(IItemTransformer transformer) |
IIngredient |
transformNew(IItemTransformerNew transformer)
Returns a new ingredient with the given transform added to it.
|
public static final IngredientAny INSTANCE
public static java.lang.Object INTERNAL_ANY
public java.lang.String getMark()
IIngredient
getMark
in interface IIngredient
public int getAmount()
IIngredient
Should return -1 if no amount is available and 1 for a single item. Stacks return the stack size.
getAmount
in interface IIngredient
public java.util.List<IItemStack> getItems()
IIngredient
If there is no item list (for example, it is the <*> wildcard item) null should be returned.
getItems
in interface IIngredient
public IItemStack[] getItemArray()
IIngredient
If there is no item list (for example, it is the <*> wildcard item) an empty Array should be returned
getItemArray
in interface IIngredient
public java.util.List<ILiquidStack> getLiquids()
IIngredient
If there is no liquid list (for example, it is the <*&ft; wildcard item) null should be returned.
getLiquids
in interface IIngredient
public IIngredient amount(int amount)
IIngredient
amount
in interface IIngredient
amount
- new stack sizepublic IIngredient transformNew(IItemTransformerNew transformer)
IIngredient
transformNew
in interface IIngredient
transformer
- transformer to addpublic IIngredient only(IItemCondition condition)
IIngredient
only
in interface IIngredient
condition
- condition to addpublic IIngredient marked(java.lang.String mark)
IIngredient
marked
in interface IIngredient
mark
- mark to applypublic IIngredient or(IIngredient ingredient)
IIngredient
or
in interface IIngredient
ingredient
- ingredient to combine withpublic boolean matches(IItemStack item)
IIngredient
matches
in interface IIngredient
item
- item to checkpublic boolean matchesExact(IItemStack item)
IIngredient
matchesExact
in interface IIngredient
item
- item to checkpublic boolean matches(ILiquidStack liquid)
IIngredient
matches
in interface IIngredient
liquid
- liquid to checkpublic boolean contains(IIngredient ingredient)
IIngredient
contains
in interface IIngredient
ingredient
- ingredient to checkpublic IItemStack applyTransform(IItemStack item, IPlayer byPlayer)
IIngredient
applyTransform
in interface IIngredient
item
- item to transformNewbyPlayer
- player performing the crafting operationpublic IItemStack applyNewTransform(IItemStack item)
applyNewTransform
in interface IIngredient
public boolean hasNewTransformers()
IIngredient
hasNewTransformers
in interface IIngredient
public boolean hasTransformers()
hasTransformers
in interface IIngredient
public IIngredient transform(IItemTransformer transformer)
transform
in interface IIngredient
public java.lang.Object getInternal()
IIngredient
The value is implementation-dependent and should only be handled by the internal code. Don't use this value - instead, use the version-specific helper methods.
getInternal
in interface IIngredient
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toCommandString()
toCommandString
in interface IIngredient