Class FriendlyByteBufUtil
java.lang.Object
net.neoforged.neoforge.common.util.FriendlyByteBufUtil
Utility class for working with
FriendlyByteBuf
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
writeCustomData
(Consumer<RegistryFriendlyByteBuf> dataWriter, RegistryAccess registryAccess) Writes custom data to aRegistryFriendlyByteBuf
, then returns the written data as a byte array.
-
Constructor Details
-
FriendlyByteBufUtil
private FriendlyByteBufUtil()
-
-
Method Details
-
writeCustomData
public static byte[] writeCustomData(Consumer<RegistryFriendlyByteBuf> dataWriter, RegistryAccess registryAccess) Writes custom data to aRegistryFriendlyByteBuf
, 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.
-