public interface IIngredient
There is no guarantee that every mod will respect the conditions or transformations, or that every mod will support every kind of ingredient.
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() |
IIngredient |
transform(IItemTransformer transformer) |
IIngredient |
transformNew(IItemTransformerNew transformer)
Returns a new ingredient with the given transform added to it.
|
java.lang.String getMark()
int getAmount()
Should return -1 if no amount is available and 1 for a single item. Stacks return the stack size.
java.util.List<IItemStack> getItems()
If there is no item list (for example, it is the <*> wildcard item) null should be returned.
IItemStack[] getItemArray()
If there is no item list (for example, it is the <*> wildcard item) an empty Array should be returned
java.util.List<ILiquidStack> getLiquids()
If there is no liquid list (for example, it is the <*&ft; wildcard item) null should be returned.
IIngredient amount(int amount)
amount
- new stack sizeIIngredient or(IIngredient ingredient)
ingredient
- ingredient to combine withIIngredient transformNew(IItemTransformerNew transformer)
transformer
- transformer to addIIngredient only(IItemCondition condition)
condition
- condition to addIIngredient marked(java.lang.String mark)
mark
- mark to applyboolean matches(IItemStack item)
item
- item to checkboolean matchesExact(IItemStack item)
item
- item to checkboolean matches(ILiquidStack liquid)
liquid
- liquid to checkboolean contains(IIngredient ingredient)
ingredient
- ingredient to checkIItemStack applyTransform(IItemStack item, IPlayer byPlayer)
item
- item to transformNewbyPlayer
- player performing the crafting operationIItemStack applyNewTransform(IItemStack item)
boolean hasNewTransformers()
boolean hasTransformers()
IIngredient transform(IItemTransformer transformer)
java.lang.Object getInternal()
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.
java.lang.String toCommandString()