Closed rom1504 closed 8 years ago
It gives us a buffer of blocks, how can we split that up so we can send it to the user?
@mhsjlw how big is the buffer ?
When running the read.js example in the repo based off of a world generated by the official minecraft server and running console.log(data.blocks.$.length);
, it is 4194304
console.log(data["blocks"]["$"].length)
4194304
= 256_64_256
so it's exactly the same format
make a load in world.js that does this.data=data; and done.
hmm, not exactly this.data=data; actually load(data) { data.copy(this.data,4); }
well might as well include the require('minecraft-classic-anvil') and usage directly in world.js ;)
I need to publish it then... should we implement world writing first? Like setting blocks? Or should I just disable that for now, so you can only read?
@mhsjlw I think, just remove x,y, z and block in https://github.com/mhsjlw/minecraft-classic-anvil/blob/master/src/write.js and it's done.
I mean it'll be enough to use it.
ah nevermind, you just copy pasted this from read.js, there's some stuff to change indeed.
But just implement as "encode in that java.io format and let the user handle the format" I think, for now.
But anyway yeah, publishing it with just load working is okay.
Ok. before I push though I am adding a readSync function in case we need it
I don't think it's needed to have a readSync no.
it's done I just need to add a /save
command
Should be easy enough to do with https://github.com/mhsjlw/minecraft-classic-anvil