Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyIterator implements Iterator<BlockPos> {
- int xSize,ySize,zSize;
- int x,y,z;
- BlockPos pos[xSize][ySize][zSize];
- private findNext() {
- z++;
- if (z == zSize) {
- z = 0;
- y++;
- }
- if (y == ySize) {
- y = 0;
- x++;
- }
- }
- public BlockPos next() {
- BlockPos ret = pos[x][y][z];
- findNext();
- return ret;
- }
- public bool hasNext() {
- return x < xSize;
- }
- public void remove() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement