mcpiapi icon indicating copy to clipboard operation
mcpiapi copied to clipboard

added getBlocks

Open mrwagner opened this issue 10 years ago • 5 comments

Hello,

I coded up a getBlocks command for the WorldCommandHalndler - can I email it to you, or commit it here?

mrwagner avatar Oct 15 '15 19:10 mrwagner

May I make a suggestion? getBlocks() is not all that useful on its own. What would be really useful would be a getBlocksWithData() command. So maybe both getBlocks() and getBlocksWithData() should be added. If they get added to mcpiapi, I'll add them to all the three version of RaspberryJamMod that I maintain (Desktop, Android and Minetest).

arpruss avatar Oct 15 '15 19:10 arpruss

GetBlocksWithData() sounds good. I'll get it done tomorrow afternoon. I'm kind of a github nub - do I commit the code back here, make a fork, or something else?

mrwagner avatar Oct 15 '15 20:10 mrwagner

I really don't know, either, sorry.

arpruss avatar Oct 16 '15 16:10 arpruss

I forked this repository and added the code to: https://github.com/mrwag/mcpiapi

It works, it's tested, sort of - I'll work on it more when I get some time.

I had to change getBlocks and added getBlocksWithData to minecraft.py

mrwag avatar Oct 17 '15 02:10 mrwag

I just looked at the Juice source code. They first loop y, then x, then z.

Also, for reasons of compatibility with Jam, can you separate the values between different blocks in getBlocksWithData with a pipe character? Name: id1,meta1|id2,meta2|id3,meta3 Jam has a mode where it will return a list of three items per block, the third being the nbt.

arpruss avatar Oct 21 '15 00:10 arpruss