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 pc 1.21.1 data #925

Merged
merged 14 commits into from
Oct 26, 2024
Merged

Add pc 1.21.1 data #925

merged 14 commits into from
Oct 26, 2024

Conversation

extremeheat
Copy link
Member

No description provided.

@@ -1436,9 +1436,36 @@
"materials": "pc/1.20.5",
"language": "pc/1.20.5",
"entities": "pc/1.20.5",
"protocol": "pc/1.20.5",
"protocol": "pc/1.21",
Copy link
Member

Choose a reason for hiding this comment

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

this seems wrong

"sounds": "pc/1.20.4",
"proto": "pc/latest"
},
"1.21": {
Copy link
Member

Choose a reason for hiding this comment

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

should we go straight to 1.21.1 ?

@GroobleDierne
Copy link
Contributor

GroobleDierne commented Oct 18, 2024

@extremeheat are you still working on this? I did some testing by connecting a nmp client using your protocol.json to a 1.21 server and some clientbound packets aren't processed successfully.
If it can be of any help, here are the errors I encountered:
When detonating a TNT next to the player fixed

PartialReadError: Read error for undefined : Missing characters in string, found size is 230 expected size was 807
    at new ExtendableError (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/utils.js:63:13)
    at new PartialReadError (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/utils.js:70:5)
    at Object.string (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:100:15)
    at Object.packet_explosion (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:2026:89)
    at eval (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:4112:58)
    at packet (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:4203:9)
    at CompiledProtodef.read (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:70:12)
    at e.message (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:111:49)
    at tryCatch (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/utils.js:50:16)
    at CompiledProtodef.parsePacketBuffer (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:111:29)

When joining the server Fixed in #927

PartialReadError: Read error for undefined : Missing characters in string, found size is 21766 expected size was 21779
    at new ExtendableError (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/utils.js:63:13)
    at new PartialReadError (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/utils.js:70:5)
    at Object.string (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:100:15)
    at eval (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:625:55)
    at Object.SlotComponent (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:729:9)
    at eval (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:748:49)
    at eval (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:753:15)
    at eval (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:771:13)
    at Object.Slot (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:773:9)
    at eval (eval at compile (/home/maceo/Documents/dev/node/node-minecraft-protocol/node_modules/protodef/src/compiler.js:262:12), <anonymous>:356:40

And player_chat and profileless_chat related errors that I fixed in #927

@extremeheat
Copy link
Member Author

The packet_explosion was broken since 1.20.3, fixed

ChatTypes type was wrong, it's either an ID or encoded inline (and your proposed fix in PR is incorrect), just fixed.

@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

PrismarineJS/mineflayer#3480 chat back at being broken after the change here

Should I undo PrismarineJS/prismarine-registry#42 ?

@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

Trying

@GroobleDierne
Copy link
Contributor

GroobleDierne commented Oct 26, 2024

The packet_explosion was broken since 1.20.3, fixed

ChatTypes type was wrong, it's either an ID or encoded inline (and your proposed fix in PR is incorrect), just fixed.

lol I just fixed the packet_explosion in my pr too, I'm going to pull your changes then

_: soundId ?
if 0:
soundName: string
range?: f32
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the same logic that is used for packet_entity_sound_effect, maybe a common type can be made to avoid duplication

@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

PrismarineJS/mineflayer#3480 chat back at being broken after the change here

Should I undo PrismarineJS/prismarine-registry#42 ?

No same if not using the change at prismarine registry

Chat is timing out

We need another change

@GroobleDierne
Copy link
Contributor

Also, wolf_variant metadata is broken

@GroobleDierne
Copy link
Contributor

#927 is ready to be merged into pc1.21

@GroobleDierne
Copy link
Contributor

Also, wolf_variant metadata is broken

wild_texture seems to work the same as soundId in packet_explosion, if I set its type to varint I get the numeric identifier of its texture + 1. However, the other fields seem to be optional/missing I'm not sure.

@SuperGamerTron
Copy link
Contributor

PrismarineJS/mineflayer#3480 chat back at being broken after the change here
Should I undo PrismarineJS/prismarine-registry#42 ?

No same if not using the change at prismarine registry

Chat is timing out

We need another change

my bad, should've made a note

PrismarineJS/prismarine-registry#42 now requires PrismarineJS/minecraft-data#932

* 1.21: add blocks enchantments foods language materials & tints

* Fix enchantment category

* 1.20.5: fix enchantCategories

* 1.21: Add items.json

* Add update informations for foods.json

* 1.21: Add recipes.json

* 1.21: protocol.json fix vibration particle

* 1.21.1: Add sounds.json
@rom1504 rom1504 changed the title Add pc 1.21 protocol data Add pc 1.21.1 data Oct 26, 2024
@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

@GroobleDierne "pickaxe not upside-down recipe test" is failing, can you check it?

@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

@extremeheat

packet explosion seems to have issues

  1. packets 1.20.6v
    play,ClientBound,packet_explosion:
    TypeError: Cannot convert undefined or null to object
    at Function.keys ()
    at /home/runner/work/node-minecraft-protocol/node-minecraft-protocol/test/packetTest.js:128:16
    at Array.forEach ()
    at Object.container (test/packetTest.js:122:27)
    at getValue (test/packetTest.js:266:34)
    at testPacket (test/packetTest.js:339:75)
    at Context. (test/packetTest.js:333:9)
    at process.processImmediate (node:internal/timers:476:21)

https://github.com/PrismarineJS/node-minecraft-protocol/actions/runs/11534539661/job/32108689005?pr=1342

explosion_sound_name: string
sound_range?: f32
soundId: varint
_: soundId ?
Copy link
Member

Choose a reason for hiding this comment

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

this is super weird; are you sure?

it means sounds id must be 0 or the packet is invalid since there is no default

Copy link
Member

Choose a reason for hiding this comment

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

going to add default: void

Copy link
Contributor

Choose a reason for hiding this comment

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

No default defaults to void anyway no?

Copy link
Member

Choose a reason for hiding this comment

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

no, no default means there is no default: other values are impossible and should crash

@GroobleDierne
Copy link
Contributor

@GroobleDierne "pickaxe not upside-down recipe test" is failing, can you check it?

I'll look into that tomorrow

@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

so the problem was that missing items in recipes should be null; not -1
I fixed it with a replace; can you fix it in the extractor @GroobleDierne ?

@GroobleDierne
Copy link
Contributor

so the problem was that missing items in recipes should be null; not -1
I fixed it with a replace; can you fix it in the extractor @GroobleDierne ?

Yep I also updated the sounds generator for 1.21 this afternoon, I'll upstream everything.

@rom1504 rom1504 merged commit d56346a into master Oct 26, 2024
4 checks passed
@rom1504 rom1504 deleted the pc1.21 branch October 26, 2024 21:37
@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

/makerelease

@rom1504bot rom1504bot mentioned this pull request Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

4 participants