Fix critical issue causing chunk to lod build extremely slow, and also partly fix sparse data source loading (where I used wrong array instead of loaded data array.) Also improve ChunkToLodBuilder building loops to support multithreaded building

This commit is contained in:
TomTheFurry
2022-09-18 16:30:00 +08:00
parent 3046127b03
commit 9316575534
2 changed files with 6 additions and 6 deletions
@@ -100,7 +100,7 @@ public class ChunkWrapper implements IChunkWrapper
@Override
public IBiomeWrapper getBiome(int x, int y, int z)
{
if (wrappedLevel != null) return wrappedLevel.getBiome(new DhBlockPos(x + getMinX(), y, z + getMinZ()));
//if (wrappedLevel != null) return wrappedLevel.getBiome(new DhBlockPos(x + getMinX(), y, z + getMinZ()));
#if PRE_MC_1_17_1
return BiomeWrapper.getBiomeWrapper(chunk.getBiomes().getNoiseBiome(
@@ -178,9 +178,9 @@ public class ChunkWrapper implements IChunkWrapper
#if PRE_MC_1_18_1
return true;
#else
if (chunk instanceof LevelChunk) {
return ((LevelChunk) chunk).isClientLightReady();
}
//if (chunk instanceof LevelChunk) {
// return ((LevelChunk) chunk).isClientLightReady();
//}
return chunk.isLightCorrect();
#endif
}
@@ -221,7 +221,7 @@ public class ChunkWrapper implements IChunkWrapper
@Override
public IBlockStateWrapper getBlockState(int x, int y, int z) {
if (wrappedLevel != null) return wrappedLevel.getBlockState(new DhBlockPos(x + getMinX(), y, z + getMinZ()));
//if (wrappedLevel != null) return wrappedLevel.getBlockState(new DhBlockPos(x + getMinX(), y, z + getMinZ()));
return BlockStateWrapper.fromBlockState(chunk.getBlockState(new BlockPos(x,y,z)));
}
}