Interface PacketSerializer<T>

All Known Subinterfaces:
LoginPacketSerializer<T>

public interface PacketSerializer<T>
An interface implementing the logic on how to serialise and deserialize a message.
  • Method Summary

    Modifier and Type
    Method
    Description
    decode(net.minecraft.network.FriendlyByteBuf buffer)
    Decodes a message from a FriendlyByteBuf.
    void
    encode(T msg, net.minecraft.network.FriendlyByteBuf buffer)
    Encodes the message to a FriendlyByteBuf.
    The class of the message serialised by this serializer.
  • Method Details

    • messageClass

      Class<T> messageClass()
      The class of the message serialised by this serializer.
    • encode

      void encode(T msg, net.minecraft.network.FriendlyByteBuf buffer)
      Encodes the message to a FriendlyByteBuf.
    • decode

      T decode(net.minecraft.network.FriendlyByteBuf buffer)
      Decodes a message from a FriendlyByteBuf.