From 8fed598b5140844cfe925c2f6f94827d39311ee7 Mon Sep 17 00:00:00 2001 From: Sen Date: Sun, 25 May 2025 18:41:45 +0200 Subject: [PATCH] Revert "test chunk array perf" This reverts commit e2ec9f0c84cf2f04982b3dfcf087845c8c203a9d. --- client/src/client/world/ChunkClient.java | 3 --- common/src/common/world/Chunk.java | 8 ++------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/client/src/client/world/ChunkClient.java b/client/src/client/world/ChunkClient.java index 29bae3e..8f59b89 100644 --- a/client/src/client/world/ChunkClient.java +++ b/client/src/client/world/ChunkClient.java @@ -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; diff --git a/common/src/common/world/Chunk.java b/common/src/common/world/Chunk.java index dc95a7d..c70a379 100755 --- a/common/src/common/world/Chunk.java +++ b/common/src/common/world/Chunk.java @@ -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 blocks = new IntHashMap(); protected final Set blockList = Sets.newHashSet(); protected final byte[] biomes = new byte[256]; @@ -70,15 +69,12 @@ 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.blocks.addKey(y, array); this.blockList.add(array); y <<= 4; this.bottom = y < this.bottom ? y : this.bottom;