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

Add bedrock 1.21.60 data #980

Merged
merged 13 commits into from
Feb 12, 2025
Merged

Conversation

CreeperG16
Copy link
Contributor

This PR is still a WIP, and Bedrock version 1.21.60 has not been released yet.

This PR adds packet and language data for Bedrock version 1.21.60

Protocol changes

Source for protocol changes: Official Protocol Documentation

Some notable packet changes:

  • The itemstates field of StartGamePacket has been replaced by a dedicated packet - the former ItemComponentPacket has been renamed to ItemRegistryPacket and repurposed for this.
    • I've also added a new feature, itemRegistryPacket, to help with implementing this new behaviour in packages such as bedrock-protocol and prismarine-registry.
  • CreativeContentPacket got a major restructure to allow organising custom items into their own groups in the creative inventory (like wool, logs, decorative stone in vanilla)

Additionally, some enums got new members, but as the official documentation doesn't document entire enums, only new members, they are most likely placed at wrong values in this PR. I'll fix or revert them once I have more information.

Additional documentation of packet fields

Many new documentation comments were added to mojang's official protocol docs in this update, so I have copied some of them to their places in minecraft-data. However, I assume these comments need to be added to all versions of the protocol yaml files, which I will do (or revert if it proves too much work) once I get confirmation of this fact.

Language data

Language data was extracted from the preview BDS vanilla resource pack files.

@@ -3523,7 +3535,7 @@ packet_item_registry:
!id: 0xa2
!bound: client
# `items` holds a list of all items.
items: ItemData[]varint
itemstates: Itemstates
Copy link
Contributor Author

@CreeperG16 CreeperG16 Feb 11, 2025

Choose a reason for hiding this comment

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

Is this correct? The official docs say there are additional fields (version and nbt)
Hence why I made the new type, though I see now I could've just added the new fields to the ItemStates type

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the overall structure did not change minus inserting some new fields. Keeping the same name and structure is good for compatibility and simplifying implementation

Copy link
Contributor Author

@CreeperG16 CreeperG16 Feb 13, 2025

Choose a reason for hiding this comment

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

I mean the two fields, version and nbt (gophertunnel and official docs)
These fields aren't present in the Itemstates type in mcdata

Copy link
Member

Choose a reason for hiding this comment

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

@extremeheat extremeheat changed the title WIP: Add bedrock 1.21.60 data Add bedrock 1.21.60 data Feb 11, 2025
@extremeheat extremeheat marked this pull request as draft February 11, 2025 23:18
@WarPOI
Copy link

WarPOI commented Feb 11, 2025

192.168.197.195/25176 Deserialization failure for packet 0x91. Packet buffer saved in ./1739315504847_packetReadError.txt as buffer was too large (45570 bytes).
192.168.197.195/25176 PartialReadError: Read error for undefined : Missing characters in string, found size is 45570 expected size was 71104
at new ExtendableError (/home/yop/js&ts/proxy_client/node_modules/protodef/src/utils.js:63:13)
at new PartialReadError (/home/yop/js&ts/proxy_client/node_modules/protodef/src/utils.js:70:5)
at Object.ShortString (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :101:15)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :321:41)
at Object.ItemExtraDataWithoutBlockingTick (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :326:9)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :359:49)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :361:19)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :363:15)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :365:13)
at Object.ItemLegacy (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :367:9) {
partialReadError: true
}
192.168.197.195/25176 Deserialization failure for packet 0x34. Packet buffer saved in ./1739315504891_packetReadError.txt as buffer was too large (196475 bytes).
192.168.197.195/25176 RangeError [ERR_OUT_OF_RANGE]: Read error for undefined : The value of "offset" is out of range. It must be >= 0 and <= 196473. Received -20915
at boundsError (node:internal/buffer:88:9)
at Buffer.readInt16LE (node:internal/buffer:416:5)
at Object.reader [as li16] (/home/yop/js&ts/proxy_client/node_modules/protodef/src/datatypes/numeric.js:90:39)
at Object.ShortString (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :98:59)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :321:41)
at Object.ItemExtraDataWithoutBlockingTick (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :326:9)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :359:49)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :361:19)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :363:15)
at eval (eval at compile (/home/yop/js&ts/proxy_client/node_modules/protodef/src/compiler.js:262:12), :365:13) {
code: 'ERR_OUT_OF_RANGE'
}
1739315504891_packetReadError.txt
1739315504847_packetReadError.txt

@extremeheat extremeheat marked this pull request as ready for review February 12, 2025 01:54
@extremeheat
Copy link
Member

However, I assume these comments need to be added to all versions of the protocol yaml files, which I will do (or revert if it proves too much work) once I get confirmation of this fact

Yes, any changes that are applicable to old versions, even to doc, should be applied to the old versions. So we don't have problems like in #948 from tech debt (I fixed the issues here). You can apply changes to old versions by using the "replace all" feature in your editor after putting in a subsection of the old data and then the new data under the replacement.

@extremeheat
Copy link
Member

LGTM

@Slauh
Copy link

Slauh commented Feb 12, 2025

when will it be gtg? After checks?

@extremeheat
Copy link
Member

extremeheat commented Feb 12, 2025

The bedrock tests are going to fail here for now because there is a circular dep on PrismarineJS/bedrock-protocol#570.

@CreeperG16 Ideally if there's a change that requires a bedrock-protocol update before supporting a version it's done in a PR there that doesn't bump the CURRENT_VERSION. Bumping CURRENT_VERSION means that it's a supported version so it can't be merged until mcdata PR is done (which also blocks this)

@extremeheat extremeheat merged commit 641f42d into PrismarineJS:master Feb 12, 2025
3 of 4 checks passed
@extremeheat
Copy link
Member

/makerelease

@rom1504bot rom1504bot mentioned this pull request Feb 12, 2025
@CreeperG16
Copy link
Contributor Author

The bedrock tests are going to fail here for now because there is a circular dep on PrismarineJS/bedrock-protocol#570.

@CreeperG16 Ideally if there's a change that requires a bedrock-protocol update before supporting a version it's done in a PR there that doesn't bump the CURRENT_VERSION. Bumping CURRENT_VERSION means that it's a supported version so it can't be merged until mcdata PR is done (which also blocks this)

Thanks for letting me know, I'll make sure to keep that in mind in the future

@CreeperG16 CreeperG16 deleted the bedrock-776 branch March 7, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants