mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fix some height issues
This commit is contained in:
parent
d6be5703ae
commit
e594227d95
@ -83,7 +83,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int maxY = plotArea.getPlotManager().getWorldHeight();
|
int maxY = plotArea.getPlotManager().getWorldHeight();
|
||||||
for (RegionWrapper region : plot.getRegions()) {
|
for (RegionWrapper region : plot.getRegions()) {
|
||||||
Location pos1 = new Location(plotArea.worldname, region.minX, 1, region.minZ);
|
Location pos1 = new Location(plotArea.worldname, region.minX, 1, region.minZ);
|
||||||
Location pos2 = new Location(plotArea.worldname, region.maxX, Math.min(maxY, 255), region.maxZ);
|
Location pos2 = new Location(plotArea.worldname, region.maxX, maxY, region.maxZ);
|
||||||
queue.setCuboid(pos1, pos2, blocks);
|
queue.setCuboid(pos1, pos2, blocks);
|
||||||
}
|
}
|
||||||
queue.enqueue();
|
queue.enqueue();
|
||||||
@ -100,7 +100,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int maxY = plotArea.getPlotManager().getWorldHeight();
|
int maxY = plotArea.getPlotManager().getWorldHeight();
|
||||||
for (RegionWrapper region : plot.getRegions()) {
|
for (RegionWrapper region : plot.getRegions()) {
|
||||||
Location pos1 = new Location(plotArea.worldname, region.minX, dpw.PLOT_HEIGHT + 1, region.minZ);
|
Location pos1 = new Location(plotArea.worldname, region.minX, dpw.PLOT_HEIGHT + 1, region.minZ);
|
||||||
Location pos2 = new Location(plotArea.worldname, region.maxX, Math.min(maxY, 255), region.maxZ);
|
Location pos2 = new Location(plotArea.worldname, region.maxX,maxY, region.maxZ);
|
||||||
queue.setCuboid(pos1, pos2, blocks);
|
queue.setCuboid(pos1, pos2, blocks);
|
||||||
}
|
}
|
||||||
queue.enqueue();
|
queue.enqueue();
|
||||||
@ -153,7 +153,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
if (!plot.getMerged(0)) {
|
if (!plot.getMerged(0)) {
|
||||||
int z = bottom.getZ();
|
int z = bottom.getZ();
|
||||||
for (int x = bottom.getX(); x <= top.getX(); x++) {
|
for (int x = bottom.getX(); x <= top.getX(); x++) {
|
||||||
for (int y = dpw.PLOT_HEIGHT; y <= Math.min(maxY, 255); y++) {
|
for (int y = dpw.PLOT_HEIGHT; y <= maxY; y++) {
|
||||||
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
if (!plot.getMerged(3)) {
|
if (!plot.getMerged(3)) {
|
||||||
int x = bottom.getX();
|
int x = bottom.getX();
|
||||||
for (int z = bottom.getZ(); z <= top.getZ(); z++) {
|
for (int z = bottom.getZ(); z <= top.getZ(); z++) {
|
||||||
for (int y = dpw.PLOT_HEIGHT; y <= Math.min(maxY, 255); y++) {
|
for (int y = dpw.PLOT_HEIGHT; y <= maxY; y++) {
|
||||||
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,7 +170,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
if (!plot.getMerged(2)) {
|
if (!plot.getMerged(2)) {
|
||||||
int z = top.getZ();
|
int z = top.getZ();
|
||||||
for (int x = bottom.getX(); x <= top.getX(); x++) {
|
for (int x = bottom.getX(); x <= top.getX(); x++) {
|
||||||
for (int y = dpw.PLOT_HEIGHT; y <= Math.min(maxY, 255); y++) {
|
for (int y = dpw.PLOT_HEIGHT; y <= maxY; y++) {
|
||||||
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,15 +178,15 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
if (!plot.getMerged(1)) {
|
if (!plot.getMerged(1)) {
|
||||||
int x = top.getX();
|
int x = top.getX();
|
||||||
for (int z = bottom.getZ(); z <= top.getZ(); z++) {
|
for (int z = bottom.getZ(); z <= top.getZ(); z++) {
|
||||||
for (int y = dpw.PLOT_HEIGHT; y <= Math.min(maxY, 255); y++) {
|
for (int y = dpw.PLOT_HEIGHT; y <= maxY; y++) {
|
||||||
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
queue.setBlock(x, y, z, blocks[random.random(blocks.length)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (plot.isBasePlot()) {
|
if (plot.isBasePlot()) {
|
||||||
for (RegionWrapper region : plot.getRegions()) {
|
for (RegionWrapper region : plot.getRegions()) {
|
||||||
Location pos1 = new Location(plotArea.worldname, region.minX, Math.min(maxY, 255), region.minZ);
|
Location pos1 = new Location(plotArea.worldname, region.minX, maxY, region.minZ);
|
||||||
Location pos2 = new Location(plotArea.worldname, region.maxX, Math.min(maxY, 255), region.maxZ);
|
Location pos2 = new Location(plotArea.worldname, region.maxX, maxY, region.maxZ);
|
||||||
queue.setCuboid(pos1, pos2, blocks);
|
queue.setCuboid(pos1, pos2, blocks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int maxY = plotArea.getPlotManager().getWorldHeight();
|
int maxY = plotArea.getPlotManager().getWorldHeight();
|
||||||
queue.setCuboid(
|
queue.setCuboid(
|
||||||
new Location(plotArea.worldname, sx, Math.min(dpw.WALL_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz + 1),
|
new Location(plotArea.worldname, sx, Math.min(dpw.WALL_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz + 1),
|
||||||
new Location(plotArea.worldname, ex, Math.min(maxY, 255), ez - 1), PlotBlock.get((short) 0, (byte) 0));
|
new Location(plotArea.worldname, ex, maxY, ez - 1), PlotBlock.get((short) 0, (byte) 0));
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, 0, sz + 1),
|
queue.setCuboid(new Location(plotArea.worldname, sx, 0, sz + 1),
|
||||||
new Location(plotArea.worldname, ex, 0, ez - 1), PlotBlock.get((short) 7,
|
new Location(plotArea.worldname, ex, 0, ez - 1), PlotBlock.get((short) 7,
|
||||||
(byte) 0));
|
(byte) 0));
|
||||||
@ -325,10 +325,9 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int sx = pos1.getX() - 2;
|
int sx = pos1.getX() - 2;
|
||||||
int ex = pos2.getX() + 2;
|
int ex = pos2.getX() + 2;
|
||||||
LocalBlockQueue queue = plotArea.getQueue(false);
|
LocalBlockQueue queue = plotArea.getQueue(false);
|
||||||
int maxY = plotArea.getPlotManager().getWorldHeight();
|
|
||||||
queue.setCuboid(
|
queue.setCuboid(
|
||||||
new Location(plotArea.worldname, sx + 1, Math.min(dpw.WALL_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz),
|
new Location(plotArea.worldname, sx + 1, Math.min(dpw.WALL_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz),
|
||||||
new Location(plotArea.worldname, ex - 1, Math.min(maxY, 255), ez), PlotBlock.get((short) 0, (byte) 0));
|
new Location(plotArea.worldname, ex - 1, plotArea.getPlotManager().getWorldHeight(), ez), PlotBlock.get((short) 0, (byte) 0));
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 0, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 0, sz),
|
||||||
new Location(plotArea.worldname, ex - 1, 0, ez), PlotBlock.get((short) 7, (byte) 0));
|
new Location(plotArea.worldname, ex - 1, 0, ez), PlotBlock.get((short) 7, (byte) 0));
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 1, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 1, sz),
|
||||||
@ -357,7 +356,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int ez = sz + dpw.ROAD_WIDTH - 1;
|
int ez = sz + dpw.ROAD_WIDTH - 1;
|
||||||
LocalBlockQueue queue = plotArea.getQueue(false);
|
LocalBlockQueue queue = plotArea.getQueue(false);
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx + 1, dpw.ROAD_HEIGHT + 1, sz + 1),
|
queue.setCuboid(new Location(plotArea.worldname, sx + 1, dpw.ROAD_HEIGHT + 1, sz + 1),
|
||||||
new Location(plotArea.worldname, ex - 1, 255, ez - 1), PlotBlock.get(
|
new Location(plotArea.worldname, ex - 1, dpw.getPlotManager().getWorldHeight(), ez - 1), PlotBlock.get(
|
||||||
(short) 0, (byte) 0));
|
(short) 0, (byte) 0));
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 0, sz + 1),
|
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 0, sz + 1),
|
||||||
new Location(plotArea.worldname, ex - 1, 0, ez - 1), PlotBlock.get((short) 7, (byte) 0));
|
new Location(plotArea.worldname, ex - 1, 0, ez - 1), PlotBlock.get((short) 7, (byte) 0));
|
||||||
@ -377,9 +376,8 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int sz = pos1.getZ() - 1;
|
int sz = pos1.getZ() - 1;
|
||||||
int ez = pos2.getZ() + 1;
|
int ez = pos2.getZ() + 1;
|
||||||
LocalBlockQueue queue = plotArea.getQueue(false);
|
LocalBlockQueue queue = plotArea.getQueue(false);
|
||||||
int maxY = plotArea.getPlotManager().getWorldHeight();
|
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, Math.min(dpw.PLOT_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx, Math.min(dpw.PLOT_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz),
|
||||||
new Location(plotArea.worldname, ex, Math.min(maxY, 255), ez), PlotBlock.get((short) 0, (byte) 0));
|
new Location(plotArea.worldname, ex, plotArea.getPlotManager().getWorldHeight(), ez), PlotBlock.get((short) 0, (byte) 0));
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, 1, sz + 1),
|
queue.setCuboid(new Location(plotArea.worldname, sx, 1, sz + 1),
|
||||||
new Location(plotArea.worldname, ex, dpw.PLOT_HEIGHT - 1, ez - 1), dpw.MAIN_BLOCK);
|
new Location(plotArea.worldname, ex, dpw.PLOT_HEIGHT - 1, ez - 1), dpw.MAIN_BLOCK);
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, dpw.PLOT_HEIGHT, sz + 1),
|
queue.setCuboid(new Location(plotArea.worldname, sx, dpw.PLOT_HEIGHT, sz + 1),
|
||||||
@ -398,9 +396,8 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int sx = pos1.getX() - 1;
|
int sx = pos1.getX() - 1;
|
||||||
int ex = pos2.getX() + 1;
|
int ex = pos2.getX() + 1;
|
||||||
LocalBlockQueue queue = plotArea.getQueue(false);
|
LocalBlockQueue queue = plotArea.getQueue(false);
|
||||||
int maxY = plotArea.getPlotManager().getWorldHeight();
|
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, Math.min(dpw.PLOT_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx, Math.min(dpw.PLOT_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz),
|
||||||
new Location(plotArea.worldname, ex, Math.min(maxY, 255), ez), PlotBlock.get((short) 0, (byte) 0));
|
new Location(plotArea.worldname, ex, plotArea.getPlotManager().getWorldHeight(), ez), PlotBlock.get((short) 0, (byte) 0));
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 1, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx + 1, 1, sz),
|
||||||
new Location(plotArea.worldname, ex - 1, dpw.PLOT_HEIGHT - 1, ez), dpw.MAIN_BLOCK);
|
new Location(plotArea.worldname, ex - 1, dpw.PLOT_HEIGHT - 1, ez), dpw.MAIN_BLOCK);
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx + 1, dpw.PLOT_HEIGHT, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx + 1, dpw.PLOT_HEIGHT, sz),
|
||||||
@ -419,7 +416,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
int ez = sz + dpw.ROAD_WIDTH - 1;
|
int ez = sz + dpw.ROAD_WIDTH - 1;
|
||||||
LocalBlockQueue queue = plotArea.getQueue(false);
|
LocalBlockQueue queue = plotArea.getQueue(false);
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, dpw.ROAD_HEIGHT + 1, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx, dpw.ROAD_HEIGHT + 1, sz),
|
||||||
new Location(plotArea.worldname, ex, 255, ez), PlotBlock.get((short) 0, (byte) 0));
|
new Location(plotArea.worldname, ex, plotArea.getPlotManager().getWorldHeight(), ez), PlotBlock.get((short) 0, (byte) 0));
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, 1, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx, 1, sz),
|
||||||
new Location(plotArea.worldname, ex, dpw.ROAD_HEIGHT - 1, ez), dpw.MAIN_BLOCK);
|
new Location(plotArea.worldname, ex, dpw.ROAD_HEIGHT - 1, ez), dpw.MAIN_BLOCK);
|
||||||
queue.setCuboid(new Location(plotArea.worldname, sx, dpw.ROAD_HEIGHT, sz),
|
queue.setCuboid(new Location(plotArea.worldname, sx, dpw.ROAD_HEIGHT, sz),
|
||||||
|
@ -322,15 +322,16 @@ public abstract class HybridUtils {
|
|||||||
Location bot = plot.getBottomAbs().subtract(1, 0, 1);
|
Location bot = plot.getBottomAbs().subtract(1, 0, 1);
|
||||||
Location top = plot.getTopAbs();
|
Location top = plot.getTopAbs();
|
||||||
final HybridPlotWorld plotworld = (HybridPlotWorld) plot.getArea();
|
final HybridPlotWorld plotworld = (HybridPlotWorld) plot.getArea();
|
||||||
|
PlotManager plotManager = plotworld.getPlotManager();
|
||||||
int sx = bot.getX() - plotworld.ROAD_WIDTH + 1;
|
int sx = bot.getX() - plotworld.ROAD_WIDTH + 1;
|
||||||
int sz = bot.getZ() + 1;
|
int sz = bot.getZ() + 1;
|
||||||
int sy = plotworld.ROAD_HEIGHT;
|
int sy = plotworld.ROAD_HEIGHT;
|
||||||
int ex = bot.getX();
|
int ex = bot.getX();
|
||||||
int ez = top.getZ();
|
int ez = top.getZ();
|
||||||
int ey = get_ey(queue, sx, ex, sz, ez, sy);
|
int ey = get_ey(plotManager, queue, sx, ex, sz, ez, sy);
|
||||||
int bz = sz - plotworld.ROAD_WIDTH;
|
int bz = sz - plotworld.ROAD_WIDTH;
|
||||||
int tz = sz - 1;
|
int tz = sz - 1;
|
||||||
int ty = get_ey(queue, sx, ex, bz, tz, sy);
|
int ty = get_ey(plotManager, queue, sx, ex, bz, tz, sy);
|
||||||
|
|
||||||
Set<RegionWrapper> sideRoad = new HashSet<>(Collections.singletonList(new RegionWrapper(sx, ex, sy, ey, sz, ez)));
|
Set<RegionWrapper> sideRoad = new HashSet<>(Collections.singletonList(new RegionWrapper(sx, ex, sy, ey, sz, ez)));
|
||||||
final Set<RegionWrapper> intersection = new HashSet<>(Collections.singletonList(new RegionWrapper(sx, ex, sy, ty, bz, tz)));
|
final Set<RegionWrapper> intersection = new HashSet<>(Collections.singletonList(new RegionWrapper(sx, ex, sy, ty, bz, tz)));
|
||||||
@ -354,11 +355,11 @@ public abstract class HybridUtils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int get_ey(LocalBlockQueue queue, int sx, int ex, int sz, int ez, int sy) {
|
public int get_ey(final PlotManager pm, LocalBlockQueue queue, int sx, int ex, int sz, int ez, int sy) {
|
||||||
int ey = sy;
|
int ey = sy;
|
||||||
for (int x = sx; x <= ex; x++) {
|
for (int x = sx; x <= ex; x++) {
|
||||||
for (int z = sz; z <= ez; z++) {
|
for (int z = sz; z <= ez; z++) {
|
||||||
for (int y = sy; y < 256; y++) {
|
for (int y = sy; y <= pm.getWorldHeight(); y++) {
|
||||||
if (y > ey) {
|
if (y > ey) {
|
||||||
PlotBlock block = queue.getBlock(x, y, z);
|
PlotBlock block = queue.getBlock(x, y, z);
|
||||||
if (block.id != 0) {
|
if (block.id != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user