ACustomDataIngredient¶
Types¶
Companion¶
object Companion
Serializer¶
Properties¶
base¶
val base: Ingredient
matchingStacks¶
open override val matchingStacks: MutableList<ItemStack>
Return
the list of stacks that match this ingredient.
The following guidelines should be followed for good compatibility:
-
These stacks are generally used for display purposes, and need not be exhaustive or perfectly accurate.
-
An exception is ingredients that .requiresTesting, for which it is important that the returned stacks correspond exactly to all the accepted Items.
-
At least one stack must be returned for the ingredient not to be considered empty.
-
The ingredient should try to return at least one stack with each accepted Item. This allows mods that inspect the ingredient to figure out which stacks it might accept.
Note: no caching needs to be done by the implementation, this is already handled by the ingredient itself.
nbt¶
val nbt: CompoundTag
requiresTesting¶
open override val requiresTesting: Boolean = true
Returns whether this ingredient always requires .test.
Return
false if this ingredient ignores NBT data when matching stacks, true otherwise
See also
- FabricIngredient.requiresTesting
serializer¶
open override val serializer: IACustomIngredientSerializer<*>
Return
The serializer for this ingredient
The serializer must have been registered using IACustomIngredientSerializer.register.
vanilla¶
@get:
ApiStatus.NonExtendable
open val vanilla: Ingredient
Return
a new Ingredient behaving as defined by this custom ingredient.
Functions¶
test¶
Checks if a stack matches this ingredient. The stack must not be modified in any way.
Return
true if the stack matches this ingredient, false otherwise
Parameters
- stack: the stack to test