Record Class ResolvableHolderComponent<T>
java.lang.Object
java.lang.Record
org.geysermc.geyser.item.components.resolvable.ResolvableHolderComponent<T>
- All Implemented Interfaces:
ResolvableComponent<org.geysermc.mcprotocollib.protocol.data.game.Holder<T>>
public record ResolvableHolderComponent<T>(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<org.geysermc.mcprotocollib.protocol.data.game.Holder<T>> type, JavaRegistryKey<?> registry, net.kyori.adventure.key.Key reference)
extends Record
implements ResolvableComponent<org.geysermc.mcprotocollib.protocol.data.game.Holder<T>>
-
Constructor Summary
ConstructorsConstructorDescriptionResolvableHolderComponent(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<org.geysermc.mcprotocollib.protocol.data.game.Holder<T>> type, JavaRegistryKey<?> registry, net.kyori.adventure.key.Key reference) Creates an instance of aResolvableHolderComponentrecord 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.static ResolvableHolderComponent<?> parse(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<org.geysermc.mcprotocollib.protocol.data.game.Holder<?>> type, com.google.gson.JsonObject object) net.kyori.adventure.key.KeyReturns the value of thereferencerecord component.registry()Returns the value of theregistryrecord component.@Nullable org.geysermc.mcprotocollib.protocol.data.game.Holder<T> resolve(JavaRegistryProvider registries) final StringtoString()Returns a string representation of this record class.org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<org.geysermc.mcprotocollib.protocol.data.game.Holder<T>> type()Returns the value of thetyperecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.geysermc.geyser.item.components.resolvable.ResolvableComponent
resolve
-
Constructor Details
-
ResolvableHolderComponent
public ResolvableHolderComponent(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<org.geysermc.mcprotocollib.protocol.data.game.Holder<T>> type, JavaRegistryKey<?> registry, net.kyori.adventure.key.Key reference) Creates an instance of aResolvableHolderComponentrecord class.- Parameters:
type- the value for thetyperecord componentregistry- the value for theregistryrecord componentreference- the value for thereferencerecord component
-
-
Method Details
-
parse
public static ResolvableHolderComponent<?> parse(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<org.geysermc.mcprotocollib.protocol.data.game.Holder<?>> type, com.google.gson.JsonObject object) -
resolve
public @Nullable org.geysermc.mcprotocollib.protocol.data.game.Holder<T> resolve(JavaRegistryProvider registries) - Specified by:
resolvein interfaceResolvableComponent<T>
-
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). -
type
public org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<org.geysermc.mcprotocollib.protocol.data.game.Holder<T>> type()Returns the value of thetyperecord component.- Specified by:
typein interfaceResolvableComponent<T>- Returns:
- the value of the
typerecord component
-
registry
Returns the value of theregistryrecord component.- Returns:
- the value of the
registryrecord component
-
reference
public net.kyori.adventure.key.Key reference()Returns the value of thereferencerecord component.- Returns:
- the value of the
referencerecord component
-