Skip to content

Commit

Permalink
chores: rewrite min/maxChunkX/Z() methods in PopulationStageChunkAcce…
Browse files Browse the repository at this point in the history
…ssor
  • Loading branch information
smartcmd committed Jun 22, 2024
1 parent 11ecd76 commit ab84e61
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import org.allaymc.api.utils.HashUtils;

import java.util.concurrent.CompletableFuture;

/**
* Allay Project 2023/7/1
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,26 @@ private boolean isInRange(int x, int z) {
// 只能访问相邻的区块
return Math.abs(x - currentChunk.getX()) <= 1 && Math.abs(z - currentChunk.getZ()) <= 1;
}

@Override
public int minChunkZ() {
return currentChunk.getZ() - 1;
}

@Override
public int minChunkX() {
return currentChunk.getX() - 1;
}

@Override
public int maxChunkZ() {
return currentChunk.getZ() + 1;
}

@Override
public int maxChunkX() {
return currentChunk.getX() + 1;
}
}

protected static final class AllayWorldGeneratorBuilder implements WorldGenerator.WorldGeneratorBuilder {
Expand Down

0 comments on commit ab84e61

Please sign in to comment.