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

@@ -34,6 +34,10 @@ final class GroundSurvival {
}
}
void forgetRules() {
restsOnGround.clear();
}
// Wall and ceiling blocks fail on every ground, which says nothing about the ground they were decorated onto.
private boolean restsOnGround(BlockState plant) {
return restsOnGround.computeIfAbsent(plant, this::survivesOnSomeGround);
@@ -1665,6 +1665,11 @@ public class NMSBinding implements INMSBinding {
return groundSurvival.canSurviveOn(((CraftBlockData) plant).getState(), ((CraftBlockData) ground).getState());
}
@Override
public void forgetBlockRules() {
groundSurvival.forgetRules();
}
@Override
public KMap<Material, List<BlockProperty>> getBlockProperties() {
KMap<Material, List<BlockProperty>> states = new KMap<>();