Record Class RegistryKey<T extends net.kyori.adventure.key.Keyed>
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.registry.RegistryKey<T>
public record RegistryKey<T extends net.kyori.adventure.key.Keyed>(@NotNull RegistryType<T extends net.kyori.adventure.key.Keyed> registry, @NotNull net.kyori.adventure.key.Key id)
extends Record
A typed reference to an entry of a registry, resolved on demand. Use it to hold references into
reloadable registries (ยง7.3).
-
Constructor Summary
ConstructorsConstructorDescriptionRegistryKey(@NotNull RegistryType<T> registry, @NotNull net.kyori.adventure.key.Key id) Creates an instance of aRegistryKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull net.kyori.adventure.key.Keyid()Returns the value of theidrecord component.static <T extends net.kyori.adventure.key.Keyed>
@NotNull RegistryKey<T> of(@NotNull RegistryType<T> registry, @NotNull net.kyori.adventure.key.Key id) @NotNull RegistryType<T> registry()Returns the value of theregistryrecord component.resolve(@NotNull RegistryAccess access) @NotNull StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RegistryKey
public RegistryKey(@NotNull @NotNull RegistryType<T> registry, @NotNull @NotNull net.kyori.adventure.key.Key id) Creates an instance of aRegistryKeyrecord class.- Parameters:
registry- the value for theregistryrecord componentid- the value for theidrecord component
-
-
Method Details
-
of
@NotNull public static <T extends net.kyori.adventure.key.Keyed> @NotNull RegistryKey<T> of(@NotNull @NotNull RegistryType<T> registry, @NotNull @NotNull net.kyori.adventure.key.Key id) -
resolve
-
toString
-
hashCode
-
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). -
registry
Returns the value of theregistryrecord component.- Returns:
- the value of the
registryrecord component
-
id
@NotNull public @NotNull net.kyori.adventure.key.Key id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-