Start generation at min gen height if bedrock is disabled

This commit is contained in:
dordsor21 2022-02-09 14:00:15 +00:00 committed by Jordan
parent 0e4c87fb8f
commit be417ae954
3 changed files with 11 additions and 9 deletions

View File

@ -122,6 +122,7 @@ public class AugmentedUtils {
}
QueueCoordinator secondaryMask;
BlockState air = BlockTypes.AIR.getDefaultState();
int startYOffset = !(area instanceof ClassicPlotWorld) || ((ClassicPlotWorld) area).PLOT_BEDROCK ? 1 : 0;
if (area.getTerrain() == PlotAreaTerrainType.ROAD) {
PlotManager manager = area.getPlotManager();
final boolean[][] canPlace = new boolean[16][16];
@ -132,7 +133,7 @@ public class AugmentedUtils {
int worldZ = z + blockZ;
boolean can = manager.getPlotId(worldX, 0, worldZ) == null;
if (can) {
for (int y = area.getMinGenHeight() + 1; y <= area.getMaxGenHeight(); y++) {
for (int y = area.getMinGenHeight() + startYOffset; y <= area.getMaxGenHeight(); y++) {
queue.setBlock(worldX, y, worldZ, air);
}
canPlace[x][z] = true;
@ -149,7 +150,7 @@ public class AugmentedUtils {
secondaryMask = primaryMask;
for (int x = relativeBottomX; x <= relativeTopX; x++) {
for (int z = relativeBottomZ; z <= relativeTopZ; z++) {
for (int y = area.getMinGenHeight() + 1; y <= area.getMaxGenHeight(); y++) {
for (int y = area.getMinGenHeight() + startYOffset; y <= area.getMaxGenHeight(); y++) {
queue.setBlock(blockX + x, y, blockZ + z, air);
}
}

View File

@ -150,7 +150,7 @@ public class ClassicPlotManager extends SquarePlotManager {
classicPlotWorld,
plot.getRegions(),
blocks,
classicPlotWorld.getMinGenHeight() + 1,
classicPlotWorld.getMinGenHeight() + (classicPlotWorld.PLOT_BEDROCK ? 1 : 0),
classicPlotWorld.getMaxGenHeight(),
actor,
queue
@ -211,7 +211,7 @@ public class ClassicPlotManager extends SquarePlotManager {
classicPlotWorld,
plot.getRegions(),
blocks,
classicPlotWorld.getMinGenHeight() + 1,
classicPlotWorld.getMinGenHeight() + (classicPlotWorld.PLOT_BEDROCK ? 1 : 0),
classicPlotWorld.PLOT_HEIGHT - 1,
actor,
queue
@ -386,10 +386,11 @@ public class ClassicPlotManager extends SquarePlotManager {
}
}
int startYOffset = classicPlotWorld.PLOT_BEDROCK ? 1 : 0;
if (!plot.isMerged(Direction.NORTH)) {
int z = bot.getZ();
for (int x = bot.getX(); x < top.getX(); x++) {
for (int y = classicPlotWorld.getMinGenHeight() + 1; y <= classicPlotWorld.WALL_HEIGHT; y++) {
for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) {
queue.setBlock(x, y, z, blocks);
}
}
@ -397,7 +398,7 @@ public class ClassicPlotManager extends SquarePlotManager {
if (!plot.isMerged(Direction.WEST)) {
int x = bot.getX();
for (int z = bot.getZ(); z < top.getZ(); z++) {
for (int y = classicPlotWorld.getMinGenHeight() + 1; y <= classicPlotWorld.WALL_HEIGHT; y++) {
for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) {
queue.setBlock(x, y, z, blocks);
}
}
@ -405,7 +406,7 @@ public class ClassicPlotManager extends SquarePlotManager {
if (!plot.isMerged(Direction.SOUTH)) {
int z = top.getZ();
for (int x = bot.getX(); x < top.getX() + (plot.isMerged(Direction.EAST) ? 0 : 1); x++) {
for (int y = classicPlotWorld.getMinGenHeight() + 1; y <= classicPlotWorld.WALL_HEIGHT; y++) {
for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) {
queue.setBlock(x, y, z, blocks);
}
}
@ -413,7 +414,7 @@ public class ClassicPlotManager extends SquarePlotManager {
if (!plot.isMerged(Direction.EAST)) {
int x = top.getX();
for (int z = bot.getZ(); z < top.getZ() + (plot.isMerged(Direction.SOUTH) ? 0 : 1); z++) {
for (int y = classicPlotWorld.getMinGenHeight() + 1; y <= classicPlotWorld.WALL_HEIGHT; y++) {
for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) {
queue.setBlock(x, y, z, blocks);
}
}

View File

@ -283,7 +283,7 @@ public class HybridPlotManager extends ClassicPlotManager {
queue.setCuboid(
pos1.withY(hybridPlotWorld.getMinGenHeight()),
pos2.withY(hybridPlotWorld.getMinGenHeight()),
bedrock
hybridPlotWorld.PLOT_BEDROCK ? bedrock : filling
);
// Each component has a different layer
queue.setCuboid(