Record Class RegistryEntryContext
java.lang.Object
java.lang.Record
org.geysermc.geyser.session.cache.registry.RegistryEntryContext
- Record Components:
entry- the registry entry being read.keyIdMap- a map for each of the resource location's in the registry and their respective network IDs.session- the Geyser session. Only empty during testing.
public record RegistryEntryContext(org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry, it.unimi.dsi.fastutil.objects.Object2IntMap<net.kyori.adventure.key.Key> keyIdMap, 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, it.unimi.dsi.fastutil.objects.Object2IntMap<net.kyori.adventure.key.Key> keyIdMap, 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()it.unimi.dsi.fastutil.objects.Object2IntMap<net.kyori.adventure.key.Key> keyIdMap()Returns the value of thekeyIdMaprecord 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, it.unimi.dsi.fastutil.objects.Object2IntMap<net.kyori.adventure.key.Key> keyIdMap, Optional<GeyserSession> session) Creates an instance of aRegistryEntryContextrecord class.
-
-
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
-
keyIdMap
public it.unimi.dsi.fastutil.objects.Object2IntMap<net.kyori.adventure.key.Key> keyIdMap()Returns the value of thekeyIdMaprecord component.- Returns:
- the value of the
keyIdMaprecord component
-
session
Returns the value of thesessionrecord component.- Returns:
- the value of the
sessionrecord component
-