Revert "test chunk array perf"

This reverts commit e2ec9f0c84.
This commit is contained in:
Sen 2025-05-25 18:41:45 +02:00
parent e2ec9f0c84
commit 8fed598b51
2 changed files with 2 additions and 9 deletions

View file

@ -1,7 +1,5 @@
package client.world;
import java.util.Arrays;
import common.biome.Biome;
import common.block.Block;
import common.init.Blocks;
@ -18,7 +16,6 @@ public class ChunkClient extends Chunk {
}
private void clearArrays() {
Arrays.fill(this.core, null);
this.blocks.clearMap();
this.blockList.clear();
this.bottom = Integer.MAX_VALUE;

View file

@ -29,7 +29,6 @@ public abstract class Chunk {
protected final World world;
protected final State filler;
protected final Block fillerBlock;
protected final BlockArray[] core = new BlockArray[32];
protected final IntHashMap<BlockArray> blocks = new IntHashMap();
protected final Set<BlockArray> blockList = Sets.newHashSet();
protected final byte[] biomes = new byte[256];
@ -70,14 +69,11 @@ public abstract class Chunk {
}
public BlockArray getArray(int y) {
return y >= -16 && y < 16 ? this.core[y + 16] : this.blocks.lookup(y);
return this.blocks.lookup(y);
}
protected void setArray(BlockArray array) {
int y = array.getY() >> 4;
if(y >= -16 && y < 16)
this.core[y + 16] = array;
else
this.blocks.addKey(y, array);
this.blockList.add(array);
y <<= 4;