Package net.minecraft.predicate.item
Record Class EnchantmentPredicate
java.lang.Object
java.lang.Record
net.minecraft.predicate.item.EnchantmentPredicate
- Record Components:
enchantment
-levels
-
public record EnchantmentPredicate(Optional<RegistryEntry<Enchantment>> enchantment, NumberRange.IntRange levels)
extends Record
- Mappings:
Namespace Name official bl
intermediary net/minecraft/class_2035
named net/minecraft/predicate/item/EnchantmentPredicate
official b
intermediary comp_1748
named enchantment
official c
intermediary comp_1749
named levels
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EnchantmentPredicate>
private final Optional<RegistryEntry<Enchantment>>
The field for theenchantment
record component.private final NumberRange.IntRange
The field for thelevels
record component. -
Constructor Summary
ConstructorDescriptionEnchantmentPredicate
(Optional<RegistryEntry<Enchantment>> optional, NumberRange.IntRange intRange) EnchantmentPredicate
(Enchantment enchantment, NumberRange.IntRange levels) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenchantment
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.levels()
Returns the value of thelevels
record component.boolean
test
(Map<Enchantment, Integer> enchantments) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
enchantment
The field for theenchantment
record component. -
levels
The field for thelevels
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lbl;a:Lcom/mojang/serialization/Codec;
intermediary field_45741
Lnet/minecraft/class_2035;field_45741:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/predicate/item/EnchantmentPredicate;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
EnchantmentPredicate
- Mappings:
Namespace Name Mixin selector official <init>
Lbl;<init>(Lcno;Lcl$d;)V
intermediary <init>
Lnet/minecraft/class_2035;<init>(Lnet/minecraft/class_1887;Lnet/minecraft/class_2096$class_2100;)V
named <init>
Lnet/minecraft/predicate/item/EnchantmentPredicate;<init>(Lnet/minecraft/enchantment/Enchantment;Lnet/minecraft/predicate/NumberRange$IntRange;)V
-
EnchantmentPredicate
public EnchantmentPredicate(Optional<RegistryEntry<Enchantment>> optional, NumberRange.IntRange intRange)
-
-
Method Details
-
test
- Mappings:
Namespace Name Mixin selector official a
Lbl;a(Ljava/util/Map;)Z
intermediary method_8880
Lnet/minecraft/class_2035;method_8880(Ljava/util/Map;)Z
named test
Lnet/minecraft/predicate/item/EnchantmentPredicate;test(Ljava/util/Map;)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)
. -
enchantment
Returns the value of theenchantment
record component.- Returns:
- the value of the
enchantment
record component
-
levels
Returns the value of thelevels
record component.- Returns:
- the value of the
levels
record component
-