Skip to content

Commit

Permalink
Require opt in for preventing daylight cycle for worlds
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon-Seeker committed Nov 15, 2024
1 parent a524f48 commit a49961d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/io/wispforest/owo/Owo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -43,6 +44,7 @@ public class Owo implements ModInitializer {
}

DEBUG = debug;
PREVENT_DAYLIGHT_CYCLE = Boolean.getBoolean("owo.preventDaylightCycle");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class LevelInfoMixin {

@Inject(method = "<init>", 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);
Expand Down

0 comments on commit a49961d

Please sign in to comment.