PrismarineJS / minecraft-data

Language independent module providing minecraft data for minecraft clients, servers and libraries.
https://prismarinejs.github.io/minecraft-data
670 stars 224 forks source link

Add pc 1.21.1 data #925

Closed extremeheat closed 1 month ago

GroobleDierne commented 1 month ago

@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 https://github.com/PrismarineJS/minecraft-data/pull/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 commented 1 month ago

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 commented 1 month ago

https://github.com/PrismarineJS/mineflayer/pull/3480 chat back at being broken after the change here

Should I undo https://github.com/PrismarineJS/prismarine-registry/pull/42 ?

rom1504 commented 1 month ago

Trying

GroobleDierne commented 1 month ago

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

rom1504 commented 1 month ago

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 commented 1 month ago

Also, wolf_variant metadata is broken

GroobleDierne commented 1 month ago

927 is ready to be merged into pc1.21

GroobleDierne commented 1 month ago

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 commented 1 month ago

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

rom1504 commented 1 month ago

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

rom1504 commented 1 month ago

@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

GroobleDierne commented 1 month ago

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

I'll look into that tomorrow

rom1504 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

/makerelease