mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Split road and plot paste-on-top settings
This commit is contained in:
parent
5b260ea8da
commit
2fb76e6636
@ -388,6 +388,9 @@ public class Settings extends Config {
|
||||
@Comment(
|
||||
"Whether schematic based generation should paste schematic on top of plots, or from Y=1")
|
||||
public static boolean PASTE_ON_TOP = true;
|
||||
@Comment(
|
||||
"Whether schematic based road generation should paste schematic on top of roads, or from Y=1")
|
||||
public static boolean PASTE_ROAD_ON_TOP = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,7 +47,8 @@ public class HybridGen extends IndependentPlotGenerator {
|
||||
private void placeSchem(HybridPlotWorld world, ScopedLocalBlockQueue result, short relativeX,
|
||||
short relativeZ, int x, int z, boolean isRoad) {
|
||||
int minY; // Math.min(world.PLOT_HEIGHT, world.ROAD_HEIGHT);
|
||||
if (isRoad || Settings.Schematics.PASTE_ON_TOP) {
|
||||
if ((isRoad && Settings.Schematics.PASTE_ROAD_ON_TOP) || (!isRoad
|
||||
&& Settings.Schematics.PASTE_ON_TOP)) {
|
||||
minY = world.SCHEM_Y;
|
||||
} else {
|
||||
minY = 1;
|
||||
|
@ -112,15 +112,17 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
return true;
|
||||
}
|
||||
LocalBlockQueue queue = hybridPlotWorld.getQueue(false);
|
||||
createSchemAbs(queue, pos1, pos2);
|
||||
createSchemAbs(queue, pos1, pos2, true);
|
||||
queue.enqueue();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void createSchemAbs(LocalBlockQueue queue, Location pos1, Location pos2) {
|
||||
private void createSchemAbs(LocalBlockQueue queue, Location pos1, Location pos2,
|
||||
boolean isRoad) {
|
||||
int size = hybridPlotWorld.SIZE;
|
||||
int minY;
|
||||
if (Settings.Schematics.PASTE_ON_TOP) {
|
||||
if ((isRoad && Settings.Schematics.PASTE_ROAD_ON_TOP) || (!isRoad
|
||||
&& Settings.Schematics.PASTE_ON_TOP)) {
|
||||
minY = hybridPlotWorld.SCHEM_Y;
|
||||
} else {
|
||||
minY = 1;
|
||||
@ -172,7 +174,7 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
return true;
|
||||
}
|
||||
LocalBlockQueue queue = hybridPlotWorld.getQueue(false);
|
||||
createSchemAbs(queue, pos1, pos2);
|
||||
createSchemAbs(queue, pos1, pos2, true);
|
||||
queue.enqueue();
|
||||
return true;
|
||||
}
|
||||
@ -186,9 +188,9 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
pos1.setY(0);
|
||||
pos2.setY(Math.min(getWorldHeight(), 255));
|
||||
LocalBlockQueue queue = hybridPlotWorld.getQueue(false);
|
||||
createSchemAbs(queue, pos1, pos2);
|
||||
createSchemAbs(queue, pos1, pos2, true);
|
||||
if (hybridPlotWorld.ROAD_SCHEMATIC_ENABLED) {
|
||||
createSchemAbs(queue, pos1, pos2);
|
||||
createSchemAbs(queue, pos1, pos2, true);
|
||||
}
|
||||
return queue.enqueue();
|
||||
}
|
||||
@ -267,7 +269,7 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
if (!hybridPlotWorld.PLOT_SCHEMATIC) {
|
||||
return;
|
||||
}
|
||||
createSchemAbs(queue, bottom, top);
|
||||
createSchemAbs(queue, bottom, top, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,6 +83,11 @@ public abstract class HybridUtils {
|
||||
public static PlotArea area;
|
||||
public static boolean UPDATE = false;
|
||||
|
||||
public static boolean regeneratePlotWalls(final PlotArea area) {
|
||||
PlotManager plotManager = area.getPlotManager();
|
||||
return plotManager.regenerateAllPlotWalls();
|
||||
}
|
||||
|
||||
public void analyzeRegion(final String world, final CuboidRegion region,
|
||||
final RunnableVal<PlotAnalysis> whenDone) {
|
||||
// int diff, int variety, int vertices, int rotation, int height_sd
|
||||
@ -501,7 +506,7 @@ public abstract class HybridUtils {
|
||||
PlotManager plotManager = plotworld.getPlotManager();
|
||||
int sx = bot.getX() - plotworld.ROAD_WIDTH + 1;
|
||||
int sz = bot.getZ() + 1;
|
||||
int sy = plotworld.ROAD_HEIGHT;
|
||||
int sy = Settings.Schematics.PASTE_ROAD_ON_TOP ? plotworld.ROAD_HEIGHT : 1;
|
||||
int ex = bot.getX();
|
||||
int ez = top.getZ();
|
||||
int ey = get_ey(plotManager, queue, sx, ex, sz, ez, sy);
|
||||
@ -621,7 +626,7 @@ public abstract class HybridUtils {
|
||||
}
|
||||
if (condition) {
|
||||
BaseBlock[] blocks = plotWorld.G_SCH.get(MathMan.pair(absX, absZ));
|
||||
int minY = plotWorld.SCHEM_Y;
|
||||
int minY = Settings.Schematics.PASTE_ROAD_ON_TOP ? plotWorld.SCHEM_Y : 1;
|
||||
int maxY = Math.max(extend, blocks.length);
|
||||
for (int y = 0; y < maxY; y++) {
|
||||
if (y > blocks.length - 1) {
|
||||
@ -656,9 +661,4 @@ public abstract class HybridUtils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean regeneratePlotWalls(final PlotArea area) {
|
||||
PlotManager plotManager = area.getPlotManager();
|
||||
return plotManager.regenerateAllPlotWalls();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user