mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Fix augmented for road size = 0
This commit is contained in:
parent
d01b506443
commit
9195c2271c
@ -98,12 +98,18 @@ public class HybridGen extends PlotGenerator {
|
||||
this.wallheight = this.plotworld.WALL_HEIGHT;
|
||||
this.roadheight = this.plotworld.ROAD_HEIGHT;
|
||||
this.plotheight = this.plotworld.PLOT_HEIGHT;
|
||||
if ((this.pathsize % 2) == 0) {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2) - 1);
|
||||
} else {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2));
|
||||
if (this.pathsize == 0) {
|
||||
this.pathWidthLower = (short) -1;
|
||||
this.pathWidthUpper = (short) (this.plotsize + 1);
|
||||
}
|
||||
else {
|
||||
if ((this.pathsize % 2) == 0) {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2) - 1);
|
||||
} else {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2));
|
||||
}
|
||||
this.pathWidthUpper = (short) (this.pathWidthLower + this.plotsize + 1);
|
||||
}
|
||||
this.pathWidthUpper = (short) (this.pathWidthLower + this.plotsize + 1);
|
||||
this.biome = Biome.valueOf(this.plotworld.PLOT_BIOME);
|
||||
try {
|
||||
this.maxY = Bukkit.getWorld(plotworld.worldname).getMaxHeight();
|
||||
@ -224,7 +230,7 @@ public class HybridGen extends PlotGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (pathsize != 0) {
|
||||
// wall
|
||||
if (((absX >= this.pathWidthLower) && (absX <= this.pathWidthUpper) && (absZ >= this.pathWidthLower) && (absZ <= this.pathWidthUpper))) {
|
||||
for (short y = 1; y <= this.wallheight; y++) {
|
||||
|
@ -78,12 +78,18 @@ public class HybridPop extends PlotPopulator {
|
||||
this.wallheight = this.plotworld.WALL_HEIGHT;
|
||||
this.roadheight = this.plotworld.ROAD_HEIGHT;
|
||||
this.plotheight = this.plotworld.PLOT_HEIGHT;
|
||||
if ((this.pathsize % 2) == 0) {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2) - 1);
|
||||
} else {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2));
|
||||
if (this.pathsize == 0) {
|
||||
this.pathWidthLower = (short) -1;
|
||||
this.pathWidthUpper = (short) (this.plotsize + 1);
|
||||
}
|
||||
else {
|
||||
if ((this.pathsize % 2) == 0) {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2) - 1);
|
||||
} else {
|
||||
this.pathWidthLower = (short) (Math.floor(this.pathsize / 2));
|
||||
}
|
||||
this.pathWidthUpper = (short) (this.pathWidthLower + this.plotsize + 1);
|
||||
}
|
||||
this.pathWidthUpper = (short) (this.pathWidthLower + this.plotsize + 1);
|
||||
}
|
||||
|
||||
public final long nextLong() {
|
||||
@ -192,7 +198,7 @@ public class HybridPop extends PlotPopulator {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (pathsize != 0) {
|
||||
// wall
|
||||
if (((absX >= this.pathWidthLower) && (absX <= this.pathWidthUpper) && (absZ >= this.pathWidthLower) && (absZ <= this.pathWidthUpper))) {
|
||||
for (short y = 1; y <= this.wallheight; y++) {
|
||||
|
@ -35,10 +35,15 @@ public abstract class SquarePlotManager extends GridPlotManager {
|
||||
public PlotId getPlotIdAbs(final PlotWorld plotworld, int x, final int y, int z) {
|
||||
final SquarePlotWorld dpw = ((SquarePlotWorld) plotworld);
|
||||
int pathWidthLower;
|
||||
if ((dpw.ROAD_WIDTH % 2) == 0) {
|
||||
pathWidthLower = (dpw.ROAD_WIDTH / 2) - 1;
|
||||
} else {
|
||||
pathWidthLower = dpw.ROAD_WIDTH / 2;
|
||||
if (dpw.ROAD_WIDTH == 0) {
|
||||
pathWidthLower = -1;
|
||||
}
|
||||
else {
|
||||
if ((dpw.ROAD_WIDTH % 2) == 0) {
|
||||
pathWidthLower = (dpw.ROAD_WIDTH / 2) - 1;
|
||||
} else {
|
||||
pathWidthLower = dpw.ROAD_WIDTH / 2;
|
||||
}
|
||||
}
|
||||
final int size = dpw.PLOT_WIDTH + dpw.ROAD_WIDTH;
|
||||
int idx;
|
||||
|
Loading…
Reference in New Issue
Block a user