diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java index 10a6b5991..26154df34 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java @@ -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(); @@ -129,7 +135,7 @@ public class HybridGen extends PlotGenerator { */ public PlotWorld getNewPlotWorld(final String world) { if (this.plotworld == null) { - this.plotworld = new HybridPlotWorld(world); + this.plotworld = new HybridPlotWorld(world); } return this.plotworld; } @@ -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++) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPop.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPop.java index f0e056e6d..677d4b099 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPop.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPop.java @@ -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++) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/SquarePlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/SquarePlotManager.java index 7a6ffbc03..71eca688d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/SquarePlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/SquarePlotManager.java @@ -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;