Class ItemPredicate
- java.lang.Object
-
- net.minecraft.advancements.criterion.ItemPredicate
-
public class ItemPredicate extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ItemPredicate.Builder
-
Field Summary
Fields Modifier and Type Field Description static ItemPredicate
ANY
private MinMaxBounds.IntBound
count
private static java.util.Map<ResourceLocation,java.util.function.Function<com.google.gson.JsonObject,ItemPredicate>>
custom_predicates
private MinMaxBounds.IntBound
durability
private EnchantmentPredicate[]
enchantments
private Item
item
private NBTPredicate
nbt
private Potion
potion
private EnchantmentPredicate[]
storedEnchantments
private ITag<Item>
tag
private static java.util.Map<ResourceLocation,java.util.function.Function<com.google.gson.JsonObject,ItemPredicate>>
unmod_predicates
-
Constructor Summary
Constructors Constructor Description ItemPredicate()
ItemPredicate(ITag<Item> p_i225740_1_, Item p_i225740_2_, MinMaxBounds.IntBound p_i225740_3_, MinMaxBounds.IntBound p_i225740_4_, EnchantmentPredicate[] p_i225740_5_, EnchantmentPredicate[] p_i225740_6_, Potion p_i225740_7_, NBTPredicate p_i225740_8_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ItemPredicate
fromJson(com.google.gson.JsonElement p_192492_0_)
static ItemPredicate[]
fromJsonArray(com.google.gson.JsonElement p_192494_0_)
static java.util.Map<ResourceLocation,java.util.function.Function<com.google.gson.JsonObject,ItemPredicate>>
getPredicates()
boolean
matches(ItemStack p_192493_1_)
static void
register(ResourceLocation name, java.util.function.Function<com.google.gson.JsonObject,ItemPredicate> deserializer)
com.google.gson.JsonElement
serializeToJson()
-
-
-
Field Detail
-
custom_predicates
private static final java.util.Map<ResourceLocation,java.util.function.Function<com.google.gson.JsonObject,ItemPredicate>> custom_predicates
-
unmod_predicates
private static final java.util.Map<ResourceLocation,java.util.function.Function<com.google.gson.JsonObject,ItemPredicate>> unmod_predicates
-
ANY
public static final ItemPredicate ANY
-
item
@Nullable private final Item item
-
count
private final MinMaxBounds.IntBound count
-
durability
private final MinMaxBounds.IntBound durability
-
enchantments
private final EnchantmentPredicate[] enchantments
-
storedEnchantments
private final EnchantmentPredicate[] storedEnchantments
-
potion
@Nullable private final Potion potion
-
nbt
private final NBTPredicate nbt
-
-
Constructor Detail
-
ItemPredicate
public ItemPredicate()
-
ItemPredicate
public ItemPredicate(@Nullable ITag<Item> p_i225740_1_, @Nullable Item p_i225740_2_, MinMaxBounds.IntBound p_i225740_3_, MinMaxBounds.IntBound p_i225740_4_, EnchantmentPredicate[] p_i225740_5_, EnchantmentPredicate[] p_i225740_6_, @Nullable Potion p_i225740_7_, NBTPredicate p_i225740_8_)
-
-
Method Detail
-
matches
public boolean matches(ItemStack p_192493_1_)
-
fromJson
public static ItemPredicate fromJson(@Nullable com.google.gson.JsonElement p_192492_0_)
-
serializeToJson
public com.google.gson.JsonElement serializeToJson()
-
fromJsonArray
public static ItemPredicate[] fromJsonArray(@Nullable com.google.gson.JsonElement p_192494_0_)
-
register
public static void register(ResourceLocation name, java.util.function.Function<com.google.gson.JsonObject,ItemPredicate> deserializer)
-
getPredicates
public static java.util.Map<ResourceLocation,java.util.function.Function<com.google.gson.JsonObject,ItemPredicate>> getPredicates()
-
-