fix comment & make final int final

This commit is contained in:
Logan Darklock 2019-08-31 01:04:22 -07:00
parent efa243386c
commit 5e0b333cfd
No known key found for this signature in database
GPG Key ID: B8C37CEDE1AC60EA

View File

@ -114,10 +114,10 @@ public enum WorldScanner implements IWorldScanner {
} }
int yReal = y0 << 4; int yReal = y0 << 4;
IBlockStateContainer bsc = (IBlockStateContainer) extendedblockstorage.getData(); IBlockStateContainer bsc = (IBlockStateContainer) extendedblockstorage.getData();
// the mapping of BlockStateContainer.getIndex from xyz to index is y << 8 | z << 4 | x; // storageArray uses an optimized algorithm that's faster than getAt
// for better cache locality, iterate in that order // creating this array and then using getAtPalette is faster than even getFast(int index)
int[] storage = bsc.storageArray(); int[] storage = bsc.storageArray();
int imax = 1 << 12; final int imax = 1 << 12;
for (int i = 0; i < imax; i++) { for (int i = 0; i < imax; i++) {
IBlockState state = bsc.getAtPalette(storage[i]); IBlockState state = bsc.getAtPalette(storage[i]);
if (filter.has(state)) { if (filter.has(state)) {