diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/RedStoneConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/RedStoneConfig.java new file mode 100644 index 0000000..8cdc8d3 --- /dev/null +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/RedStoneConfig.java @@ -0,0 +1,32 @@ +package fun.bm.lophine.config.modules.experiment; + +import me.earthme.luminol.config.IConfigModule; +import me.earthme.luminol.config.flags.ConfigClassInfo; +import me.earthme.luminol.config.flags.ConfigInfo; +import me.earthme.luminol.config.flags.HotReloadUnsupported; +import me.earthme.luminol.config.flags.TransformedConfig; +import me.earthme.luminol.enums.EnumConfigCategory; + +/* + * This is a config module for redstone in experimental level + * If we think configs from here is stable for future, we will move them to function module directory + */ +@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "redstone") +public class RedStoneConfig implements IConfigModule { + @ConfigInfo(name = "redstone-ignore-upwards-update", comments = """ + Should the pre-1.20 mechanism be reintroduced: + Redstone dust does not connect to adjacent redstone dust on trapdoors that are open + Pre-1.20.2 mechanism: Redstone dust, redstone repeaters, and redstone comparators do not check for attachment when receiving status updates from below""") + public static boolean redstoneIgnoreUpwardsUpdate = false; + + @ConfigInfo(name = "cce-update-suppression", comments = """ + Is it permissible to use ClassCastException for update suppression?""") + public static boolean cce = false; + + @HotReloadUnsupported + @ConfigInfo(name = "instant-block-updater") + public static boolean instantBlockUpdater = false; + + @ConfigInfo(name = "old-block-remove-behaviour") + public static boolean oldBlockRemoveBehaviour = false; +} diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/fixes/UpdateSuppressionCrashFixConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/fixes/UpdateSuppressionCrashFixConfig.java new file mode 100644 index 0000000..d29ac4d --- /dev/null +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/fixes/UpdateSuppressionCrashFixConfig.java @@ -0,0 +1,13 @@ +package fun.bm.lophine.config.modules.fixes; + +import me.earthme.luminol.config.IConfigModule; +import me.earthme.luminol.config.flags.ConfigClassInfo; +import me.earthme.luminol.config.flags.ConfigInfo; +import me.earthme.luminol.enums.EnumConfigCategory; + +@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "update-suppression-crash-fix") +public class UpdateSuppressionCrashFixConfig implements IConfigModule { + @ConfigInfo(name = "enabled", comments = """ + Should crash caused by update suppression be prevented?""") + public static boolean enabled = true; +} diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/util/UpdateSuppressionException.java b/lophine-server/src/main/java/org/leavesmc/leaves/util/UpdateSuppressionException.java index 77e71fc..f253840 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/util/UpdateSuppressionException.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/util/UpdateSuppressionException.java @@ -64,7 +64,7 @@ public class UpdateSuppressionException extends RuntimeException { } public void provideLevel(@NotNull Level level) { - if (this.level != null) { + if (this.level == null) { this.level = level; } } @@ -75,10 +75,10 @@ public class UpdateSuppressionException extends RuntimeException { } public void provideBlock(@NotNull BlockPos pos, @NotNull Block source) { - if (this.pos != null) { + if (this.pos == null) { this.pos = pos; } - if (this.source != null) { + if (this.source == null) { this.source = source; } }