Ask the native binding where plants can stand again

- Undo the in-Iris server check, Bukkit server code belongs in the VolmLib natives
- Needs VolmLib piexelated/conch again
This commit is contained in:
piexel committed 2026-11-26 12:40:05 +01:00
1 parent 60a9b5c7c4
commit 43ce1cb038
15 files changed
+73 -602

No files matched your search

@@ -1,26 +1,24 @@
package art.arcane.iris.platform.bukkit;
import art.arcane.iris.generation.block.PlantPlacement;
import art.arcane.iris.platform.bukkit.nms.INMS;
import art.arcane.iris.platform.bukkit.plugin.IrisService;
import io.papermc.paper.event.server.ServerResourcesReloadedEvent;
import org.bukkit.event.EventHandler;
/** Lets the server's own rules decide where plants can stand, and asks them again after a resource reload. */
/** Lets the server's placement rules apply again after a resource reload, which may have changed the block tags they read. */
public class BlockRulesSVC implements IrisService {
private PlantPlacement.ServerRule previousRule;
@Override
public void onEnable() {
previousRule = PlantPlacement.bindServerRule(BukkitPlacementRules::canPlaceOnto);
}
@Override
public void onDisable() {
PlantPlacement.restoreServerRule(previousRule);
}
@EventHandler
public void onResourcesReloaded(ServerResourcesReloadedEvent event) {
BukkitPlacementRules.forgetServerRules();
if (INMS.isBound()) {
INMS.get().forgetBlockRules();
}
}
}