Class EnumDataSerializer<T extends Enum<T>>

java.lang.Object
org.moddingx.libx.network.EnumDataSerializer<T>
All Implemented Interfaces:
net.minecraft.network.syncher.EntityDataSerializer<T>

public class EnumDataSerializer<T extends Enum<T>> extends Object implements net.minecraft.network.syncher.EntityDataSerializer<T>
Data serializers for enums. It needs to be registered in order to be used.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.network.syncher.EntityDataSerializer

    net.minecraft.network.syncher.EntityDataSerializer.ForValueType<T extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(T value)
     
    read(net.minecraft.network.FriendlyByteBuf buffer)
     
    void
    write(net.minecraft.network.FriendlyByteBuf buffer, T value)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.network.syncher.EntityDataSerializer

    createAccessor
  • Constructor Details

    • EnumDataSerializer

      public EnumDataSerializer(Class<T> enumClass)
  • Method Details

    • write

      public void write(@Nonnull net.minecraft.network.FriendlyByteBuf buffer, @Nonnull T value)
      Specified by:
      write in interface net.minecraft.network.syncher.EntityDataSerializer<T extends Enum<T>>
    • read

      @Nonnull public T read(@Nonnull net.minecraft.network.FriendlyByteBuf buffer)
      Specified by:
      read in interface net.minecraft.network.syncher.EntityDataSerializer<T extends Enum<T>>
    • copy

      @Nonnull public T copy(@Nonnull T value)
      Specified by:
      copy in interface net.minecraft.network.syncher.EntityDataSerializer<T extends Enum<T>>