Class FriendlyByteBufUtil

java.lang.Object
net.neoforged.neoforge.common.util.FriendlyByteBufUtil

public class FriendlyByteBufUtil extends Object
Utility class for working with FriendlyByteBufs.
  • Constructor Details

    • FriendlyByteBufUtil

      private FriendlyByteBufUtil()
  • Method Details

    • writeCustomData

      public static byte[] writeCustomData(Consumer<RegistryFriendlyByteBuf> dataWriter, RegistryAccess registryAccess)
      Writes custom data to a RegistryFriendlyByteBuf, then returns the written data as a byte array.
      Parameters:
      dataWriter - The data writer.
      registryAccess - The registry access used by registry dependent writers on the buffer
      Returns:
      The written data.