Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 1.21.3 Support #936

Draft
wants to merge 52 commits into
base: master
Choose a base branch
from
Draft

Conversation

GroobleDierne
Copy link
Contributor

@GroobleDierne GroobleDierne commented Oct 27, 2024

Fixes #929, #928

TODO:

  • Protocol
    • packet_recipe_book_add
    • packet_craft_recipe_response should be similar to previous one
    • Fix Slot & SlotComponent types
    • packet_declare_recipes
  • entities.json (waiting on minecraft-data-generator)
  • tints.json is likely incorrect

@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024

Can you point missing files to 1.21.1 for now

@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024

Let's open an nmp and mineflayer PRs using this

@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024

nmp and mineflayer PRs

PrismarineJS/node-minecraft-protocol#1347
PrismarineJS/mineflayer#3489

fail due to wrong protocol as expected

@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024

see https://github.com/extremeheat/extracted_minecraft_data/pulls as a source of info for the protocol

@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024

@GroobleDierne
Copy link
Contributor Author

see https://github.com/extremeheat/extracted_minecraft_data/pulls as a source of info for the protocol

I'm using yarn because some files failed to decompile in extremheat's repository.
Anyway, I'll stop here for tonight.

@rom1504
Copy link
Member

rom1504 commented Oct 31, 2024

@@ -1542,7 +1531,40 @@
if custom_report_details: packet_common_custom_report_details
if server_links: packet_common_server_links
^play.toClient.types:
# World state information for spawn and respawn packets
packet_set_player_inventory:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to add up to date # MC: ClassName anchors to the top of all packet defs, this makes it easy to jump between the vanilla implementation and the protodef defs

additions, corrections
@extremeheat
Copy link
Member

I did some work on the protocol, still some work to do:

  • Recipe changes (recipe_book_add/remove/etc.) not yet handled
  • SlotComponent type needs fixes, likely back to 1.20.5
  • Backport some fixes to 1.20.5
  • Added new registryEntryHolder and registryEntryHolderSet types to correspond to the Holder and HolderSet types inside minecraft (ref) to replace usage of the arrayWithLengthOffset type
    • holderSet work by writing a varint to the stream, n, and 0 means "read one [string] entry" and non-zero n, means read an array of 1+n entries of data from the stream
    • holder work by writing a varint to the stream, n, and 0 means "read one [varint] entry" set to n+1 and non-zero means read an array of n entries of data from the stream
    • usage example (not yet implemented) to write a varint, n, and then either a varint or EntityMetadataWolfVariant:
 if wolf_variant: ["registryEntryHolder", {
      "base": { name: "variantId", type: "varint" },
      "otherwise": { name: "variantData", type: "EntityMetadataWolfVariant" }
 }]
["bitflags", {
      "type": "u32",
      "flags": ["x", "y", "z", "yaw", "pitch", "dx", "dy", "dz", "yawDelta"]
   }]

data/pc/latest/proto.yml Outdated Show resolved Hide resolved
@@ -3689,8 +3096,12 @@
actionId: varint
jumpBoost: varint
# MC: ServerboundPlayerInputPacket
packet_player_inputs:
inputsBitset: u8
packet_steer_vehicle:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name doesn't make sense anymore since this packet is sent even if the player isn't in a vehicle

@MrBruz
Copy link

MrBruz commented Nov 13, 2024

@GroobleDierne For 'registryDataIsMandatory', 'version' needs to be changed to 'versions'

@GroobleDierne
Copy link
Contributor Author

@GroobleDierne For 'registryDataIsMandatory', 'version' needs to be changed to 'versions'

Thx

@GroobleDierne
Copy link
Contributor Author

Now only recipes related packets seem to be missing for protocol support

@GroobleDierne
Copy link
Contributor Author

I'll try debugging them later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

Successfully merging this pull request may close these issues.

Support Minecraft PC 1.21.3
4 participants