-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support both 1.8 and 1.9 chunk format #19
Comments
this will be useful https://gist.github.com/Gjum/0375b643ec13a42ab3c0#file-chunk_-5_5-dump |
@mhsjlw has started working on that at https://github.com/mhsjlw/prismarine-chunk |
Did the chunk format change in 1.10? |
Nope, not yet 😄. I doubt the chunk format will change again for a very, very long time as this is probably the most optimized chunk format we've seen (hence how complicated it is, especially in JavaScript). |
Here is another implementation in C: https://github.com/broese/mcbuild/blob/master/mcp_packet.c#L625 @mhsjlw This kind of stuff looks quite odd in Javascript, but why is it more difficult? Hard to get good performance? |
No, JavaScript doesn't natively support longs which the 1.9 chunk relies on, we've tried ways around it that seem to be successful, but we're not anywhere close. EDIT: For it to be a proper prismarine-chunk implementation we need to be able to read AND write and load AND dump |
What are still currently problems with your implementation? |
@rom1504 I don't understand the issue with |
The problem lies in accessing the data on these longs. Each entry is offset by some number of bits and can be split across two longs in a nontrivial way: http://wiki.vg/SMP_Map_Format#Example |
@Gjum And what is the problem? |
@polkovnikov-ph the problem is nobody finished a full implementation for prismarine-chunk 1.9
I you feel like implementing it, go ahead ! |
last progress on this https://github.com/roblabla/prismarine-chunk/commits/master This issue is 8 months old, might be time to solve it... (blocking mineflayer and flying-squid for minecraft >=1.9) |
RE: The WIP you did. I had a go at completing it: https://gist.github.com/Flynnn/035c17f67158154220db7971e34314b2 Seems to work! It converts the new 1.9 raw chunk data back to the format being read by the 1.8 version of prismarine-chunk. Not the most ideal solution, but it appears to work. Histogram reports 76% air, 14% stone, 6% water, 1% bedrock, and less than 1% of dirt, lava, gravel, gold ore, iron ore, coal ore, and redstone ore. I'm gonna go ahead and integrate this into a fork of prismarine-chunk. EDIT: |
👍 Good luck! Keep us updated |
AFAICT this should be good: https://github.com/Flynnn/prismarine-chunk But I'd like to wait until someone is able to really test it before doing a pull request. Notably, a new argument is required for Chunk.Load -- no way around this, except, perhaps, having the argument packed in with the data. Perhaps that would be preferable? |
@Flynnn Great job! I'll try it right now. |
finally done thanks to @Flynnn |
Most excellent! Thanks for all of the help, @rom1504, @mhsjlw |
http://wiki.vg/SMP_Map_Format#Format
http://wiki.vg/Pre-release_protocol#Chunk_Section
PrismarineJS/node-minecraft-protocol#231 (comment)
This will help mineflayer and flying-squid update to cross-version (1.8 + 1.9)
The text was updated successfully, but these errors were encountered: