public class IngredientStack extends java.lang.Object implements IIngredient
| Constructor and Description |
|---|
IngredientStack(IIngredient ingredient,
int amount) |
| 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 IngredientStack(IIngredient ingredient, int amount)
public java.lang.String getMark()
IIngredientgetMark in interface IIngredientpublic int getAmount()
IIngredientShould return -1 if no amount is available and 1 for a single item. Stacks return the stack size.
getAmount in interface IIngredientpublic java.util.List<IItemStack> getItems()
IIngredientIf there is no item list (for example, it is the <*> wildcard item) null should be returned.
getItems in interface IIngredientpublic IItemStack[] getItemArray()
IIngredientIf there is no item list (for example, it is the <*> wildcard item) an empty Array should be returned
getItemArray in interface IIngredientpublic java.util.List<ILiquidStack> getLiquids()
IIngredientIf there is no liquid list (for example, it is the <*&ft; wildcard item) null should be returned.
getLiquids in interface IIngredientpublic IIngredient amount(int amount)
IIngredientamount in interface IIngredientamount - new stack sizepublic IIngredient transformNew(IItemTransformerNew transformer)
IIngredienttransformNew in interface IIngredienttransformer - transformer to addpublic IIngredient only(IItemCondition condition)
IIngredientonly in interface IIngredientcondition - condition to addpublic IIngredient marked(java.lang.String mark)
IIngredientmarked in interface IIngredientmark - mark to applypublic IIngredient or(IIngredient ingredient)
IIngredientor in interface IIngredientingredient - ingredient to combine withpublic boolean matches(IItemStack item)
IIngredientmatches in interface IIngredientitem - item to checkpublic boolean matchesExact(IItemStack item)
IIngredientmatchesExact in interface IIngredientitem - item to checkpublic boolean matches(ILiquidStack liquid)
IIngredientmatches in interface IIngredientliquid - liquid to checkpublic boolean contains(IIngredient ingredient)
IIngredientcontains in interface IIngredientingredient - ingredient to checkpublic IItemStack applyTransform(IItemStack item, IPlayer byPlayer)
IIngredientapplyTransform in interface IIngredientitem - item to transformNewbyPlayer - player performing the crafting operationpublic IItemStack applyNewTransform(IItemStack item)
applyNewTransform in interface IIngredientpublic java.lang.Object getInternal()
IIngredientThe 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 IIngredientpublic java.lang.String toCommandString()
toCommandString in interface IIngredientpublic boolean hasNewTransformers()
IIngredienthasNewTransformers in interface IIngredientpublic boolean hasTransformers()
hasTransformers in interface IIngredientpublic IIngredient transform(IItemTransformer transformer)
transform in interface IIngredientpublic java.lang.String toString()
toString in class java.lang.Object