diff --git a/src/main/java/com/plotsquared/sponge/generator/SpongeBasicPop.java b/src/main/java/com/plotsquared/sponge/generator/SpongeBasicPop.java index 66d2585f3..b26326e55 100644 --- a/src/main/java/com/plotsquared/sponge/generator/SpongeBasicPop.java +++ b/src/main/java/com/plotsquared/sponge/generator/SpongeBasicPop.java @@ -29,7 +29,6 @@ public class SpongeBasicPop extends SpongePlotPopulator { if (sz < 0) { sz += generator.size; } - for (short x = 0; x < 16; x++) { for (short z = 0; z < 16; z++) { final int absX = ((sx + x) % generator.size); @@ -44,14 +43,26 @@ public class SpongeBasicPop extends SpongePlotPopulator { setBlock(x, y, z, generator.filling); } setBlock(x, (short) generator.plotheight, z, generator.plotfloors); + if (generator.plotworld.TYPE != 0 && generator.plotworld.TERRAIN < 2) { + for (int y = generator.plotheight + 1; y < 128; y++) { + setBlock(x, y, z, generator.AIR); + } + } if (generator.plotworld.PLOT_SCHEMATIC) { final PlotLoc loc = new PlotLoc(absX, absZ); final HashMap blocks = generator.plotworld.G_SCH.get(loc); if (blocks != null) { final HashMap datas = generator.plotworld.G_SCH_DATA.get(loc); - for (final short y : blocks.keySet()) { - Byte data = datas.get(y); - setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(new PlotBlock(blocks.get(y), data == null ? 0 : data))); + if (datas != null) { + for (final short y : blocks.keySet()) { + Byte data = datas.get(y); + setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(new PlotBlock(blocks.get(y), data == null ? 0 : data))); + } + } + else { + for (final short y : blocks.keySet()) { + setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(blocks.get(y))); + } } } if (generator.plotworld.G_SCH_STATE != null) { @@ -71,6 +82,11 @@ public class SpongeBasicPop extends SpongePlotPopulator { for (short y = 1; y <= generator.wallheight; y++) { setBlock(x, y, z, generator.wallfilling); } + if (generator.plotworld.TYPE != 0 && generator.plotworld.TERRAIN < 3) { + for (int y = generator.wallheight + 2; y < 128; y++) { + setBlock(x, y, z, generator.AIR); + } + } if (!generator.plotworld.ROAD_SCHEMATIC_ENABLED) { setBlock(x, generator.wallheight + 1, z, generator.wall); } @@ -80,15 +96,27 @@ public class SpongeBasicPop extends SpongePlotPopulator { for (short y = 1; y <= generator.roadheight; y++) { setBlock(x, y, z, generator.roadblock); } + if (generator.plotworld.TYPE != 0 && generator.plotworld.TERRAIN < 3) { + for (int y = generator.roadheight + 1; y < 128; y++) { + setBlock(x, y, z, generator.AIR); + } + } } if (generator.plotworld.ROAD_SCHEMATIC_ENABLED) { final PlotLoc loc = new PlotLoc(absX, absZ); final HashMap blocks = generator.plotworld.G_SCH.get(loc); if (blocks != null) { final HashMap datas = generator.plotworld.G_SCH_DATA.get(loc); - for (final short y : blocks.keySet()) { - Byte data = datas.get(y); - setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(new PlotBlock(blocks.get(y), data == null ? 0 : data))); + if (datas != null) { + for (final short y : blocks.keySet()) { + Byte data = datas.get(y); + setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(new PlotBlock(blocks.get(y), data == null ? 0 : data))); + } + } + else { + for (final short y : blocks.keySet()) { + setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(blocks.get(y))); + } } } }