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 93160525c..33369253c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java @@ -178,7 +178,7 @@ public class HybridGen extends PlotGenerator { setBlock(x, y, z, this.filling); } setBlock(x, this.plotheight, z, this.plotfloors); - final PlotLoc loc = new PlotLoc((short) (X + x), (short) (Z + z)); + final PlotLoc loc = new PlotLoc((X + x), (Z + z)); final HashMap blocks = plotworld.G_SCH.get(loc); if (blocks != null) { for (final Entry entry : blocks.entrySet()) { @@ -216,7 +216,7 @@ public class HybridGen extends PlotGenerator { } setBlock(x, this.plotheight, z, this.plotfloors); if (this.plotworld.PLOT_SCHEMATIC) { - final PlotLoc loc = new PlotLoc((short) absX, (short) absZ); + final PlotLoc loc = new PlotLoc(absX, absZ); final HashMap blocks = this.plotworld.G_SCH.get(loc); if (blocks != null) { for (final Entry entry : blocks.entrySet()) { @@ -241,7 +241,7 @@ public class HybridGen extends PlotGenerator { } } if (this.plotworld.ROAD_SCHEMATIC_ENABLED) { - final PlotLoc loc = new PlotLoc((short) absX, (short) absZ); + final PlotLoc loc = new PlotLoc(absX, absZ); final HashMap blocks = this.plotworld.G_SCH.get(loc); if (blocks != null) { for (final Entry entry : blocks.entrySet()) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotWorld.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotWorld.java index 09d10a706..525e116e3 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotWorld.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotWorld.java @@ -143,7 +143,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { int x = item.x; int y = item.y; int z = item.z; - PlotLoc loc = new PlotLoc((short) x, (short) z); + PlotLoc loc = new PlotLoc(x, z); if (!G_SCH_STATE.containsKey(loc)) { G_SCH_STATE.put(loc, new HashSet()); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotGenerator.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotGenerator.java index 92f77c1ea..cc38daa92 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotGenerator.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotGenerator.java @@ -82,7 +82,7 @@ public abstract class PlotGenerator extends ChunkGenerator { if (biomes != null) { biomes.setBiome(x, z, biome); } - final PlotLoc loc = new PlotLoc((short) (X + x), (short) (Z + z)); + final PlotLoc loc = new PlotLoc((X + x), (Z + z)); final HashMap blocks = ChunkManager.GENERATE_BLOCKS.get(loc); for (final Entry entry : blocks.entrySet()) { setBlock(x, entry.getKey(), z, entry.getValue()); @@ -97,7 +97,13 @@ public abstract class PlotGenerator extends ChunkGenerator { for (Entry> entry : ChunkManager.GENERATE_BLOCKS.entrySet()) { for (Entry entry2 : entry.getValue().entrySet()) { loc = entry.getKey(); - setBlock(loc.x - X, entry2.getKey(), loc.z- Z, entry2.getValue()); + int xx = loc.x - X; + int zz = loc.z - Z; + if (xx >= 0 && xx < 16) { + if (zz >= 0 && zz < 16) { + setBlock(xx, entry2.getKey(), zz, entry2.getValue()); + } + } } } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotLoc.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotLoc.java index ec9a91002..a413f9358 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotLoc.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotLoc.java @@ -1,10 +1,10 @@ package com.intellectualcrafters.plot.object; public class PlotLoc { - public short x; - public short z; + public int x; + public int z; - public PlotLoc(final short x, final short z) { + public PlotLoc(final int x, final int z) { this.x = x; this.z = z; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPopulator.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPopulator.java index d5f52d744..436318eed 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPopulator.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPopulator.java @@ -42,7 +42,13 @@ public abstract class PlotPopulator extends BlockPopulator { for (Entry> entry : ChunkManager.GENERATE_DATA.entrySet()) { for (Entry entry2 : entry.getValue().entrySet()) { loc = entry.getKey(); - setBlock(loc.x - X, entry2.getKey(), loc.z - Z, entry2.getValue()); + int xx = loc.x - X; + int zz = loc.z - Z; + if (xx >= 0 && xx < 16) { + if (zz >= 0 && zz < 16) { + setBlock(xx, entry2.getKey(), zz, entry2.getValue()); + } + } } } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java index a0f3fb1ad..099339551 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java @@ -747,7 +747,7 @@ public class BukkitChunkManager extends ChunkManager { } } } - final PlotLoc loc = new PlotLoc((short) x, (short) z); + final PlotLoc loc = new PlotLoc(x, z); GENERATE_BLOCKS.put(loc, ids); GENERATE_DATA.put(loc, datas); }