Skip to content

Commit e101ab7

Browse files
committed
Fix plot clear for new world heights
1 parent 5a25e4a commit e101ab7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/java/de/kcodeyt/plotplugin/manager/PlotManager.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,8 @@ private void finishClearPlot(Plot plot) {
905905

906906
final int xMax = vector.getFloorX() + this.levelSettings.getPlotSize();
907907
final int zMax = vector.getFloorZ() + this.levelSettings.getPlotSize();
908+
final int minY = LevelUtils.getChunkMinY(this.levelSettings.getDimension());
909+
final int maxY = LevelUtils.getChunkMaxY(this.levelSettings.getDimension());
908910

909911
TaskExecutor.executeAsync(() -> {
910912
List<BaseFullChunk> fullChunks = new ArrayList<>();
@@ -949,12 +951,12 @@ private void finishClearPlot(Plot plot) {
949951
}
950952
});
951953

952-
for(int y = 0; y <= 255; ++y) {
953-
if(y == 0)
954+
for(int y = minY; y <= maxY; ++y) {
955+
if(y == minY)
954956
fullChunk.setBlockState(floorX & 15, y, floorZ & 15, this.levelSettings.getFirstLayerState());
955-
else if(y < this.levelSettings.getGroundHeight())
957+
else if(y < minY + this.levelSettings.getGroundHeight())
956958
fullChunk.setBlockState(floorX & 15, y, floorZ & 15, this.levelSettings.getMiddleLayerState());
957-
else if(y == this.levelSettings.getGroundHeight())
959+
else if(y == minY + this.levelSettings.getGroundHeight())
958960
fullChunk.setBlockState(floorX & 15, y, floorZ & 15, this.levelSettings.getLastLayerState());
959961
else
960962
fullChunk.setBlock(floorX & 15, y, floorZ & 15, Block.AIR);

0 commit comments

Comments
 (0)