Tnze / go-mc

Collection of Go libraries for Minecraft
https://go-mc.github.io/tutorial/
MIT License
848 stars 114 forks source link

guys and girls, how do I update packet id to 1.20.4 #276

Closed qwqtoday closed 4 months ago

qwqtoday commented 4 months ago

I am so close on updating go-mc to 1.20.4, I just need some help on the packet id thing, what is the correct way to update that?

Tnze commented 4 months ago

Do you see data/packetid/generator/Main.java? It's a java program.

Basically, you should decompile the vanilla client or server (by using the MCP-Reborn project). Once you do so, you got a Gradle project opened in your IntelliJ IDEA IDE.

Now you copy the Main.java into the Maven project. The project view looks like this: image

Open the Main.java in your IDE. Click the green triangle on the left of the main function (or the Main class). Your IDEA will run the program. If there is any compile error, fix the error.

The program dumps the Packet names into stdout and you should copy them into data/packetid/packetid.go.

FInally, you should run go generate to generate data/packetid/serverboundpacketid_string.go and data/packetid/clientboundpacketid_string.go. If you didn't install the stringer command, install it with go install golang.org/x/tools/cmd/stringer.

qwqtoday commented 4 months ago

Thanks, will try once I am back home

qwqtoday commented 4 months ago

Also another question, do you mind if I include a ping handler in bot/basic in that pr? It is like keep alive but it responds to ping It sounds pretty basic to me so I implemented that in bot/basic instead of my bot

Tnze commented 4 months ago

I don't care as long as you do it right.

qwqtoday commented 4 months ago

I had done it. This is my pull request #277 Hopefully I did everything correct.