MCCTeam / Minecraft-Console-Client

Lightweight console for Minecraft chat and automated scripts
https://mccteam.github.io
Other
1.67k stars 402 forks source link

fix: IndexOutOfRange on packet reading (Forge) #2681

Closed oldkingOK closed 8 months ago

oldkingOK commented 9 months ago

Fix #2652

Add two missing forge Command Packet Parsers, which won't affect the vanilla parsers. The ids of the two Command Packet Parsers forge:enum and forge:modid Forge once added in order are the maximum value of the Vanilla Parser id plus 1 or plus 2. forge:enum has a String Type argument. The specific id is from wiki.vg or Forge-generated minecraft source code net.minecraft.commands.synchronization.ArgumentTypeInfos (Thanks to @kitUIN).

The table of version and id correspondences is shown below.

Version Protocol Version forge:enum id Documented
1.19 759 50 True
1.19.1 760 50 False
1.19.2 760 50 False
1.19.3 761 50 True
1.19.4 762 50 True
1.20 763 51 False
1.20.1 763 51 False
1.20.2 764 51 False
1.20.3 765 52 False
1.20.4 765 52 False
oldkingOK commented 9 months ago

It is ready for review or merge, thanks.

oldkingOK commented 9 months ago

Hi @ReinforceZwei , I put the forge parsers into the existing switch block, with extra version check in 1.19.4+ branch. It is ready for review.

milutinke commented 8 months ago

Is this ready for merging?

oldkingOK commented 8 months ago

It is ready for merging, thanks.

milutinke commented 8 months ago

Merged. thanks for your contribution