Class MinecraftHashEncoder

java.lang.Object
org.geysermc.geyser.item.hashing.MinecraftHashEncoder

public class MinecraftHashEncoder extends Object
Encodes primitive Java objects, lists, and maps into a HashCode, using Hashing.crc32c() as hash function.

Based off the HashOps class in vanilla Java 1.21.5, and is used by MinecraftHasher.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.common.hash.HashCode
    bool(boolean b)
     
    com.google.common.hash.HashCode
    byteArray(byte[] bytes)
     
    com.google.common.hash.HashCode
     
    com.google.common.hash.HashCode
     
    com.google.common.hash.HashCode
    intArray(int[] ints)
     
    com.google.common.hash.HashCode
    list(List<com.google.common.hash.HashCode> list)
     
    com.google.common.hash.HashCode
    longArray(long[] longs)
     
    com.google.common.hash.HashCode
    map(Map<com.google.common.hash.HashCode,com.google.common.hash.HashCode> map)
     
    com.google.common.hash.HashCode
    nbtList(org.cloudburstmc.nbt.NbtList<?> nbtList)
     
    com.google.common.hash.HashCode
    nbtMap(org.cloudburstmc.nbt.NbtMap map)
     
    com.google.common.hash.HashCode
    number(Number number)
     
     
    com.google.common.hash.HashCode
    string(String string)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EMPTY_MAP

      public static final byte[] EMPTY_MAP
  • Constructor Details

  • Method Details

    • registries

      public JavaRegistryProvider registries()
    • empty

      public com.google.common.hash.HashCode empty()
    • emptyMap

      public com.google.common.hash.HashCode emptyMap()
    • number

      public com.google.common.hash.HashCode number(Number number)
    • string

      public com.google.common.hash.HashCode string(String string)
    • bool

      public com.google.common.hash.HashCode bool(boolean b)
    • map

      public com.google.common.hash.HashCode map(Map<com.google.common.hash.HashCode,com.google.common.hash.HashCode> map)
    • nbtMap

      public com.google.common.hash.HashCode nbtMap(org.cloudburstmc.nbt.NbtMap map)
    • list

      public com.google.common.hash.HashCode list(List<com.google.common.hash.HashCode> list)
    • nbtList

      public com.google.common.hash.HashCode nbtList(org.cloudburstmc.nbt.NbtList<?> nbtList)
    • byteArray

      public com.google.common.hash.HashCode byteArray(byte[] bytes)
    • intArray

      public com.google.common.hash.HashCode intArray(int[] ints)
    • longArray

      public com.google.common.hash.HashCode longArray(long[] longs)