Class DinnerboneProtocolUtils

java.lang.Object
net.neoforged.neoforge.network.payload.DinnerboneProtocolUtils

@Internal public final class DinnerboneProtocolUtils extends Object
Protocol utilities for communicating over Dinnerbone's protocol.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,Set<net.minecraft.resources.ResourceLocation>>
     
    static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    parseAndAddChannel(StringBuilder builder, Set<net.minecraft.resources.ResourceLocation> channels)
     
    private static Set<net.minecraft.resources.ResourceLocation>
    readChannels(net.minecraft.network.FriendlyByteBuf buf)
    Reads a set of channels from the buffer.
    private static void
    writeChannels(net.minecraft.network.FriendlyByteBuf buf, Set<net.minecraft.resources.ResourceLocation> channels)
    Writes a set of channels to the buffer.

    Methods inherited from class java.lang.Object

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

    • LOGGER

      public static final org.slf4j.Logger LOGGER
    • CHANNELS_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,Set<net.minecraft.resources.ResourceLocation>> CHANNELS_CODEC
  • Constructor Details

    • DinnerboneProtocolUtils

      private DinnerboneProtocolUtils()
  • Method Details

    • readChannels

      private static Set<net.minecraft.resources.ResourceLocation> readChannels(net.minecraft.network.FriendlyByteBuf buf)
      Reads a set of channels from the buffer. Each channel is a null-terminated string. If a string is not a valid channel, it is ignored.
      Parameters:
      buf - the buffer
      Returns:
      the channels
    • parseAndAddChannel

      private static void parseAndAddChannel(StringBuilder builder, Set<net.minecraft.resources.ResourceLocation> channels)
    • writeChannels

      private static void writeChannels(net.minecraft.network.FriendlyByteBuf buf, Set<net.minecraft.resources.ResourceLocation> channels)
      Writes a set of channels to the buffer. Each channel is a null-terminated string.
      Parameters:
      buf - the buffer
      channels - the channels