Record Class RegistryEntryContext
java.lang.Object
java.lang.Record
org.geysermc.geyser.registry.java.reader.RegistryEntryContext
- Record Components:
javaRegistries- theJavaRegistryProviderentry- theRegistryEntry
- All Implemented Interfaces:
JavaRegistryProvider.Provider,JavaRegistryReader.Context
public record RegistryEntryContext(JavaRegistryProvider javaRegistries, org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry)
extends Record
implements JavaRegistryReader.Context
Expands
JavaRegistryReader.Context with a Key. Used when parsing registry data from a ClientboundRegistryDataPacket.-
Constructor Summary
ConstructorsConstructorDescriptionRegistryEntryContext(JavaRegistryProvider javaRegistries, org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry) Creates an instance of aRegistryEntryContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()org.geysermc.mcprotocollib.protocol.data.game.RegistryEntryentry()Returns the value of theentryrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.kyori.adventure.key.Keyid()Returns the value of thejavaRegistriesrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.geysermc.geyser.registry.java.reader.JavaRegistryReader.Context
dataAsMap, parseDescription
-
Constructor Details
-
RegistryEntryContext
public RegistryEntryContext(JavaRegistryProvider javaRegistries, org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry) Creates an instance of aRegistryEntryContextrecord class.- Parameters:
javaRegistries- the value for thejavaRegistriesrecord componententry- the value for theentryrecord component
-
-
Method Details
-
id
public net.kyori.adventure.key.Key id()- Returns:
- the
Keyof this registry entry
-
data
- Specified by:
datain interfaceJavaRegistryReader.Context- Returns:
- the registry entry to parse, serialised to NBT
-
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). -
javaRegistries
Returns the value of thejavaRegistriesrecord component.- Specified by:
javaRegistriesin interfaceJavaRegistryProvider.Provider- Returns:
- the value of the
javaRegistriesrecord component
-
entry
public org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry()Returns the value of theentryrecord component.- Returns:
- the value of the
entryrecord component
-