mineflayer icon indicating copy to clipboard operation
mineflayer copied to clipboard

start work on 1.19

Open rom1504 opened this issue 3 years ago • 3 comments

rom1504 avatar Aug 15 '22 23:08 rom1504

did chat more or less

next: checking https://github.com/PrismarineJS/minecraft-data/pull/587/commits/4caba63eea29c269dc0077a22fe8bf4aefbfe4c1 https://github.com/PrismarineJS/minecraft-data/pull/587/commits/4e845dcbdeba04b5a5e1cde66fd6914678da665a https://github.com/PrismarineJS/minecraft-data/pull/587/commits/f816c05200187ea71c15f2619caa242e2bd8cf1d https://github.com/PrismarineJS/minecraft-data/pull/587/commits/5ef06f1c54ee818a67ec2c5cd884b9c32fd2e1c6 to see what to add here

checking if any prismarine-* need change as well

rom1504 avatar Aug 15 '22 23:08 rom1504

Error: [Prismarine-chunk] No chunk implementation for pc 1.19 found

rom1504 avatar Aug 15 '22 23:08 rom1504

https://github.com/PrismarineJS/prismarine-chunk/pull/196

rom1504 avatar Aug 15 '22 23:08 rom1504

pchunk done

rom1504 avatar Aug 22 '22 00:08 rom1504

next handle all changes from https://wiki.vg/index.php?title=Pre-release_protocol&oldid=17659

immediate one is handle dimension -> registryCodec in login packet

rom1504 avatar Aug 22 '22 00:08 rom1504

https://github.com/PrismarineJS/mineflayer/blob/9497b67d85082317bf7bf7a19427ed9371cb2f49/lib/plugins/game.js#L25 needs fixing

rom1504 avatar Aug 22 '22 00:08 rom1504

https://github.com/PrismarineJS/minecraft-data/pull/621 & https://github.com/PrismarineJS/prismarine-registry/pull/14 fix the login packet handling

extremeheat avatar Aug 22 '22 03:08 extremeheat

 Uncaught TypeError: Cannot read property 'value' of undefined
  at Object.simplify (node_modules/prismarine-nbt/nbt.js:155:25)
  at handleRespawnPacketData (lib/plugins/game.js:40:33)
  at Client.<anonymous> (lib/plugins/game.js:58:5)

login packet handling need fixing there

rom1504 avatar Aug 29 '22 23:08 rom1504

So there's dimension and dimensionCodec in login packet https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/game.js#L39

In 1.19 there's only dimensionCodec

Where is world max height located now ?

We need to fix that line of game.js

rom1504 avatar Aug 30 '22 07:08 rom1504

here needed is https://github.com/PrismarineJS/minecraft-data/issues/636

rom1504 avatar Sep 30 '22 17:09 rom1504

need https://github.com/PrismarineJS/prismarine-registry/pull/18 and fix release for https://github.com/PrismarineJS/prismarine-chat/actions/runs/3159953313/jobs/5143822604

Also looks like spawn_entity packet structure may be incorrect

PartialReadError: Read error for undefined : undefined
    at new ExtendableError (/workspace/mineflayer/node_modules/protodef/src/utils.js:63:13)
    at new PartialReadError (/workspace/mineflayer/node_modules/protodef/src/utils.js:70:5)
    at Object.readVarInt [as varint] (/workspace/mineflayer/node_modules/protodef/src/datatypes/utils.js:69:45)
    at Object.packet_spawn_entity (eval at compile (/workspace/mineflayer/node_modules/protodef/src/compiler.js:258:12), <anonymous>:499:65)
    at eval (eval at compile (/workspace/mineflayer/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2312:64)

And villager tests are failing, may be some updates there

extremeheat avatar Oct 01 '22 07:10 extremeheat

Chat seems to fail with these changes

rom1504 avatar Oct 01 '22 07:10 rom1504

Tests are passing Next steps:

  • [ ] Check non tested examples still run
  • [ ] inventory.js
  • [ ] chest.js
  • [ ] digger.js
  • [ ] jumper.js

rom1504 avatar Oct 01 '22 09:10 rom1504

Actually tests definitely not passing

rom1504 avatar Oct 01 '22 09:10 rom1504

failures left:

  4 failing

  1) mineflayer_external 1.19
       trade:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'polished_andesite'
- 'pumpkin_pie'
      + expected - actual

      -polished_andesite
      +pumpkin_pie
      
      at /home/runner/work/mineflayer/mineflayer/test/externalTests/trade.js:43:14
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  2) mineflayer_external 1.19
       "before each" hook for "useChests":
     Error: Timeout of 600000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/mineflayer/mineflayer/test/externalTest.js)
      at listOnTimeout (internal/timers.js:557:17)
      at processTimers (internal/timers.js:500:7)

  3) mineflayer_internal 1.19
       world
         switchWorld respawn:
     Error: Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/mineflayer/mineflayer/test/internalTest.js)
      at listOnTimeout (internal/timers.js:557:17)
      at processTimers (internal/timers.js:500:7)

  4) mineflayer_internal 1.19
       "after each" hook for "switchWorld respawn":
     Error: Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/mineflayer/mineflayer/test/internalTest.js)
      at listOnTimeout (internal/timers.js:557:17)
      at processTimers (internal/timers.js:500:7)

rom1504 avatar Oct 01 '22 21:10 rom1504

  • trading external
  • useChests external
  • switch world internal

rom1504 avatar Oct 01 '22 21:10 rom1504

switchWorld is passing now with #2788 , rest are still failing including entity tests in internal

extremeheat avatar Oct 05 '22 01:10 extremeheat

Looks like entities test is failing because of the spawn_entity_living packet. The packet name is wrong/misleading. It should be named named_entity_spawn. After a name change the entity tests should work again.

IceTank avatar Oct 10 '22 00:10 IceTank

Fixed the issue with entity spawning above, with minor comment above about UUID field

Most tests minus villager one for 1.19 are passing with https://github.com/PrismarineJS/node-minecraft-data/pull/240

extremeheat avatar Oct 10 '22 08:10 extremeheat

1.13 fishing failing 1.19 use chest and trading failing

rom1504 avatar Oct 10 '22 09:10 rom1504

Fishing for 1.13 is also failing? Was that working before?

IceTank avatar Oct 10 '22 10:10 IceTank

Yes all non 1.19 tests were working before

rom1504 avatar Oct 10 '22 11:10 rom1504

ok, everything is passing minus 1.13 fishing. Not clear why, nothing seems to have changed between 1.12 - 1.14

https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.12/entities.json#L3 https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.13.2/entities.json#L315 https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.14/entities.json#L345

It looks like https://github.com/PrismarineJS/mineflayer/blob/e28e878b3cdeac7040104461a088a29f93492011/lib/plugins/fishing.js#L24 is not getting called

extremeheat avatar Oct 10 '22 11:10 extremeheat

Could it be related to change made wrt spawn entity packet ?

On Mon, Oct 10, 2022, 13:17 extremeheat @.***> wrote:

ok, everything is passing minus 1.13 fishing. Not clear why, nothing seems to have changed between 1.12 - 1.14

https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.12/entities.json#L3

https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.13.2/entities.json#L315

https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.14/entities.json#L345

It looks like https://github.com/PrismarineJS/mineflayer/blob/e28e878b3cdeac7040104461a088a29f93492011/lib/plugins/fishing.js#L24 is not getting called

— Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/pull/2743#issuecomment-1273159862, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437SSGPEKQYFC5MAOJYLWCP3ONANCNFSM56TYB5MQ . You are receiving this because you authored the thread.Message ID: @.***>

rom1504 avatar Oct 10 '22 11:10 rom1504

In version 1.13.2 tests: test/externalTests/fishing.js, The variable "collected" in the onPlayerCollect function has a type of 'object' and a name of 'item-stack'. In version 1.14.4 and greater tests: test/externalTests/fishing.js, The variable "collected" in the onPlayerCollect function has a type of 'mob' and a name of 'item'.

I changed "if (collected.name.toLowerCase() === 'item')" to : "if (collected.name.toLowerCase() === 'item' || collected.type === 'object')" and it works

Shorent avatar Oct 10 '22 21:10 Shorent

yeah, I'm looking through the source code for 1.13 entities and the data in mc-data doesn't make sense. There's entities that aren't registered ("evocation_fangs") and the IDs are wrong.

https://github.dev/extremeheat/extracted_minecraft_data/blob/client1.13.2/client/net/minecraft/entity/EntityType.java#L145

extremeheat avatar Oct 10 '22 23:10 extremeheat

Maybe we can copy from 1.14 and remove additional? Or redo the extraction

rom1504 avatar Oct 11 '22 11:10 rom1504

I looked at the changes and it looks good to me.

Next steps :

  • Fixing that fishing test for 1.13
  • testing manually inventory.js chest.js digger.js jumper.js

Is someone interested to running these examples now ? Would gain some time

rom1504 avatar Oct 11 '22 11:10 rom1504

We'll need to support 1.19.2 next but I figure it'll be minor

rom1504 avatar Oct 11 '22 11:10 rom1504

I'm not too familiar with this project, but I can try to do some of that testing.

By manual testing, do you mean testing the plug-ins in the game?

Shorent avatar Oct 11 '22 12:10 Shorent