StateIngredient
Link to stateingredient
Wrapper around blocks, blockstates or block tags used to match recipe inputs like blocks to convert with the Pure Daisy, or catalysts for mana infusion.
To create, simply cast an MCBlock, MCBlockState, an array of MCBlocks, or an MCTag<MCBlock> to StateIngredient. This is done automatically when using them as a parameter for a method.
This class was added by a mod with mod-id botania
. Perciò, è necessario avere questa mod installata per poter utilizzare questa funzione.
Importare la Classe
Link to importare-la-classe
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport mods.botania.StateIngredient;
Interfacce Implementate
Link to interfacce-implementate
StateIngredient implements the following interfaces. That means all methods defined in these interfaces are also available in StateIngredient
- Predicate<MCBlockState>
Caster
Link to caster
Tipo Risultato | Implicito |
---|---|
Tipo Risultato string | Implicito no |
Metodi
Link to metodi
Name: matches
Tests if the provided block state matches the recipe.
Return Type: boolean
ZenScript Copy// StateIngredient.matches(state as MCBlockState) as boolean
ingredient.matches(<blockstate:minecraft:dirt>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro state | Tipo MCBlockState | Descrizione Block state to test against this ingredient |
Name: pick
Returns a random state matching the ingredient.
Return Type: MCBlockState
ZenScript Copy// StateIngredient.pick(random as Random) as MCBlockState
ingredient.pick(world.random);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro random | Tipo Random | Descrizione a Random instance, usually obtained from a world |