mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 21:56:45 +01:00
Start generation at min gen height if bedrock is disabled
This commit is contained in:
parent
0e4c87fb8f
commit
be417ae954
@ -122,6 +122,7 @@ public class AugmentedUtils {
|
|||||||
}
|
}
|
||||||
QueueCoordinator secondaryMask;
|
QueueCoordinator secondaryMask;
|
||||||
BlockState air = BlockTypes.AIR.getDefaultState();
|
BlockState air = BlockTypes.AIR.getDefaultState();
|
||||||
|
int startYOffset = !(area instanceof ClassicPlotWorld) || ((ClassicPlotWorld) area).PLOT_BEDROCK ? 1 : 0;
|
||||||
if (area.getTerrain() == PlotAreaTerrainType.ROAD) {
|
if (area.getTerrain() == PlotAreaTerrainType.ROAD) {
|
||||||
PlotManager manager = area.getPlotManager();
|
PlotManager manager = area.getPlotManager();
|
||||||
final boolean[][] canPlace = new boolean[16][16];
|
final boolean[][] canPlace = new boolean[16][16];
|
||||||
@ -132,7 +133,7 @@ public class AugmentedUtils {
|
|||||||
int worldZ = z + blockZ;
|
int worldZ = z + blockZ;
|
||||||
boolean can = manager.getPlotId(worldX, 0, worldZ) == null;
|
boolean can = manager.getPlotId(worldX, 0, worldZ) == null;
|
||||||
if (can) {
|
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);
|
queue.setBlock(worldX, y, worldZ, air);
|
||||||
}
|
}
|
||||||
canPlace[x][z] = true;
|
canPlace[x][z] = true;
|
||||||
@ -149,7 +150,7 @@ public class AugmentedUtils {
|
|||||||
secondaryMask = primaryMask;
|
secondaryMask = primaryMask;
|
||||||
for (int x = relativeBottomX; x <= relativeTopX; x++) {
|
for (int x = relativeBottomX; x <= relativeTopX; x++) {
|
||||||
for (int z = relativeBottomZ; z <= relativeTopZ; z++) {
|
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);
|
queue.setBlock(blockX + x, y, blockZ + z, air);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
classicPlotWorld,
|
classicPlotWorld,
|
||||||
plot.getRegions(),
|
plot.getRegions(),
|
||||||
blocks,
|
blocks,
|
||||||
classicPlotWorld.getMinGenHeight() + 1,
|
classicPlotWorld.getMinGenHeight() + (classicPlotWorld.PLOT_BEDROCK ? 1 : 0),
|
||||||
classicPlotWorld.getMaxGenHeight(),
|
classicPlotWorld.getMaxGenHeight(),
|
||||||
actor,
|
actor,
|
||||||
queue
|
queue
|
||||||
@ -211,7 +211,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
classicPlotWorld,
|
classicPlotWorld,
|
||||||
plot.getRegions(),
|
plot.getRegions(),
|
||||||
blocks,
|
blocks,
|
||||||
classicPlotWorld.getMinGenHeight() + 1,
|
classicPlotWorld.getMinGenHeight() + (classicPlotWorld.PLOT_BEDROCK ? 1 : 0),
|
||||||
classicPlotWorld.PLOT_HEIGHT - 1,
|
classicPlotWorld.PLOT_HEIGHT - 1,
|
||||||
actor,
|
actor,
|
||||||
queue
|
queue
|
||||||
@ -386,10 +386,11 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int startYOffset = classicPlotWorld.PLOT_BEDROCK ? 1 : 0;
|
||||||
if (!plot.isMerged(Direction.NORTH)) {
|
if (!plot.isMerged(Direction.NORTH)) {
|
||||||
int z = bot.getZ();
|
int z = bot.getZ();
|
||||||
for (int x = bot.getX(); x < top.getX(); x++) {
|
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);
|
queue.setBlock(x, y, z, blocks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -397,7 +398,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
if (!plot.isMerged(Direction.WEST)) {
|
if (!plot.isMerged(Direction.WEST)) {
|
||||||
int x = bot.getX();
|
int x = bot.getX();
|
||||||
for (int z = bot.getZ(); z < top.getZ(); z++) {
|
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);
|
queue.setBlock(x, y, z, blocks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -405,7 +406,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
if (!plot.isMerged(Direction.SOUTH)) {
|
if (!plot.isMerged(Direction.SOUTH)) {
|
||||||
int z = top.getZ();
|
int z = top.getZ();
|
||||||
for (int x = bot.getX(); x < top.getX() + (plot.isMerged(Direction.EAST) ? 0 : 1); x++) {
|
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);
|
queue.setBlock(x, y, z, blocks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -413,7 +414,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
if (!plot.isMerged(Direction.EAST)) {
|
if (!plot.isMerged(Direction.EAST)) {
|
||||||
int x = top.getX();
|
int x = top.getX();
|
||||||
for (int z = bot.getZ(); z < top.getZ() + (plot.isMerged(Direction.SOUTH) ? 0 : 1); z++) {
|
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);
|
queue.setBlock(x, y, z, blocks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ public class HybridPlotManager extends ClassicPlotManager {
|
|||||||
queue.setCuboid(
|
queue.setCuboid(
|
||||||
pos1.withY(hybridPlotWorld.getMinGenHeight()),
|
pos1.withY(hybridPlotWorld.getMinGenHeight()),
|
||||||
pos2.withY(hybridPlotWorld.getMinGenHeight()),
|
pos2.withY(hybridPlotWorld.getMinGenHeight()),
|
||||||
bedrock
|
hybridPlotWorld.PLOT_BEDROCK ? bedrock : filling
|
||||||
);
|
);
|
||||||
// Each component has a different layer
|
// Each component has a different layer
|
||||||
queue.setCuboid(
|
queue.setCuboid(
|
||||||
|
Loading…
Reference in New Issue
Block a user