So would a 2D array likely have been better, even though for say [y][x] (as well as the order being somewhat confusing) creates height+1 separate arrays (and then likely requires a temp and memcpy if it ever interacts with native code, e.g. to display it)? In 3D for a block game like minecraft that seems even worse.
If not then I guess that is actually a good reason to suggest building stuff like Minecraft in C.
regardless of language you really should use a single dimensional array and access it linearly to avoid cache misses most of the time (the cost of the extra arithmetics is far smaller than the cost of cache misses for large arrays). in C and C++ 2D array will be identical to a 1D array behind the scenes though and you only have to worry about iterating over it effectivly ([x][y] vs [y][x] depending on which way you're looping for example) making those languages a bit easier to work with for such cases.
in Java a 2D array will not be a single block of memory and thus requires 2 dereferences per access and is far more likely to cause cache misses, since you want to iterate over the datablock linearly anyway regardless of language you should use a 1D array as often as possible (As its most cache friendly) its best to figure out where to start and stop before the loop (then Java can usually do the bounds check just once for the whole loop making it a non issue).
It can be quite a bit easier to write such things well using a language with low level features though. (I wouldn't use C myself as C++ provides more or less the same low level features + a whole bunch of useful high level features anyway)
Edited by SimonForsman, 06 August 2013 - 04:19 AM.