diff --git a/data/packetid/generator/Main.java b/data/packetid/generator/Main.java new file mode 100644 index 0000000..c3dc392 --- /dev/null +++ b/data/packetid/generator/Main.java @@ -0,0 +1,40 @@ +package me.tnze; + +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import net.minecraft.network.ConnectionProtocol; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.PacketFlow; + +public class Main { + + public static void main(String[] args) throws Exception { + handlePackets(ConnectionProtocol.LOGIN.getPacketsByIds(PacketFlow.CLIENTBOUND)); + System.out.println(); + handlePackets(ConnectionProtocol.LOGIN.getPacketsByIds(PacketFlow.SERVERBOUND)); + System.out.println(); + System.out.println(); + handlePackets(ConnectionProtocol.STATUS.getPacketsByIds(PacketFlow.CLIENTBOUND)); + System.out.println(); + handlePackets(ConnectionProtocol.STATUS.getPacketsByIds(PacketFlow.SERVERBOUND)); + System.out.println(); + System.out.println(); + handlePackets(ConnectionProtocol.PLAY.getPacketsByIds(PacketFlow.CLIENTBOUND)); + System.out.println(); + handlePackets(ConnectionProtocol.PLAY.getPacketsByIds(PacketFlow.SERVERBOUND)); + } + + private static void handlePackets(Int2ObjectMap>> packets) { + for (int i = 0; i < packets.size(); i++) { + Class> c = packets.get(i); + String className = c.getSimpleName(); + if (className.endsWith("Packet")) + className = className.substring(0, className.length() - "Packet".length()); + else { + String superClassName = c.getSuperclass().getSimpleName(); + if (superClassName.endsWith("Packet")) + className = superClassName.substring(0, superClassName.length() - "Packet".length()) + className; + } + System.out.println(className); + } + } +} \ No newline at end of file diff --git a/data/packetid/packetid.go b/data/packetid/packetid.go index 97f39f9..c674a06 100644 --- a/data/packetid/packetid.go +++ b/data/packetid/packetid.go @@ -51,8 +51,10 @@ const ( ClientboundContainerSetData ClientboundContainerSetSlot ClientboundCooldown + ClientboundCustomChatCompletions ClientboundCustomPayload ClientboundCustomSound + ClientboundDeleteChat ClientboundDisconnect ClientboundEntityEvent ClientboundExplode @@ -78,6 +80,7 @@ const ( ClientboundPing ClientboundPlaceGhostRecipe ClientboundPlayerAbilities + ClientboundPlayerChatHeader ClientboundPlayerChat ClientboundPlayerCombatEnd ClientboundPlayerCombatEnter @@ -142,6 +145,7 @@ const ( ServerboundAcceptTeleportation = iota ServerboundBlockEntityTagQuery ServerboundChangeDifficulty + ServerboundChatAck ServerboundChatCommand ServerboundChat ServerboundChatPreview