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 official he$a
intermediary net/minecraft/class_6880$class_6881
named net/minecraft/registry/entry/RegistryEntry$Direct
official a
intermediary comp_349
named value
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.registry.entry.RegistryEntry
RegistryEntry.Direct<T>, RegistryEntry.Reference<T>, RegistryEntry.Type
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates 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 int
hashCode()
Returns a hash code value for this object.boolean
boolean
Returns whether this entry is intag
.boolean
matches
(Predicate<RegistryKey<T>> predicate) Returns whether this entry's key matchespredicate
.boolean
matchesId
(Identifier id) Returns whether the ID of this entry isid
.boolean
matchesKey
(RegistryKey<T> key) Returns whether the registry key of this entry iskey
.boolean
ownerEquals
(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()
-
Field Details
-
value
The field for thevalue
record component.
-
-
Constructor Details
-
Direct
-
-
Method Details
-
hasKeyAndValue
public boolean hasKeyAndValue()- Specified by:
hasKeyAndValue
in interfaceRegistryEntry<T>
- Mappings:
Namespace Name Mixin selector official b
Lhe;b()Z
intermediary method_40227
Lnet/minecraft/class_6880;method_40227()Z
named hasKeyAndValue
Lnet/minecraft/registry/entry/RegistryEntry;hasKeyAndValue()Z
-
matchesId
Returns whether the ID of this entry isid
.This always returns
false
for direct entries.- Specified by:
matchesId
in interfaceRegistryEntry<T>
- Returns:
- whether the ID of this entry is
id
- Mappings:
Namespace Name Mixin selector official a
Lhe;a(Lacq;)Z
intermediary method_40226
Lnet/minecraft/class_6880;method_40226(Lnet/minecraft/class_2960;)Z
named matchesId
Lnet/minecraft/registry/entry/RegistryEntry;matchesId(Lnet/minecraft/util/Identifier;)Z
-
matchesKey
Returns whether the registry key of this entry iskey
.This always returns
false
for direct entries.- Specified by:
matchesKey
in interfaceRegistryEntry<T>
- Returns:
- whether the registry key of this entry is
key
- Mappings:
Namespace Name Mixin selector official a
Lhe;a(Lacp;)Z
intermediary method_40225
Lnet/minecraft/class_6880;method_40225(Lnet/minecraft/class_5321;)Z
named matchesKey
Lnet/minecraft/registry/entry/RegistryEntry;matchesKey(Lnet/minecraft/registry/RegistryKey;)Z
-
isIn
Returns whether this entry is intag
.This always returns
false
for direct entries, since tags are managed by a registry.- Specified by:
isIn
in interfaceRegistryEntry<T>
- Returns:
- whether this entry is in
tag
- Mappings:
Namespace Name Mixin selector official a
Lhe;a(Lanl;)Z
intermediary method_40220
Lnet/minecraft/class_6880;method_40220(Lnet/minecraft/class_6862;)Z
named isIn
Lnet/minecraft/registry/entry/RegistryEntry;isIn(Lnet/minecraft/registry/tag/TagKey;)Z
-
matches
Returns whether this entry's key matchespredicate
.This always returns
false
for direct entries.- Specified by:
matches
in interfaceRegistryEntry<T>
- Returns:
- whether this entry's key matches
predicate
- Mappings:
Namespace Name Mixin selector official a
Lhe;a(Ljava/util/function/Predicate;)Z
intermediary method_40224
Lnet/minecraft/class_6880;method_40224(Ljava/util/function/Predicate;)Z
named matches
Lnet/minecraft/registry/entry/RegistryEntry;matches(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:
getKeyOrValue
in interfaceRegistryEntry<T>
- Returns:
- the object that identifies this registry key
- Mappings:
Namespace Name Mixin selector official d
Lhe;d()Lcom/mojang/datafixers/util/Either;
intermediary method_40229
Lnet/minecraft/class_6880;method_40229()Lcom/mojang/datafixers/util/Either;
named getKeyOrValue
Lnet/minecraft/registry/entry/RegistryEntry;getKeyOrValue()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:
getKey
in interfaceRegistryEntry<T>
- Returns:
- the registry key of this entry, or an empty optional if this is a direct entry
- Mappings:
Namespace Name Mixin selector official e
Lhe;e()Ljava/util/Optional;
intermediary method_40230
Lnet/minecraft/class_6880;method_40230()Ljava/util/Optional;
named getKey
Lnet/minecraft/registry/entry/RegistryEntry;getKey()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:
getType
in interfaceRegistryEntry<T>
- Returns:
- the type (direct or reference) of this registry entry
- Mappings:
Namespace Name Mixin selector official f
Lhe;f()Lhe$b;
intermediary method_40231
Lnet/minecraft/class_6880;method_40231()Lnet/minecraft/class_6880$class_6882;
named getType
Lnet/minecraft/registry/entry/RegistryEntry;getType()Lnet/minecraft/registry/entry/RegistryEntry$Type;
-
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:
ownerEquals
in interfaceRegistryEntry<T>
- Mappings:
Namespace Name Mixin selector official a
Lhe;a(Lhh;)Z
intermediary method_46745
Lnet/minecraft/class_6880;method_46745(Lnet/minecraft/class_7876;)Z
named ownerEquals
Lnet/minecraft/registry/entry/RegistryEntry;ownerEquals(Lnet/minecraft/registry/entry/RegistryEntryOwner;)Z
-
streamTags
Returns a stream of the tags of this entry, or an empty stream if this is a direct entry.- Specified by:
streamTags
in 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 official c
Lhe;c()Ljava/util/stream/Stream;
intermediary method_40228
Lnet/minecraft/class_6880;method_40228()Ljava/util/stream/Stream;
named streamTags
Lnet/minecraft/registry/entry/RegistryEntry;streamTags()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
- Specified by:
value
in interfaceRegistryEntry<T>
- Mappings:
Namespace Name Mixin selector official a
Lhe;a()Ljava/lang/Object;
intermediary comp_349
Lnet/minecraft/class_6880;comp_349()Ljava/lang/Object;
named value
Lnet/minecraft/registry/entry/RegistryEntry;value()Ljava/lang/Object;
-