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 classItemPredicate.Builder
-
Field Summary
Fields Modifier and Type Field Description static ItemPredicateANYprivate MinMaxBounds.IntBoundcountprivate static java.util.Map<ResourceLocation,java.util.function.Function<com.google.gson.JsonObject,ItemPredicate>>custom_predicatesprivate MinMaxBounds.IntBounddurabilityprivate EnchantmentPredicate[]enchantmentsprivate Itemitemprivate NBTPredicatenbtprivate Potionpotionprivate EnchantmentPredicate[]storedEnchantmentsprivate ITag<Item>tagprivate 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 ItemPredicatefromJson(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()booleanmatches(ItemStack p_192493_1_)static voidregister(ResourceLocation name, java.util.function.Function<com.google.gson.JsonObject,ItemPredicate> deserializer)com.google.gson.JsonElementserializeToJson()
-
-
-
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()
-
-