This commit is contained in:
boy0001 2015-08-03 05:25:47 +10:00
parent 4d8b9f9674
commit 0b1dbea985

View File

@ -29,7 +29,6 @@ public class SpongeBasicPop extends SpongePlotPopulator<SpongeBasicGen> {
if (sz < 0) { if (sz < 0) {
sz += generator.size; sz += generator.size;
} }
for (short x = 0; x < 16; x++) { for (short x = 0; x < 16; x++) {
for (short z = 0; z < 16; z++) { for (short z = 0; z < 16; z++) {
final int absX = ((sx + x) % generator.size); final int absX = ((sx + x) % generator.size);
@ -44,16 +43,28 @@ public class SpongeBasicPop extends SpongePlotPopulator<SpongeBasicGen> {
setBlock(x, y, z, generator.filling); setBlock(x, y, z, generator.filling);
} }
setBlock(x, (short) generator.plotheight, z, generator.plotfloors); 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) { if (generator.plotworld.PLOT_SCHEMATIC) {
final PlotLoc loc = new PlotLoc(absX, absZ); final PlotLoc loc = new PlotLoc(absX, absZ);
final HashMap<Short, Short> blocks = generator.plotworld.G_SCH.get(loc); final HashMap<Short, Short> blocks = generator.plotworld.G_SCH.get(loc);
if (blocks != null) { if (blocks != null) {
final HashMap<Short, Byte> datas = generator.plotworld.G_SCH_DATA.get(loc); final HashMap<Short, Byte> datas = generator.plotworld.G_SCH_DATA.get(loc);
if (datas != null) {
for (final short y : blocks.keySet()) { for (final short y : blocks.keySet()) {
Byte data = datas.get(y); Byte data = datas.get(y);
setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(new PlotBlock(blocks.get(y), data == null ? 0 : data))); 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) { if (generator.plotworld.G_SCH_STATE != null) {
HashSet<PlotItem> states = generator.plotworld.G_SCH_STATE.get(loc); HashSet<PlotItem> states = generator.plotworld.G_SCH_STATE.get(loc);
if (states != null) { if (states != null) {
@ -71,6 +82,11 @@ public class SpongeBasicPop extends SpongePlotPopulator<SpongeBasicGen> {
for (short y = 1; y <= generator.wallheight; y++) { for (short y = 1; y <= generator.wallheight; y++) {
setBlock(x, y, z, generator.wallfilling); 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) { if (!generator.plotworld.ROAD_SCHEMATIC_ENABLED) {
setBlock(x, generator.wallheight + 1, z, generator.wall); setBlock(x, generator.wallheight + 1, z, generator.wall);
} }
@ -80,17 +96,29 @@ public class SpongeBasicPop extends SpongePlotPopulator<SpongeBasicGen> {
for (short y = 1; y <= generator.roadheight; y++) { for (short y = 1; y <= generator.roadheight; y++) {
setBlock(x, y, z, generator.roadblock); 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) { if (generator.plotworld.ROAD_SCHEMATIC_ENABLED) {
final PlotLoc loc = new PlotLoc(absX, absZ); final PlotLoc loc = new PlotLoc(absX, absZ);
final HashMap<Short, Short> blocks = generator.plotworld.G_SCH.get(loc); final HashMap<Short, Short> blocks = generator.plotworld.G_SCH.get(loc);
if (blocks != null) { if (blocks != null) {
final HashMap<Short, Byte> datas = generator.plotworld.G_SCH_DATA.get(loc); final HashMap<Short, Byte> datas = generator.plotworld.G_SCH_DATA.get(loc);
if (datas != null) {
for (final short y : blocks.keySet()) { for (final short y : blocks.keySet()) {
Byte data = datas.get(y); Byte data = datas.get(y);
setBlock(x, (short) (generator.plotheight + y), z, SpongeMain.THIS.getBlockState(new PlotBlock(blocks.get(y), data == null ? 0 : data))); 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)));
}
}
}
} }
} }
} }