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

    Constructors
    Constructor
    Description
    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 a RegistryEntryContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.cloudburstmc.nbt.NbtMap
     
     
    org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry
    Returns the value of the entry record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    getNetworkId(net.kyori.adventure.key.Key registryKey)
     
    final int
    Returns a hash code value for this object.
    net.kyori.adventure.key.Key
    id()
     
    it.unimi.dsi.fastutil.objects.Object2IntMap<net.kyori.adventure.key.Key>
    Returns the value of the keyIdMap record component.
    Returns the value of the session record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a RegistryEntryContext record class.
      Parameters:
      entry - the value for the entry record component
      keyIdMap - the value for the keyIdMap record component
      session - the value for the session record 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

      public String deserializeDescription()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • entry

      public org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry()
      Returns the value of the entry record component.
      Returns:
      the value of the entry record component
    • keyIdMap

      public it.unimi.dsi.fastutil.objects.Object2IntMap<net.kyori.adventure.key.Key> keyIdMap()
      Returns the value of the keyIdMap record component.
      Returns:
      the value of the keyIdMap record component
    • session

      public Optional<GeyserSession> session()
      Returns the value of the session record component.
      Returns:
      the value of the session record component