This commit is contained in:
Jesse Boyd 2018-01-10 19:53:02 +11:00
parent a1ccdf0543
commit b36c3dfc90
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 7 additions and 9 deletions

View File

@ -582,7 +582,7 @@ public class CFICommands extends MethodCommands {
} }
@Command( @Command(
aliases = {"thickness", "width", "worldthickness"}, aliases = {"worldthickness", "width", "thickness"},
usage = "<height>", usage = "<height>",
desc = "Set the thickness of the generated world\n" + desc = "Set the thickness of the generated world\n" +
" - A value of 0 is the default and will not modify the height" " - A value of 0 is the default and will not modify the height"

View File

@ -1854,12 +1854,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements SimpleWorld, Faw
} }
int minLayer = Math.max(0, (minY - primtives.floorThickness) >> 4); int minLayer = Math.max(0, (minY - primtives.floorThickness) >> 4);
if (primtives.worldThickness != 0) {
for (int layer = 0; layer < minLayer; layer++) {
chunk.ids[layer] = null;
chunk.data[layer] = null;
}
}
if (primtives.floorThickness != 0) { if (primtives.floorThickness != 0) {
for (int layer = minLayer; layer <= maxLayer; layer++) { for (int layer = minLayer; layer <= maxLayer; layer++) {
byte[] layerIds = chunk.ids[layer]; byte[] layerIds = chunk.ids[layer];
@ -1898,6 +1893,10 @@ public class HeightMapMCAGenerator extends MCAWriter implements SimpleWorld, Faw
} }
} }
if (primtives.worldThickness != 0) { if (primtives.worldThickness != 0) {
for (int layer = 0; layer < minLayer; layer++) {
chunk.ids[layer] = null;
chunk.data[layer] = null;
}
for (int layer = minLayer; layer <= maxLayer; layer++) { for (int layer = minLayer; layer <= maxLayer; layer++) {
byte[] layerIds = chunk.ids[layer]; byte[] layerIds = chunk.ids[layer];
byte[] layerDatas = chunk.data[layer]; byte[] layerDatas = chunk.data[layer];
@ -1909,7 +1908,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements SimpleWorld, Faw
globalIndex = indexes[index]; globalIndex = indexes[index];
int height = heightMap[index]; int height = heightMap[index];
int min = (minArr[index] & 0xFF) - primtives.floorThickness; int min = (minArr[index] & 0xFF) - primtives.worldThickness;
int localMin = min - startY; int localMin = min - startY;
if (localMin > 0) { if (localMin > 0) {
char floorCombined = floor[globalIndex]; char floorCombined = floor[globalIndex];

View File

@ -14,7 +14,6 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArraySet; import it.unimi.dsi.fastutil.ints.IntArraySet;
import it.unimi.dsi.fastutil.longs.LongArrayList; import it.unimi.dsi.fastutil.longs.LongArrayList;
import java.awt.Color;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;