Skip to content

Commit f3c5bd7

Browse files
committed
Some placement fixes
1 parent 9e7137b commit f3c5bd7

File tree

3 files changed

+11
-33
lines changed

3 files changed

+11
-33
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>worldgeneratorextension</groupId>
77
<artifactId>WorldGeneratorExtension</artifactId>
8-
<version>1.5.0</version>
8+
<version>1.5.1</version>
99
<build>
1010
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
1111
<plugins>

src/main/java/worldgeneratorextension/multitspop/populator/PopulatorRuinedPortal.java

+4-32
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import worldgeneratorextension.multitspop.template.ReadOnlyLegacyStructureTemplate2;
1717
import worldgeneratorextension.multitspop.template.ReadableStructureTemplate;
1818
import worldgeneratorextension.multitspop.template.StructurePlaceSettings;
19+
import worldgeneratorextension.singletspop.populator.PopulatorShipwreck;
1920

2021
import java.util.function.Consumer;
2122

@@ -24,7 +25,7 @@ public class PopulatorRuinedPortal extends Populator {
2425
protected static final ReadableStructureTemplate PORTAL3 = new ReadOnlyLegacyStructureTemplate2().load(Loader.loadNBT("structures/ruined_portal/portal_3.nbt"));
2526
protected static final ReadableStructureTemplate PORTAL4 = new ReadOnlyLegacyStructureTemplate2().load(Loader.loadNBT("structures/ruined_portal/portal_4.nbt"));
2627

27-
protected static final int SPACING = 20;
28+
protected static final int SPACING = 24;
2829
protected static final int SEPARATION = 8;
2930

3031
@Override
@@ -46,7 +47,7 @@ public void populate(ChunkManager level, int chunkX, int chunkZ, NukkitRandom ra
4647
}
4748

4849
int id = chunk.getBlockId(x, y, z);
49-
while (FILTER[id] && y > 0) {
50+
while (PopulatorShipwreck.FILTER[id] && y > 0) {
5051
id = chunk.getBlockId(x, --y, z);
5152
}
5253

@@ -77,37 +78,8 @@ public void populate(ChunkManager level, int chunkX, int chunkZ, NukkitRandom ra
7778
}
7879
}
7980

80-
public static final boolean[] FILTER = new boolean[Block.MAX_BLOCK_ID];
81-
8281
public static void init() {
83-
FILTER[AIR] = true;
84-
FILTER[LOG] = true;
85-
FILTER[WATER] = true;
86-
FILTER[STILL_WATER] = true;
87-
FILTER[LAVA] = true;
88-
FILTER[STILL_LAVA] = true;
89-
FILTER[LEAVES] = true;
90-
FILTER[TALL_GRASS] = true;
91-
FILTER[DEAD_BUSH] = true;
92-
FILTER[DANDELION] = true;
93-
FILTER[RED_FLOWER] = true;
94-
FILTER[BROWN_MUSHROOM] = true;
95-
FILTER[RED_MUSHROOM] = true;
96-
FILTER[SNOW_LAYER] = true;
97-
FILTER[ICE] = true;
98-
FILTER[CACTUS] = true;
99-
FILTER[REEDS] = true;
100-
FILTER[PUMPKIN] = true;
101-
FILTER[BROWN_MUSHROOM_BLOCK] = true;
102-
FILTER[RED_MUSHROOM_BLOCK] = true;
103-
FILTER[MELON_BLOCK] = true;
104-
FILTER[VINE] = true;
105-
FILTER[WATER_LILY] = true;
106-
FILTER[COCOA] = true;
107-
FILTER[LEAVES2] = true;
108-
FILTER[LOG2] = true;
109-
FILTER[PACKED_ICE] = true;
110-
FILTER[DOUBLE_PLANT] = true;
82+
//NOOP
11183
}
11284

11385
protected static Consumer<CompoundTag> getBlockActorProcessor(FullChunk chunk, NukkitRandom random) {

src/main/java/worldgeneratorextension/singletspop/populator/PopulatorCoralCrust.java

+6
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,23 @@ public void populate(ChunkManager level, int chunkX, int chunkZ, NukkitRandom ra
5050

5151
int y;
5252
int previous = -1;
53+
boolean found = false;
5354

5455
for (y = Normal.seaHeight; y >= 40; y--) {
5556
int b = chunk.getBlockId(0, y, 0);
5657

5758
if ((previous == BlockID.WATER || previous == BlockID.STILL_WATER) && (b == BlockID.GRAVEL || b == BlockID.SAND)) {
59+
found = true;
5860
break;
5961
}
6062

6163
previous = b;
6264
}
6365

66+
if (!found) {
67+
return;
68+
}
69+
6470
BlockVector3 vec = new BlockVector3(chunkX + x, y - 1, chunkZ + z);
6571
template.placeInChunk(chunk, random, vec, 100, null);
6672

0 commit comments

Comments
 (0)