Address inclusivity issues for max world height

This commit is contained in:
dordsor21 2022-02-07 00:02:27 +00:00 committed by Jordan
parent f45fb8fd6f
commit e45b2ba288
6 changed files with 7 additions and 7 deletions

View File

@ -67,7 +67,7 @@ final class BlockStatePopulator extends BlockPopulator {
final ChunkWrapper wrap = new ChunkWrapper(area.getWorldName(), source.getX(), source.getZ());
final ScopedQueueCoordinator chunk = this.queue.getForChunk(wrap.x, wrap.z,
com.plotsquared.bukkit.util.BukkitWorld.getMinWorldHeight(world),
com.plotsquared.bukkit.util.BukkitWorld.getMaxWorldHeight(world)
com.plotsquared.bukkit.util.BukkitWorld.getMaxWorldHeight(world) - 1
);
if (this.plotGenerator.populateChunk(chunk, area)) {
this.queue.enqueue();

View File

@ -134,7 +134,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
int sx = blockVector2.getX() << 4;
int sz = blockVector2.getZ() << 4;
if (isRegenChunk) {
for (int layer = (getWorld().getMinY() >> 4); layer < (getWorld().getMaxY() >> 4); layer++) {
for (int layer = (getWorld().getMinY() >> 4); layer <= (getWorld().getMaxY() >> 4); layer++) {
for (int y = 0; y < 16; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {

View File

@ -172,7 +172,7 @@ public class GenChunk extends ScopedQueueCoordinator {
*/
public boolean setBiome(int x, int z, @NonNull Biome biome) {
if (this.biomeGrid != null) {
for (int y = getMin().getY(); y < getMax().getY(); y++) {
for (int y = getMin().getY(); y <= getMax().getY(); y++) {
this.setBiome(x, y, z, biome);
}
return true;

View File

@ -120,7 +120,7 @@ public class BukkitWorld implements World<org.bukkit.World> {
@Override
public int getMaxHeight() {
return getMaxWorldHeight(world);
return getMaxWorldHeight(world) - 1;
}
@Override

View File

@ -135,7 +135,7 @@ public class ContentMap {
}
private void saveBlocks(BukkitWorld world, int x, int z, int offsetX, int offsetZ) {
BaseBlock[] ids = new BaseBlock[world.getMaxY() - world.getMinY()];
BaseBlock[] ids = new BaseBlock[world.getMaxY() - world.getMinY() + 1];
for (short yIndex = 0; yIndex <= world.getMaxY() - world.getMinY(); yIndex++) {
BaseBlock block = world.getFullBlock(BlockVector3.at(x, yIndex + world.getMinY(), z));
ids[yIndex] = block;

View File

@ -215,8 +215,8 @@ public class HybridUtils {
int xx = chunkBlockX + x;
for (int z = minZ; z <= maxZ; z++) {
int zz = chunkBlockZ + z;
for (int yIndex = 0; yIndex < minHeight; yIndex++) {
int y = yIndex - minHeight;
for (int yIndex = 0; yIndex < height; yIndex++) {
int y = yIndex + minHeight;
BlockState block = queue.getBlock(xx, y, zz);
int xr = xb + x;
int zr = zb + z;