-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update for newest wsmc/mineflayer/node-minecraft-protocol 0.16 #16
Conversation
First had to update voxel-engine-stackgl 1.1.0 for this critical browser compatibility fix voxel/voxel-shader#11, current status:
|
Chat now works, but no chunks nor movement, server (using GS++) spams:
Seeing unexpected packet fragmentation from ws in voxel-clientmc (04 length then 00 09 00 00):
versus mcwebchat example client:
Only wsmc/mineflayer-ws.js was setting |
This update corresponds to deathcap/wsmc@fedd8df, but for voxel-clientmc. noPacketFramer is set in wsmc/mineflayer-ws, but voxel-clientmc instead uses wsmc/mineflayer-stream directly, since it connects to a duplexer stream then to the webworker, rather than ws itself. TODO: fix layering violation by having to update both when the "WSMC protocol" (= MC tunneled over WS) changes in the wsmc module, while still allowing wsmc/mineflayer-stream to provide generic access.
Fixes '0 is not in mappings error' with voxel-clientmc, fixing as part of voxel/voxel-clientmc#16
Chat now works, and am receiving chunk and block update packets, but not seeing any voxels rendered. Receiving the spawn position, it is set currently, and getting some position updates, but sooner or later they stop and the (web) client falls, disconnected from the (mc) server. Need to find out why the chunks aren't displaying. mf-worker.js receives the chunks, then sends back to the main thread to display (or at least, that's what's supposed to happen). Debugging further: replacing voxel-clientmc with voxel-land, chunks load ok (so it isn't some other module interfering). The chunk data gets passed to voxel-engine-stackgl this.addChunkToNextUpdate(chunk) successfully, and it contains valid blocks (34 = smooth stone, looks fine). There are meshes briefly added, observed in voxel-shader, but then the meshes quickly drops to zero - and far chunks are removed. The player keeps falling (y dropping). But if I reset the player camera position upwards, |
…mething to land on
Got sidetracked, trying to untangle voxel-clientmc chunk parsing/generation, updated https://github.com/voxel/voxel-example/ and published a very simple voxel.js terrain generator https://github.com/voxel/voxel-flatland - added it in this module for now, generating chunks to land on while I debug further why the mc chunks are not rendering. |
Another alternative if I can't get this MC to voxel.js chunk translation to work again, is to use https://github.com/rom1504/voxel-prismarine-world - renders a https://github.com/PrismarineJS/prismarine-world using voxel.js (same engine as voxel-clientmc), but if using mineflayer this requires it switching to prismarine-world first PrismarineJS/mineflayer#334 |
Looks like the mc chunk is written, as it overwrites the voxel-flatland chunk if I only process (16,0,16):
I do see interesting data in game.voxels.chunks ( Chunk borders: Chunk load (32,0,16)
|
Update for newest wsmc/mineflayer/node-minecraft-protocol 0.16
Update voxel-clientmc to work with deathcap/wsmc#21 which now uses node-minecraft-protocol ≥0.16