Let the server's placement rules reset on reload and stop post from removing foliage

The remembered "plant survives on ground" answers went stale when the server or CraftEngine reloaded resources, so they are now cleared on both events. The post-stage foliage removal second-guessed the server rule and deleted foliage that is not a decoration, so it is gone.

Pins: none moved; the only changed test is SurfaceSmoothingTest, which now expects the fern to stay.

v3: af333cc93
This commit is contained in:
piexel committed 2026-11-10 10:49:00 +01:00
1 parent 0b5aa54df7
commit 23bed57728
8 files changed
+69 -16

No files matched your search

@@ -49,7 +49,6 @@ final class SurfaceSmoothing {
private static final ResourceId CAVE_AIR_ID = ResourceId.parse("minecraft:cave_air");
private static final ResourceId WATER_ID = ResourceId.parse("minecraft:water");
private static final ResourceId SNOW_ID = ResourceId.parse("minecraft:snow");
private static final ResourceId DEAD_BUSH_ID = ResourceId.parse("minecraft:dead_bush");
private static final String SLAB_SUFFIX = "_slab";
private static final String WATERLOGGED = "waterlogged";
private static final String TRUE = "true";
@@ -168,7 +167,7 @@ final class SurfaceSmoothing {
h = placeSlab(x, z, h, ha, hb, hc, hd);
}
settleWaterlogging(x, z, h);
settleFoliage(x, z, h);
settleVine(x, z, h);
}
private int removeFloatingNib(int x, int z, int h, int ha, int hb, int hc, int hd) {
@@ -273,17 +272,11 @@ final class SurfaceSmoothing {
}
}
private void settleFoliage(int x, int z, int h) {
private void settleVine(int x, int z, int h) {
BlockState block = get(x, h + 1, z);
if (has(block, BlockTrait.VINE)) {
connectVine(x, h + 1, z, block);
}
if (!has(block, BlockTrait.FOLIAGE) && !block.material().equals(DEAD_BUSH_ID)) {
return;
}
if (!registry.canPlaceOn(block, get(x, h, z)) && !has(block, BlockTrait.DECORATION)) {
set(x, h + 1, z, AIR);
}
}
/** A vine faces each neighbour it can cling to, a block that is neither air nor another vine. */