Package net.minecraft.registry.entry
Record Class RegistryEntry.Direct<T>
java.lang.Object
java.lang.Record
net.minecraft.registry.entry.RegistryEntry.Direct<T>
- Record Components:
value-
- All Implemented Interfaces:
RegistryEntry<T>
- Enclosing interface:
RegistryEntry<T>
A direct registry entry holds the value directly. The value does not have to be
registered in a registry. Therefore, they receive no ID or registry key, and they
cannot be tagged.
This is most often used in data packs to inline one-time use values directly.
- Mappings:
Namespace Name named net/minecraft/registry/entry/RegistryEntry$Directintermediary net/minecraft/class_6880$class_6881official jm$anamed valueintermediary comp_349official a
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.registry.entry.RegistryEntry
RegistryEntry.Direct<T>, RegistryEntry.Reference<T>, RegistryEntry.Type -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getKey()Returns the registry key of this entry, or an empty optional if this is a direct entry.com.mojang.datafixers.util.Either<RegistryKey<T>, T> Returns the object that identifies this registry key.getType()Returns the type (direct or reference) of this registry entry.final inthashCode()Returns a hash code value for this object.booleanbooleanReturns whether this entry is intag.booleanmatches(Predicate<RegistryKey<T>> predicate) Returns whether this entry's key matchespredicate.booleanmatches(RegistryEntry<T> entry) booleanmatchesId(Identifier id) Returns whether the ID of this entry isid.booleanmatchesKey(RegistryKey<T> key) Returns whether the registry key of this entry iskey.booleanownerEquals(RegistryEntryOwner<T> owner) Returns a stream of the tags of this entry, or an empty stream if this is a direct entry.toString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.registry.entry.RegistryEntry
getIdAsString
-
Field Details
-
value
The field for thevaluerecord component.
-
-
Constructor Details
-
Direct
-
-
Method Details
-
hasKeyAndValue
public boolean hasKeyAndValue()- Specified by:
hasKeyAndValuein interfaceRegistryEntry<T>- Mappings:
Namespace Name Mixin selector named hasKeyAndValueLnet/minecraft/registry/entry/RegistryEntry;hasKeyAndValue()Zintermediary method_40227Lnet/minecraft/class_6880;method_40227()Zofficial bLjm;b()Z
-
matchesId
Returns whether the ID of this entry isid.This always returns
falsefor direct entries.- Specified by:
matchesIdin interfaceRegistryEntry<T>- Returns:
- whether the ID of this entry is
id - Mappings:
Namespace Name Mixin selector named matchesIdLnet/minecraft/registry/entry/RegistryEntry;matchesId(Lnet/minecraft/util/Identifier;)Zintermediary method_40226Lnet/minecraft/class_6880;method_40226(Lnet/minecraft/class_2960;)Zofficial aLjm;a(Lakr;)Z
-
matchesKey
Returns whether the registry key of this entry iskey.This always returns
falsefor direct entries.- Specified by:
matchesKeyin interfaceRegistryEntry<T>- Returns:
- whether the registry key of this entry is
key - Mappings:
Namespace Name Mixin selector named matchesKeyLnet/minecraft/registry/entry/RegistryEntry;matchesKey(Lnet/minecraft/registry/RegistryKey;)Zintermediary method_40225Lnet/minecraft/class_6880;method_40225(Lnet/minecraft/class_5321;)Zofficial aLjm;a(Lakq;)Z
-
isIn
Returns whether this entry is intag.This always returns
falsefor direct entries, since tags are managed by a registry.- Specified by:
isInin interfaceRegistryEntry<T>- Returns:
- whether this entry is in
tag - Mappings:
Namespace Name Mixin selector named isInLnet/minecraft/registry/entry/RegistryEntry;isIn(Lnet/minecraft/registry/tag/TagKey;)Zintermediary method_40220Lnet/minecraft/class_6880;method_40220(Lnet/minecraft/class_6862;)Zofficial aLjm;a(Lawu;)Z
-
matches
- Specified by:
matchesin interfaceRegistryEntry<T>- Mappings:
Namespace Name Mixin selector named matchesLnet/minecraft/registry/entry/RegistryEntry;matches(Lnet/minecraft/registry/entry/RegistryEntry;)Zintermediary method_55838Lnet/minecraft/class_6880;method_55838(Lnet/minecraft/class_6880;)Zofficial aLjm;a(Ljm;)Z
-
matches
Returns whether this entry's key matchespredicate.This always returns
falsefor direct entries.- Specified by:
matchesin interfaceRegistryEntry<T>- Returns:
- whether this entry's key matches
predicate - Mappings:
Namespace Name Mixin selector named matchesLnet/minecraft/registry/entry/RegistryEntry;matches(Ljava/util/function/Predicate;)Zintermediary method_40224Lnet/minecraft/class_6880;method_40224(Ljava/util/function/Predicate;)Zofficial aLjm;a(Ljava/util/function/Predicate;)Z
-
getKeyOrValue
Returns the object that identifies this registry key.For direct entries, this is the held value, and for reference entries, this is the key of the entry.
- Specified by:
getKeyOrValuein interfaceRegistryEntry<T>- Returns:
- the object that identifies this registry key
- Mappings:
Namespace Name Mixin selector named getKeyOrValueLnet/minecraft/registry/entry/RegistryEntry;getKeyOrValue()Lcom/mojang/datafixers/util/Either;intermediary method_40229Lnet/minecraft/class_6880;method_40229()Lcom/mojang/datafixers/util/Either;official dLjm;d()Lcom/mojang/datafixers/util/Either;
-
getKey
Returns the registry key of this entry, or an empty optional if this is a direct entry.- Specified by:
getKeyin interfaceRegistryEntry<T>- Returns:
- the registry key of this entry, or an empty optional if this is a direct entry
- Mappings:
Namespace Name Mixin selector named getKeyLnet/minecraft/registry/entry/RegistryEntry;getKey()Ljava/util/Optional;intermediary method_40230Lnet/minecraft/class_6880;method_40230()Ljava/util/Optional;official eLjm;e()Ljava/util/Optional;
-
getType
Returns the type (direct or reference) of this registry entry.This is different from the types of reference registry entries, i.e. stand-alone or intrusive.
- Specified by:
getTypein interfaceRegistryEntry<T>- Returns:
- the type (direct or reference) of this registry entry
- Mappings:
Namespace Name Mixin selector named getTypeLnet/minecraft/registry/entry/RegistryEntry;getType()Lnet/minecraft/registry/entry/RegistryEntry$Type;intermediary method_40231Lnet/minecraft/class_6880;method_40231()Lnet/minecraft/class_6880$class_6882;official fLjm;f()Ljm$b;
-
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. -
ownerEquals
- Specified by:
ownerEqualsin interfaceRegistryEntry<T>- Mappings:
Namespace Name Mixin selector named ownerEqualsLnet/minecraft/registry/entry/RegistryEntry;ownerEquals(Lnet/minecraft/registry/entry/RegistryEntryOwner;)Zintermediary method_46745Lnet/minecraft/class_6880;method_46745(Lnet/minecraft/class_7876;)Zofficial aLjm;a(Ljp;)Z
-
streamTags
Returns a stream of the tags of this entry, or an empty stream if this is a direct entry.- Specified by:
streamTagsin interfaceRegistryEntry<T>- Returns:
- a stream of the tags of this entry, or an empty stream if this is a direct entry
- Mappings:
Namespace Name Mixin selector named streamTagsLnet/minecraft/registry/entry/RegistryEntry;streamTags()Ljava/util/stream/Stream;intermediary method_40228Lnet/minecraft/class_6880;method_40228()Ljava/util/stream/Stream;official cLjm;c()Ljava/util/stream/Stream;
-
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). -
value
Returns the value of thevaluerecord component.- Specified by:
valuein interfaceRegistryEntry<T>- Returns:
- the value of the
valuerecord component
-