-
Notifications
You must be signed in to change notification settings - Fork 434
Update console client to new version
You have to gather:
- Version name (
1.x.x) - Protocol number
- New packet types (Inbound and Outbound)
- Any changes to packet format
You may find those information at wiki.vg.
Here is a pull request of updating from 1.17.1 to 1.18. You may take it as an example.
Update MinecraftClient/Protocol/ProtocolHandler.cs.
- Find
GetProtocolHandler()method - Add protocol number to
supportedVersions_Protocol18array - Find
MCVer2ProtocolVersion()method - Add version name to the switch and return correct protocol number
- Find
ProtocolVersion2MCVer()method - Add protocol number to the switch and return correct version name
Update MinecraftClient/Program.cs.
- Find constant string
MCHighestVersion - Change it to the newest version name
Update MinecraftClient/Protocol/Handlers/PacketTypesIn.cs and MinecraftClient/Protocol/Handlers/PacketTypesOut.cs.
Add new packet type to those two enums.
You are not required to delete any removed packet types.
Create new packet palette in MinecraftClient/Protocol/Handlers/PacketPalettes/.
- You may copy the last version of the packet palette and modify it according to the changes
- Add the newly created packet palette to the project in Visual Studio Solution Explorer
- Change the class name to match the version name
- Add or delete packet ID and packet name to the two
typeInandtypeOutdictionaries - You should make sure all packet ID are sorted ascending. You may use
PacketPaletteHelper.csto help you sort them
Update MinecraftClient/Protocol/Handlers/PacketType18Handler.cs.
- Find
GetTypeHandler()method - Add
else if (protocol <= Protocol19Handler.MCxxxVersion)above theelseat the end of the method - Create the packet palette object created in step 4. (
p = new PacketPaletteXXX())
Update MinecraftClient/Protocol/Handlers/Protocol18.cs
- Create new constant to store the protocol number (you will see a section with
MCXXXVersion = xxx;near the top) - Update
HandlePacket()method- Packets that must be updated:
- KeepAlive
- JoinGame
- ChatMessage
- Respawn
- PlayerPositionAndLook
- MapData
- Title
- PlayerInfo
- TabComplete
- PluginMessage
- Disconnect
- SetCompression
- ResourcePackSend
- TimeUpdate
- UpdateHealth
- SetExperience
- Explosion
- HeldItemChange
- ScoreboardObjective
- UpdateScore
- Other packets are related to entities, inventory and terrain and movement. Those can be updated later
- Packets that must be updated:
- You have to maintain backward compatibility when updating the packet format
You are very close to completion.
Just have to ensure everything is working.
- Download Minecraft vanilla server for that version
- Start the server
- Build MinecraftClient.exe
- Use your build to connect your server
- Test sending message from the client
- Test sending message to the client (e.g. server console command
say some message)
If they work fine and did not crash, you are done!
If not, you have to find out what caused the problem.
Thanks for your contribution. You can submit us a pull request <3