Skip to content

Commit

Permalink
fix: fix a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Jun 22, 2024
1 parent 0784521 commit 11ecd76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public BlockState getBlockState(int x, int y, int z, int layer) {
private BlockState getBlockStateInOtherChunk(int x, int y, int z, int layer) {
var chunk = chunkAccessor.getChunk(x >> 4, z >> 4);
if (chunk == null) return AIR;
return chunk.getBlockState(x & 15, y, z & 15);
return chunk.getBlockState(x & 15, y, z & 15, layer);
}

private boolean isInCurrentChunk(int x, int y, int z) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ private void processPopulationQueue(GameLoop loop) {
}

private boolean tryEnterPopulationStage(int x, int z) {
// 相邻区块噪声都已生成或已载入世界
// 且本区块以及相邻区块都没锁
// 要求本区块和相邻区块噪声都已生成或已载入世界且没有锁
for (int i = -1; i <= 1; i++) {
for (int j = -1; j <= 1; j++) {
var chunkHash = HashUtils.hashXZ(x + i, z + j);
Expand All @@ -153,10 +152,12 @@ private boolean tryEnterPopulationStage(int x, int z) {
if (noiseFuture == null) {
// 区块噪声未生成
if (dimension.getChunkService().getChunk(chunkHash) == null) {
// 区块不是已加载状态
getOrCreateNoiseFuture(x + i, z + j);
return false;
}
} else if (!noiseFuture.isDone()) {
// 区块噪声没有生成完毕
return false;
}
}
Expand Down

0 comments on commit 11ecd76

Please sign in to comment.