From 3f555067ddf7b8648f81ddfbad5f25d44d156dcd Mon Sep 17 00:00:00 2001 From: Dragon-Seeker Date: Thu, 14 Nov 2024 20:42:55 -0600 Subject: [PATCH] Require opt in for preventing daylight cycle for worlds --- src/main/java/io/wispforest/owo/Owo.java | 2 ++ .../java/io/wispforest/owo/mixin/tweaks/LevelInfoMixin.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/wispforest/owo/Owo.java b/src/main/java/io/wispforest/owo/Owo.java index 8b2dfe78..3177ef89 100644 --- a/src/main/java/io/wispforest/owo/Owo.java +++ b/src/main/java/io/wispforest/owo/Owo.java @@ -25,6 +25,7 @@ public class Owo implements ModInitializer { * To override that behavior, add the {@code -Dowo.debug=false} java argument */ public static final boolean DEBUG; + public static final boolean PREVENT_DAYLIGHT_CYCLE; public static final Logger LOGGER = LogManager.getLogger("owo"); private static MinecraftServer SERVER; @@ -43,6 +44,7 @@ public class Owo implements ModInitializer { } DEBUG = debug; + PREVENT_DAYLIGHT_CYCLE = Boolean.getBoolean("owo.preventDaylightCycle"); } @Override diff --git a/src/main/java/io/wispforest/owo/mixin/tweaks/LevelInfoMixin.java b/src/main/java/io/wispforest/owo/mixin/tweaks/LevelInfoMixin.java index bd44153f..d02312a8 100644 --- a/src/main/java/io/wispforest/owo/mixin/tweaks/LevelInfoMixin.java +++ b/src/main/java/io/wispforest/owo/mixin/tweaks/LevelInfoMixin.java @@ -23,7 +23,7 @@ public class LevelInfoMixin { @Inject(method = "", at = @At("TAIL")) private void simulationIsForNerds(String name, GameMode gameMode, boolean hardcore, Difficulty difficulty, boolean allowCommands, GameRules gameRules, DataConfiguration dataConfiguration, CallbackInfo ci) { - if (!(Owo.DEBUG && FabricLoader.getInstance().isDevelopmentEnvironment())) return; + if (!(Owo.DEBUG && Owo.PREVENT_DAYLIGHT_CYCLE && FabricLoader.getInstance().isDevelopmentEnvironment())) return; this.gameRules.get(GameRules.DO_DAYLIGHT_CYCLE).set(false, null); this.gameRules.get(GameRules.DO_WEATHER_CYCLE).set(false, null);