Skip to content

Commit

Permalink
Change MModdingTrackedDataHandlers
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Oct 22, 2023
1 parent 4e0094a commit 78d23eb
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<List<Boolean>> BOOLEAN_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeBoolean, PacketByteBuf::readBoolean);
public static final TrackedDataHandler<List<Integer>> INTEGER_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeVarInt, PacketByteBuf::readVarInt);
public static final TrackedDataHandler<List<Long>> LONG_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeVarLong, PacketByteBuf::readVarLong);
public static final TrackedDataHandler<List<Float>> FLOAT_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeFloat, PacketByteBuf::readFloat);
public static final TrackedDataHandler<List<Double>> DOUBLE_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeDouble, PacketByteBuf::readDouble);
public static final TrackedDataHandler<List<String>> STRING_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeString, PacketByteBuf::readString);
public static final TrackedDataHandler<List<Identifier>> IDENTIFIER_LIST = TrackedDataHandlerUtils.createTrackedDataListHandler(PacketByteBuf::writeIdentifier, PacketByteBuf::readIdentifier);
public static final TrackedDataHandler<List<UUID>> 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);
}
}

0 comments on commit 78d23eb

Please sign in to comment.