Package net.minecraft.predicate.item
Record Class EnchantmentPredicate
java.lang.Object
java.lang.Record
net.minecraft.predicate.item.EnchantmentPredicate
- Record Components:
enchantments-levels-
public record EnchantmentPredicate(Optional<RegistryEntryList<Enchantment>> enchantments, NumberRange.IntRange levels)
extends Record
- Mappings:
Namespace Name named net/minecraft/predicate/item/EnchantmentPredicateintermediary net/minecraft/class_2035official bqnamed enchantmentsintermediary comp_2665official bnamed levelsintermediary comp_1749official c
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EnchantmentPredicate> private final Optional<RegistryEntryList<Enchantment>> The field for theenchantmentsrecord component.private final NumberRange.IntRangeThe field for thelevelsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentPredicate(Optional<RegistryEntryList<Enchantment>> optional, NumberRange.IntRange intRange) EnchantmentPredicate(RegistryEntry<Enchantment> enchantment, NumberRange.IntRange levels) EnchantmentPredicate(RegistryEntryList<Enchantment> enchantments, NumberRange.IntRange levels) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenchantmentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.levels()Returns the value of thelevelsrecord component.booleantest(ItemEnchantmentsComponent enchantmentsComponent) private booleantestLevel(ItemEnchantmentsComponent enchantmentsComponent, RegistryEntry<Enchantment> enchantment) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
enchantments
The field for theenchantmentsrecord component. -
levels
The field for thelevelsrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/predicate/item/EnchantmentPredicate;CODEC:Lcom/mojang/serialization/Codec;intermediary field_45741Lnet/minecraft/class_2035;field_45741:Lcom/mojang/serialization/Codec;official aLbq;a:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
EnchantmentPredicate
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/predicate/item/EnchantmentPredicate;<init>(Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/predicate/NumberRange$IntRange;)Vintermediary <init>Lnet/minecraft/class_2035;<init>(Lnet/minecraft/class_6880;Lnet/minecraft/class_2096$class_2100;)Vofficial <init>Lbq;<init>(Ljm;Ldh$d;)V
-
EnchantmentPredicate
public EnchantmentPredicate(RegistryEntryList<Enchantment> enchantments, NumberRange.IntRange levels) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/predicate/item/EnchantmentPredicate;<init>(Lnet/minecraft/registry/entry/RegistryEntryList;Lnet/minecraft/predicate/NumberRange$IntRange;)Vintermediary <init>Lnet/minecraft/class_2035;<init>(Lnet/minecraft/class_6885;Lnet/minecraft/class_2096$class_2100;)Vofficial <init>Lbq;<init>(Ljq;Ldh$d;)V
-
EnchantmentPredicate
public EnchantmentPredicate(Optional<RegistryEntryList<Enchantment>> optional, NumberRange.IntRange intRange)
-
-
Method Details
-
test
- Mappings:
Namespace Name Mixin selector named testLnet/minecraft/predicate/item/EnchantmentPredicate;test(Lnet/minecraft/component/type/ItemEnchantmentsComponent;)Zintermediary method_8880Lnet/minecraft/class_2035;method_8880(Lnet/minecraft/class_9304;)Zofficial aLbq;a(Ldai;)Z
-
testLevel
private boolean testLevel(ItemEnchantmentsComponent enchantmentsComponent, RegistryEntry<Enchantment> enchantment) - Mappings:
Namespace Name Mixin selector named testLevelLnet/minecraft/predicate/item/EnchantmentPredicate;testLevel(Lnet/minecraft/component/type/ItemEnchantmentsComponent;Lnet/minecraft/registry/entry/RegistryEntry;)Zintermediary method_59916Lnet/minecraft/class_2035;method_59916(Lnet/minecraft/class_9304;Lnet/minecraft/class_6880;)Zofficial aLbq;a(Ldai;Ljm;)Z
-
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). -
enchantments
Returns the value of theenchantmentsrecord component.- Returns:
- the value of the
enchantmentsrecord component
-
levels
Returns the value of thelevelsrecord component.- Returns:
- the value of the
levelsrecord component
-