Skip to content

Commit

Permalink
Remove old code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 22, 2024
1 parent 3ad27d8 commit 9429d3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,9 @@ public class ChunkData {
private final LevelHeightAccessor levelHeightAccessor;
private final ChunkSection[] sections;

public ChunkData(LevelHeightAccessor levelHeightAccessor, boolean fillEmpty) {
public ChunkData(LevelHeightAccessor levelHeightAccessor) {
this.levelHeightAccessor = levelHeightAccessor;
this.sections = new ChunkSection[levelHeightAccessor.getSectionsCount()];
if (fillEmpty) {
fillEmpty();
}
}

public static int log2RoundUp(int num) {
return (int) Math.ceil(Math.log(num) / Math.log(2));
}

public void fillEmpty() {
for (var i = 0; i < sections.length; i++) {
setSection(i, new ChunkSection());
}
}

public int getBlock(int x, int y, int z) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public ChunkData getOrCreateChunkSection(int sectionX, int sectionZ) {
TimeUtil.lockYielding(writeLock);
try {
return chunks.computeIfAbsent(
ChunkKey.calculateKey(sectionX, sectionZ), (key) -> new ChunkData(levelHeightAccessor, false));
ChunkKey.calculateKey(sectionX, sectionZ), (key) -> new ChunkData(levelHeightAccessor));
} finally {
writeLock.unlock();
}
Expand Down

0 comments on commit 9429d3c

Please sign in to comment.