From 78d23eb97dcd047d4c993badef98edfd01f0558f Mon Sep 17 00:00:00 2001 From: FirstMegaGame4 <84094287+FirstMegaGame4@users.noreply.github.com> Date: Sun, 22 Oct 2023 15:34:33 +0200 Subject: [PATCH] Change MModdingTrackedDataHandlers --- .../entities/data/MModdingTrackedDataHandlers.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/mmodding/mmodding_lib/library/entities/data/MModdingTrackedDataHandlers.java b/src/main/java/com/mmodding/mmodding_lib/library/entities/data/MModdingTrackedDataHandlers.java index 64153bb..cbcc89c 100644 --- a/src/main/java/com/mmodding/mmodding_lib/library/entities/data/MModdingTrackedDataHandlers.java +++ b/src/main/java/com/mmodding/mmodding_lib/library/entities/data/MModdingTrackedDataHandlers.java @@ -8,14 +8,27 @@ import org.quiltmc.qsl.entity.networking.api.tracked_data.QuiltTrackedDataHandlerRegistry; import java.util.List; +import java.util.UUID; public class MModdingTrackedDataHandlers { + public static final TrackedDataHandler> BOOLEAN_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeBoolean, PacketByteBuf::readBoolean); + public static final TrackedDataHandler> INTEGER_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeVarInt, PacketByteBuf::readVarInt); + public static final TrackedDataHandler> LONG_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeVarLong, PacketByteBuf::readVarLong); + public static final TrackedDataHandler> FLOAT_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeFloat, PacketByteBuf::readFloat); + public static final TrackedDataHandler> DOUBLE_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeDouble, PacketByteBuf::readDouble); public static final TrackedDataHandler> STRING_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeString, PacketByteBuf::readString); public static final TrackedDataHandler> IDENTIFIER_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeIdentifier, PacketByteBuf::readIdentifier); + public static final TrackedDataHandler> UUID_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeUuid, PacketByteBuf::readUuid); static { + QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("boolean_list"), MModdingTrackedDataHandlers.BOOLEAN_LIST); + QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("integer_list"), MModdingTrackedDataHandlers.INTEGER_LIST); + QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("long_list"), MModdingTrackedDataHandlers.LONG_LIST); + QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("float_list"), MModdingTrackedDataHandlers.FLOAT_LIST); + QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("double_list"), MModdingTrackedDataHandlers.DOUBLE_LIST); QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("string_list"), MModdingTrackedDataHandlers.STRING_LIST); QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("identifier_list"), MModdingTrackedDataHandlers.IDENTIFIER_LIST); + QuiltTrackedDataHandlerRegistry.register(new MModdingIdentifier("uuid_list"), MModdingTrackedDataHandlers.UUID_LIST); } }