Record Class RegistryEntryContext
java.lang.Object
java.lang.Record
org.geysermc.geyser.session.cache.registry.RegistryEntryContext
- Record Components:
entry- the registry entry being read.keyIdFunction- a function that turns a resource location in the registry to its respective network ID.session- the Geyser session. Only empty during testing.
public record RegistryEntryContext(org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry, ToIntFunction<net.kyori.adventure.key.Key> keyIdFunction, Optional<GeyserSession> session)
extends Record
Used to store context around a single registry entry when reading said entry's NBT.
-
Constructor Summary
ConstructorsConstructorDescriptionRegistryEntryContext(org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry, ToIntFunction<net.kyori.adventure.key.Key> keyIdFunction, Optional<GeyserSession> session) Creates an instance of aRegistryEntryContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.cloudburstmc.nbt.NbtMapdata()org.geysermc.mcprotocollib.protocol.data.game.RegistryEntryentry()Returns the value of theentryrecord component.final booleanIndicates whether some other object is "equal to" this one.intgetNetworkId(net.kyori.adventure.key.Key registryKey) final inthashCode()Returns a hash code value for this object.net.kyori.adventure.key.Keyid()ToIntFunction<net.kyori.adventure.key.Key> Returns the value of thekeyIdFunctionrecord component.session()Returns the value of thesessionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RegistryEntryContext
public RegistryEntryContext(org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry, ToIntFunction<net.kyori.adventure.key.Key> keyIdFunction, Optional<GeyserSession> session) Creates an instance of aRegistryEntryContextrecord class.- Parameters:
entry- the value for theentryrecord componentkeyIdFunction- the value for thekeyIdFunctionrecord componentsession- the value for thesessionrecord component
-
-
Method Details
-
getNetworkId
public int getNetworkId(net.kyori.adventure.key.Key registryKey) -
id
public net.kyori.adventure.key.Key id() -
data
public org.cloudburstmc.nbt.NbtMap data() -
deserializeDescription
-
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). -
entry
public org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry()Returns the value of theentryrecord component.- Returns:
- the value of the
entryrecord component
-
keyIdFunction
Returns the value of thekeyIdFunctionrecord component.- Returns:
- the value of the
keyIdFunctionrecord component
-
session
Returns the value of thesessionrecord component.- Returns:
- the value of the
sessionrecord component
-