I am coding a mod for minecraft, and was confronted by a confusing math problem. I want to find the ID of all blocks around a center block. To do this I wanted to loop through a 3x3 square of blocks and return which ones are the blocks I want.
The parameters I have to work with are the X, Y and Z coords. I'm guessing the best bet would be to use 3 for loops, one for each axis, right?
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
for(int k = 0; k < 3; k++){
//do something
}
}
}