Back to project page Spidermine.
The source code is released under:
Copyright ? 2014 PEMapModder This software is open-source and everyone is welcome to share redistributions or modifications, as long as it is clearly specified that this project's original source is ...
If you think the Android project Spidermine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pemapmodder.old_spidermine.world; //from ww w .j av a 2 s. co m public class Chunk { private Block[][][] blocks; private World world; public Chunk(World world){//generate new empty chunk this.world=world; for(int x=0;x<16;x++){ for(int z=0;z<16;z++){ for(int y=0;y<128;y++){ blocks[x][z][y]=new Block(0,0); } } } } public Chunk setBlock(int x, int y, int z, Block block, boolean update){ x%=16; z%=16; this.blocks[x][z][y]=block; if(update){ //TODO update blocks } return this; } public Block getBlock(int x, int y, int z){ return blocks[x%16][z%16][y]; } public World getWorld() { return world; } }