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

1.16.2 and 1.16.3 support #447

Closed
rom1504 opened this issue Oct 6, 2020 · 13 comments · Fixed by #645
Closed

1.16.2 and 1.16.3 support #447

rom1504 opened this issue Oct 6, 2020 · 13 comments · Fixed by #645

Comments

@rom1504
Copy link
Member

rom1504 commented Oct 6, 2020

we have nmp support now
PrismarineJS/node-minecraft-protocol#757 (comment) indications for mineflayer support
we need adaptations for use of these 3 packets
(cc @GroobleDierne )

@rom1504
Copy link
Member Author

rom1504 commented Oct 6, 2020

relevant mineflayer issue PrismarineJS/mineflayer#1264

@rom1504
Copy link
Member Author

rom1504 commented Oct 22, 2020

only thing needed is login packet change here

@rom1504
Copy link
Member Author

rom1504 commented Oct 22, 2020

relevant mineflayer PR PrismarineJS/mineflayer#1349

@eslym
Copy link

eslym commented Nov 25, 2020

image
Minecraft 1.16.3, I tried to debug through the code but couldn't find the reason, I put console.log before every steps in login.js trying to locate the issue, i am not familiar with the lifecycle

November 26th 2020, 07:03:04 [Warning] onItemPlace handler was registered twice for repeater
November 26th 2020, 07:03:04 [Warning] onItemPlace handler was registered twice for oak_sign
November 26th 2020, 07:03:04 [Warning] onItemPlace handler was registered twice for spruce_sign
November 26th 2020, 07:03:04 [Warning] onItemPlace handler was registered twice for birch_sign
November 26th 2020, 07:03:04 [Warning] onItemPlace handler was registered twice for acacia_sign
November 26th 2020, 07:03:04 [Warning] onItemPlace handler was registered twice for jungle_sign
November 26th 2020, 07:03:04 [Warning] onItemPlace handler was registered twice for dark_oak_sign
November 26th 2020, 07:03:04 [INFO]: Server listening on port 25565
November 26th 2020, 07:03:04 seed: 95338055
add player
send login
November 26th 2020, 07:03:10 [ERR]: Client ::ffff:127.0.0.1:38842 : TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received undefined
    at Function.byteLength (buffer.js:728:11)
    at Object.shortString (eval at compile (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:245:12), <anonymous>:45:25)
    at nbt (eval at compile (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:245:12), <anonymous>:110:32)
    at CompiledProtodef.sizeOf (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:77:14)
    at Object.sizeOfNbt [as nbt] (/mnt/data/projects/nodejs/flying-squid/node_modules/minecraft-protocol/src/datatypes/minecraft.js:41:20)
    at Object.packet_login (eval at compile (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:245:12), <anonymous>:1078:24)
    at eval (eval at compile (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:245:12), <anonymous>:2292:50)
    at packet (eval at compile (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:245:12), <anonymous>:2346:9)
    at CompiledProtodef.sizeOf (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:77:14)
    at e.message (/mnt/data/projects/nodejs/flying-squid/node_modules/protodef/src/compiler.js:84:40)
send spawn pos
send pos
send abilities
send map
November 26th 2020, 07:03:10 [ERR]: Client ::ffff:127.0.0.1:38842 : Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
November 26th 2020, 07:03:10 [INFO]: 0nepeop1e disconnected
update hp
set xp
update inv
update time
fill tab
spawn
November 26th 2020, 07:03:10 [INFO]: 0nepeop1e (::ffff:127.0.0.1) connected
November 26th 2020, 07:03:10 [INFO]: position written, player spawning...```

@rom1504
Copy link
Member Author

rom1504 commented Nov 25, 2020

did you change the login packet yet ? I put the link on how to do that above

@eslym
Copy link

eslym commented Nov 26, 2020

Index: src/lib/plugins/blockUpdates.js
<+>UTF-8
===================================================================
--- src/lib/plugins/blockUpdates.js	(revision 65c63207f23b2e34b2c09197f1eba4d614c86a9d)
+++ src/lib/plugins/blockUpdates.js	(revision 467e8c0270f977ce2d7d2a984d27841059c8ae69)
@@ -29,13 +29,14 @@
       const records = []
       for (const p of updates.values()) {
         const state = await world.getBlockStateId(p)
-        records.push({
-          horizontalPos: ((p.x & 0xF) << 4) | (p.z & 0xF),
-          y: p.y,
-          blockId: state
-        })
+        records.push(state)
       }
-      packets.push({ chunkX, chunkZ, records })
+      const chunkCoordinates = {
+        x: chunkX,
+        y: 0,
+        z: chunkZ
+      }
+      packets.push({ chunkCoordinates, notTrustEdges: false, records })
     }
     return packets
   }
Index: src/lib/plugins/login.js
<+>UTF-8
===================================================================
--- src/lib/plugins/login.js	(revision 65c63207f23b2e34b2c09197f1eba4d614c86a9d)
+++ src/lib/plugins/login.js	(revision 467e8c0270f977ce2d7d2a984d27841059c8ae69)
@@ -89,10 +89,10 @@
       levelType: 'default',
       gameMode: player.gameMode,
       previousGameMode: player.prevGameMode,
-      worldNames: Object.values(serv.dimensionNames),
-      dimensionCodec: dimensionCodec,
-      worldName: serv.dimensionNames[0],
-      dimension: serv.supportFeature('dimensionIsAString') ? serv.dimensionNames[0] : 0,
+      worldNames: mcData.loginPacket.worldNames,
+      dimensionCodec: mcData.loginPacket.dimensionCodec,
+      worldName: mcData.loginPacket.worldNames[0],
+      dimension: mcData.loginPacket.dimension, // serv.supportFeature('dimensionIsAString') ? serv.dimensionNames[0] : 0,
       hashedSeed: serv.hashedSeed,
       difficulty: serv.difficulty,
       viewDistance: settings['view-distance'],
@@ -100,7 +100,8 @@
       maxPlayers: Math.min(255, serv._server.maxPlayers),
       enableRespawnScreen: true,
       isDebug: false,
-      isFlat: false
+      isFlat: false,
+      isHardcore: false
     })
     if (serv.supportFeature('difficultySentSeparately')) {
       player._client.write('difficulty', {
Index: src/lib/plugins/world.js
<+>UTF-8
===================================================================
--- src/lib/plugins/world.js	(revision 65c63207f23b2e34b2c09197f1eba4d614c86a9d)
+++ src/lib/plugins/world.js	(revision 467e8c0270f977ce2d7d2a984d27841059c8ae69)
@@ -150,7 +150,7 @@
         groundUp: true,
         bitMap: chunk.getMask(),
         biomes: chunk.dumpBiomes(),
-        ignoreOldData: true, // should be false when a chunk section is updated instead of the whole chunk being overwritten, do we ever do that?
+        // ignoreOldData: true, // should be false when a chunk section is updated instead of the whole chunk being overwritten, do we ever do that?
         heightmaps: {
           type: 'compound',
           name: '',

It works after i made these changes, but I have totally no idea is it correct for the block updates part, because there is no protocol documentation yet for the newer packet_multi_block_change

@GroobleDierne
Copy link
Contributor

@ghost
Copy link

ghost commented May 17, 2021

1.16.4 and 1.16.5 exist now, any status on this?

@rom1504
Copy link
Member Author

rom1504 commented May 17, 2021

Yes nobody spent the hour needed to complete this.
Are you interested to do this ?

@ghost
Copy link

ghost commented May 17, 2021

no, not really

@NoNameLmao
Copy link

no updates yet?

@rom1504
Copy link
Member Author

rom1504 commented Jun 19, 2021

no, do you want to do it @NoNameLmao ?

@NoNameLmao
Copy link

no, do you want to do it @NoNameLmao ?

yes i do, but i dont know javascript that well,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants