Package net.minecraft.predicate.item
Record Class ItemPredicate
java.lang.Object
java.lang.Record
net.minecraft.predicate.item.ItemPredicate
- Record Components:
tag
-items
-count
-durability
-enchantments
-storedEnchantments
-potion
-nbt
-
public record ItemPredicate(Optional<TagKey<Item>> tag, Optional<RegistryEntryList<Item>> items, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<RegistryEntry<Potion>> potion, Optional<NbtPredicate> nbt)
extends Record
- Mappings:
Namespace Name official cb
intermediary net/minecraft/class_2073
named net/minecraft/predicate/item/ItemPredicate
official b
intermediary comp_1783
named tag
official c
intermediary comp_1784
named items
official d
intermediary comp_1785
named count
official e
intermediary comp_1786
named durability
official f
intermediary comp_1787
named enchantments
official g
intermediary comp_1788
named storedEnchantments
official h
intermediary comp_1789
named potion
official i
intermediary comp_1790
named nbt
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemPredicate>
private final NumberRange.IntRange
The field for thecount
record component.private final NumberRange.IntRange
The field for thedurability
record component.private final List<EnchantmentPredicate>
The field for theenchantments
record component.private static final com.mojang.serialization.Codec<RegistryEntryList<Item>>
private final Optional<RegistryEntryList<Item>>
The field for theitems
record component.private final Optional<NbtPredicate>
The field for thenbt
record component.private final Optional<RegistryEntry<Potion>>
The field for thepotion
record component.private final List<EnchantmentPredicate>
The field for thestoredEnchantments
record component.The field for thetag
record component. -
Constructor Summary
ConstructorDescriptionItemPredicate
(Optional<TagKey<Item>> optional, Optional<RegistryEntryList<Item>> optional2, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> list, List<EnchantmentPredicate> list2, Optional<RegistryEntry<Potion>> optional3, Optional<NbtPredicate> optional4) -
Method Summary
Modifier and TypeMethodDescriptioncount()
Returns the value of thecount
record component.static List<ItemPredicate>
deserializeAll
(@Nullable com.google.gson.JsonElement el) Returns the value of thedurability
record component.Returns the value of theenchantments
record component.final boolean
Indicates whether some other object is "equal to" this one.static Optional<ItemPredicate>
fromJson
(@Nullable com.google.gson.JsonElement el) final int
hashCode()
Returns a hash code value for this object.items()
Returns the value of theitems
record component.nbt()
Returns the value of thenbt
record component.potion()
Returns the value of thepotion
record component.Returns the value of thestoredEnchantments
record component.tag()
Returns the value of thetag
record component.boolean
com.google.gson.JsonElement
toJson()
static com.google.gson.JsonElement
toJson
(List<ItemPredicate> predicates) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
tag
The field for thetag
record component. -
items
The field for theitems
record component. -
count
The field for thecount
record component. -
durability
The field for thedurability
record component. -
enchantments
The field for theenchantments
record component. -
storedEnchantments
The field for thestoredEnchantments
record component. -
potion
The field for thepotion
record component. -
nbt
The field for thenbt
record component. -
ITEM_ENTRY_LIST_CODEC
- Mappings:
Namespace Name Mixin selector official j
Lcb;j:Lcom/mojang/serialization/Codec;
intermediary field_45755
Lnet/minecraft/class_2073;field_45755:Lcom/mojang/serialization/Codec;
named ITEM_ENTRY_LIST_CODEC
Lnet/minecraft/predicate/item/ItemPredicate;ITEM_ENTRY_LIST_CODEC:Lcom/mojang/serialization/Codec;
-
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lcb;a:Lcom/mojang/serialization/Codec;
intermediary field_45754
Lnet/minecraft/class_2073;field_45754:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/predicate/item/ItemPredicate;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
ItemPredicate
public ItemPredicate(Optional<TagKey<Item>> optional, Optional<RegistryEntryList<Item>> optional2, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> list, List<EnchantmentPredicate> list2, Optional<RegistryEntry<Potion>> optional3, Optional<NbtPredicate> optional4) - Mappings:
Namespace Name Mixin selector official <init>
Lcb;<init>(Ljava/util/Optional;Ljava/util/Optional;Lcl$d;Lcl$d;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
intermediary <init>
Lnet/minecraft/class_2073;<init>(Ljava/util/Optional;Ljava/util/Optional;Lnet/minecraft/class_2096$class_2100;Lnet/minecraft/class_2096$class_2100;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
named <init>
Lnet/minecraft/predicate/item/ItemPredicate;<init>(Ljava/util/Optional;Ljava/util/Optional;Lnet/minecraft/predicate/NumberRange$IntRange;Lnet/minecraft/predicate/NumberRange$IntRange;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
-
-
Method Details
-
test
- Mappings:
Namespace Name Mixin selector official a
Lcb;a(Lcjf;)Z
intermediary method_8970
Lnet/minecraft/class_2073;method_8970(Lnet/minecraft/class_1799;)Z
named test
Lnet/minecraft/predicate/item/ItemPredicate;test(Lnet/minecraft/item/ItemStack;)Z
-
fromJson
- Mappings:
Namespace Name Mixin selector official a
Lcb;a(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
intermediary method_8969
Lnet/minecraft/class_2073;method_8969(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
named fromJson
Lnet/minecraft/predicate/item/ItemPredicate;fromJson(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
-
toJson
public com.google.gson.JsonElement toJson()- Mappings:
Namespace Name Mixin selector official a
Lcb;a()Lcom/google/gson/JsonElement;
intermediary method_8971
Lnet/minecraft/class_2073;method_8971()Lcom/google/gson/JsonElement;
named toJson
Lnet/minecraft/predicate/item/ItemPredicate;toJson()Lcom/google/gson/JsonElement;
-
toJson
- Mappings:
Namespace Name Mixin selector official a
Lcb;a(Ljava/util/List;)Lcom/google/gson/JsonElement;
intermediary method_53164
Lnet/minecraft/class_2073;method_53164(Ljava/util/List;)Lcom/google/gson/JsonElement;
named toJson
Lnet/minecraft/predicate/item/ItemPredicate;toJson(Ljava/util/List;)Lcom/google/gson/JsonElement;
-
deserializeAll
public static List<ItemPredicate> deserializeAll(@Nullable @Nullable com.google.gson.JsonElement el) - Mappings:
Namespace Name Mixin selector official b
Lcb;b(Lcom/google/gson/JsonElement;)Ljava/util/List;
intermediary method_8972
Lnet/minecraft/class_2073;method_8972(Lcom/google/gson/JsonElement;)Ljava/util/List;
named deserializeAll
Lnet/minecraft/predicate/item/ItemPredicate;deserializeAll(Lcom/google/gson/JsonElement;)Ljava/util/List;
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
tag
Returns the value of thetag
record component.- Returns:
- the value of the
tag
record component
-
items
Returns the value of theitems
record component.- Returns:
- the value of the
items
record component
-
count
Returns the value of thecount
record component.- Returns:
- the value of the
count
record component
-
durability
Returns the value of thedurability
record component.- Returns:
- the value of the
durability
record component
-
enchantments
Returns the value of theenchantments
record component.- Returns:
- the value of the
enchantments
record component
-
storedEnchantments
Returns the value of thestoredEnchantments
record component.- Returns:
- the value of the
storedEnchantments
record component
-
potion
Returns the value of thepotion
record component.- Returns:
- the value of the
potion
record component
-
nbt
Returns the value of thenbt
record component.- Returns:
- the value of the
nbt
record component
-