Class Ingredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
- Direct Known Subclasses:
CompoundIngredient
,DifferenceIngredient
,IntersectionIngredient
,NBTIngredient
,TestEnabledIngredient
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final record
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Ingredient>
static final com.mojang.serialization.Codec<Ingredient>
static final Ingredient
private ItemStack[]
static final com.mojang.serialization.Codec<List<Ingredient>>
static final com.mojang.serialization.Codec<List<Ingredient>>
private it.unimi.dsi.fastutil.ints.IntList
private final Supplier<? extends IngredientType<?>>
final Ingredient.Value[]
static final com.mojang.serialization.Codec<Ingredient>
static final com.mojang.serialization.Codec<Ingredient>
-
Constructor Summary
ModifierConstructorDescriptionprotected
Ingredient
(Stream<? extends Ingredient.Value> p_43907_) protected
Ingredient
(Stream<? extends Ingredient.Value> p_43907_, Supplier<? extends IngredientType<?>> type) private
Ingredient
(Ingredient.Value[] p_301044_) private
Ingredient
(Ingredient.Value[] p_301044_, Supplier<? extends IngredientType<?>> type) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
areStacksEqual
(ItemStack left, ItemStack right) private static com.mojang.serialization.Codec<Ingredient>
codec
(boolean p_301074_) boolean
static Ingredient
fromJson
(com.google.gson.JsonElement element, boolean nonEmpty) static Ingredient
fromNetwork
(FriendlyByteBuf p_43941_) static Ingredient
fromValues
(Stream<? extends Ingredient.Value> p_43939_) getItems()
it.unimi.dsi.fastutil.ints.IntList
getType()
final Ingredient.Value[]
boolean
isEmpty()
boolean
isSimple()
static Ingredient
of()
static Ingredient
static Ingredient
static Ingredient
static Ingredient
boolean
Returns iftrue
, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
.boolean
final void
toNetwork
(FriendlyByteBuf p_43924_)
-
Field Details
-
EMPTY
-
values
-
itemStacks
-
stackingIds
@Nullable private it.unimi.dsi.fastutil.ints.IntList stackingIds -
type
-
VANILLA_CODEC
-
VANILLA_CODEC_NONEMPTY
-
CODEC
-
CODEC_NONEMPTY
-
LIST_CODEC
-
LIST_CODEC_NONEMPTY
-
-
Constructor Details
-
Ingredient
-
Ingredient
-
Ingredient
protected Ingredient(Stream<? extends Ingredient.Value> p_43907_, Supplier<? extends IngredientType<?>> type) -
Ingredient
-
-
Method Details
-
getType
-
getItems
-
test
-
areStacksEqual
-
getStackingIds
public it.unimi.dsi.fastutil.ints.IntList getStackingIds() -
toNetwork
-
synchronizeWithContents
public boolean synchronizeWithContents()Returns iftrue
, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
.- Returns:
- if
true
, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
-
isEmpty
public boolean isEmpty() -
equals
-
isSimple
public boolean isSimple() -
fromValues
-
of
-
of
-
of
-
of
-
of
-
fromJson
-
fromNetwork
-
codec
-
getValues
-