From f41cc37f5bf24c2d240e9f4f341dde88875d134b Mon Sep 17 00:00:00 2001 From: Awakened-Redstone <40528665+Awakened-Redstone@users.noreply.github.com> Date: Sun, 14 Jul 2024 19:52:06 -0300 Subject: [PATCH] chore: Fix #54 Signed-off-by: Awakened-Redstone <40528665+Awakened-Redstone@users.noreply.github.com> --- src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java | 10 ++++++++++ src/main/resources/fantasy.accesswidener | 1 + 2 files changed, 11 insertions(+) diff --git a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java index 8f5618d..8e77cd4 100644 --- a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java +++ b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java @@ -8,6 +8,7 @@ import net.minecraft.util.ProgressListener; import net.minecraft.util.Util; import net.minecraft.util.math.random.RandomSequencesState; +import net.minecraft.world.GameRules; import net.minecraft.world.World; import net.minecraft.world.biome.source.BiomeAccess; import net.minecraft.world.dimension.DimensionOptions; @@ -61,6 +62,15 @@ public void save(@Nullable ProgressListener progressListener, boolean flush, boo } } + @Override + protected void tickTime() { + if (this.shouldTickTime) { + if (this.properties.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)) { + this.setTimeOfDay(this.properties.getTimeOfDay() + 1L); + } + } + } + @Override public boolean isFlat() { return this.flat; diff --git a/src/main/resources/fantasy.accesswidener b/src/main/resources/fantasy.accesswidener index e17a5cf..a1e27c9 100644 --- a/src/main/resources/fantasy.accesswidener +++ b/src/main/resources/fantasy.accesswidener @@ -3,3 +3,4 @@ accessWidener v1 named accessible class net/minecraft/server/world/ServerChunkLoadingManager$EntityTracker accessible field net/minecraft/world/GameRules$IntRule value I +accessible field net/minecraft/server/world/ServerWorld shouldTickTime Z