java.lang.Object
net.darkhax.simplelootviewer.common.impl.data.info.Name

public final class Name extends Object
While Mojang already has a component codec, it uses NBT under the hood and is actually pretty slow. In an attempt to make things faster, we are storing names as the smallest amount of data required to reconstruct the component. For example, rather than sending the name of a block we can send the block ID.
  • Field Details

    • STREAM

      public static net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,Name> STREAM
  • Constructor Details

    • Name

      public Name(NameType type, Object data)
      Parameters:
      type - The type of name being stored. This controls the serialization and processing on the stored data.
      data - Data used to produce the component. It is unsafe to use data that does not match the expected input.
  • Method Details

    • name

      public net.minecraft.network.chat.Component name()
    • type

      public NameType type()
    • data

      public Object data()