mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
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:
1 parent
0b5aa54df7
commit
23bed57728
8 files changed
+69
-16
No files matched your search
@@ -58,6 +58,7 @@ import art.arcane.iris.core.nms.INMS;
|
||||
import art.arcane.iris.core.gui.BukkitGuiHost;
|
||||
import art.arcane.iris.core.gui.GuiHost;
|
||||
import art.arcane.iris.core.gui.PregeneratorJob;
|
||||
import art.arcane.iris.core.service.BlockRulesSVC;
|
||||
import art.arcane.iris.core.service.BoardSVC;
|
||||
import art.arcane.iris.core.service.CommandSVC;
|
||||
import art.arcane.iris.core.service.DatapackStructureScopeSVC;
|
||||
@@ -635,7 +636,7 @@ public class Iris extends VolmitPlugin implements Listener, ReloadAware {
|
||||
// Explicit, ordered service list: the previous reflective jar scan gave hash-ordered
|
||||
// enable/disable and paid a full-jar class sweep at boot. Infrastructure first,
|
||||
// engine/world services next, commands last.
|
||||
List<IrisService> orderedServices = List.of(
|
||||
List<IrisService> orderedServices = new ArrayList<>(List.of(
|
||||
new PreservationSVC(),
|
||||
new GlobalCacheSVC(),
|
||||
new LogFilterSVC(),
|
||||
@@ -658,7 +659,11 @@ public class Iris extends VolmitPlugin implements Listener, ReloadAware {
|
||||
new IrisProtocolService(),
|
||||
new IrisApiEventSVC(),
|
||||
new CommandSVC()
|
||||
);
|
||||
));
|
||||
if (BlockRulesSVC.isSupported()) {
|
||||
int commandServiceIndex = orderedServices.size() - 1;
|
||||
orderedServices.add(commandServiceIndex, new BlockRulesSVC());
|
||||
}
|
||||
for (IrisService i : orderedServices) {
|
||||
Class<? extends IrisService> serviceType = i.getClass().asSubclass(IrisService.class);
|
||||
services.put(serviceType, i);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package art.arcane.iris.core.service;
|
||||
|
||||
import art.arcane.iris.core.nms.INMS;
|
||||
import art.arcane.iris.util.common.plugin.IrisService;
|
||||
import io.papermc.paper.event.server.ServerResourcesReloadedEvent;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
public class BlockRulesSVC implements IrisService {
|
||||
private static final String RELOAD_EVENT_CLASS = "io.papermc.paper.event.server.ServerResourcesReloadedEvent";
|
||||
|
||||
public static boolean isSupported() {
|
||||
try {
|
||||
Class.forName(RELOAD_EVENT_CLASS, false, BlockRulesSVC.class.getClassLoader());
|
||||
return true;
|
||||
} catch (ClassNotFoundException | LinkageError unavailable) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onResourcesReloaded(ServerResourcesReloadedEvent event) {
|
||||
INMS.get().forgetBlockRules();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user