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>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T>
     
    copy(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

    • codec

      @Nonnull public net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec()
      Specified by:
      codec 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>>