PrismarineJS / prismarine-chunk

A class to hold chunk data for Minecraft
MIT License
61 stars 59 forks source link

Implement the 0x21 map_chunk bitmap #8

Closed wtfaremyinitials closed 7 years ago

wtfaremyinitials commented 9 years ago

Minecraft network packet 0x21 map_chunk allows for a bitmap to specify which 16x16x16 minichunks are included and which are left out to be filled with air. Currently there is no way of using this, and the entirety of the chunk must be sent over the wire.

rom1504 commented 9 years ago

This is needed : sending whole columns to a client is way too slow.

rom1504 commented 9 years ago

see http://wiki.vg/SMP_Map_Format#Bitmasks and https://github.com/andrewrk/mineflayer/blob/master/lib/plugins/blocks.js#L49

rom1504 commented 9 years ago

Right, I'm probably going to do that next: sending whole columns saturate my 1MB/s connection for a few minutes, which means no other packets are received during that time (and adding a 100ms sleep between each map packet makes loading of chunks really slow)

Or http://wiki.vg/Protocol#Map_Chunk_Bulk ?

roblabla commented 9 years ago

stay away from bulk, it's going to be deprecated in 1.9

rom1504 commented 9 years ago

Yeah indeed.

rom1504 commented 9 years ago

The main difficulty here is these cursor functions https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/chunk.js#L19

rom1504 commented 9 years ago

Hmm, so, it might be that nmp server doesn't compress packets (see https://github.com/PrismarineJS/node-minecraft-protocol/blob/c55865ef33bc6ba871364a5beddf1c6f091544f8/src/createServer.js#L203 ).

So this issue might not be that much urgent, I think something to do would be connecting with mineflayer to a vanilla server and see whether the vanilla server uses that bipmap or not.

Edit: yeah compressing was the real flying-squid issue.

This issue is not so urgent then.

rom1504 commented 8 years ago

Anyway we want to represent things internally, dump and load should have a bitmask argument, to handle the fact the mc server send it that way.

rom1504 commented 7 years ago

dependent on #19