Class LambdaDataSerializer<T>

java.lang.Object
com.pixelmonmod.pixelmon.api.data.LambdaDataSerializer<T>
All Implemented Interfaces:
net.minecraft.network.syncher.EntityDataSerializer<T>

public class LambdaDataSerializer<T> extends Object implements net.minecraft.network.syncher.EntityDataSerializer<T>
  • 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
    LambdaDataSerializer(BiConsumer<net.minecraft.network.FriendlyByteBuf,T> write, Function<net.minecraft.network.FriendlyByteBuf,T> read, Function<T,T> copy)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(T instance)
     
    net.minecraft.network.syncher.EntityDataAccessor<T>
     
    read(net.minecraft.network.FriendlyByteBuf buffer)
     
    void
    write(net.minecraft.network.FriendlyByteBuf buffer, T instance)
     

    Methods inherited from class java.lang.Object

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

    • LambdaDataSerializer

      public LambdaDataSerializer(BiConsumer<net.minecraft.network.FriendlyByteBuf,T> write, Function<net.minecraft.network.FriendlyByteBuf,T> read, Function<T,T> copy)
  • Method Details

    • write

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

      public T read(net.minecraft.network.FriendlyByteBuf buffer)
      Specified by:
      read in interface net.minecraft.network.syncher.EntityDataSerializer<T>
    • createAccessor

      public net.minecraft.network.syncher.EntityDataAccessor<T> createAccessor(int id)
      Specified by:
      createAccessor in interface net.minecraft.network.syncher.EntityDataSerializer<T>
    • copy

      public T copy(T instance)
      Specified by:
      copy in interface net.minecraft.network.syncher.EntityDataSerializer<T>