Class Ingredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
- All Implemented Interfaces:
Predicate<ItemStack>
,StackedContents.IngredientInfo<Holder<Item>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Ingredient> static final StreamCodec
<RegistryFriendlyByteBuf, Ingredient> private ICustomIngredient
static final StreamCodec
<RegistryFriendlyByteBuf, Optional<Ingredient>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Ingredient
(HolderSet<Item> p_365027_) Ingredient
(ICustomIngredient customIngredient) -
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptsItem
(Holder<Item> p_389400_) display()
static SlotDisplay
displayForSingleItem
(Holder<Item> p_380940_) boolean
Retrieves the underlying values of this ingredient.Retrieves the holder set to use for syncing simple ingredientsint
hashCode()
boolean
isCustom()
boolean
isEmpty()
boolean
isSimple()
items()
Deprecated.static Ingredient
static Ingredient
static Ingredient
static Ingredient
static SlotDisplay
optionalIngredientToDisplay
(Optional<Ingredient> p_381167_) boolean
static boolean
testOptionalIngredient
(Optional<Ingredient> p_362504_, ItemStack p_363604_)
-
Field Details
-
CONTENTS_STREAM_CODEC
-
OPTIONAL_CONTENTS_STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf,Optional<Ingredient>> OPTIONAL_CONTENTS_STREAM_CODEC -
NON_AIR_HOLDER_SET_CODEC
-
CODEC
-
values
-
customIngredient
-
customIngredientValues
-
-
Constructor Details
-
Ingredient
-
Ingredient
-
-
Method Details
-
testOptionalIngredient
-
items
Deprecated. -
isEmpty
public boolean isEmpty() -
test
-
acceptsItem
- Specified by:
acceptsItem
in interfaceStackedContents.IngredientInfo<Holder<Item>>
-
equals
-
hashCode
public int hashCode() -
getValues
Retrieves the underlying values of this ingredient. If this is a custom ingredient, an exception is thrown. -
getValuesForSync
Retrieves the holder set to use for syncing simple ingredients -
isSimple
public boolean isSimple() -
getCustomIngredient
-
isCustom
public boolean isCustom() -
updateCustomIngredientValues
-
of
-
of
-
of
-
of
-
display
-
optionalIngredientToDisplay
-
displayForSingleItem
-