From 1a9a44318b6f62ce91b56fef725322a26cc048e6 Mon Sep 17 00:00:00 2001 From: XFactHD Date: Fri, 18 Oct 2024 22:46:20 +0200 Subject: [PATCH] Fix custom time sync not setting client-side time ticking correctly --- .../neoforge/network/handlers/ClientPayloadHandler.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/net/neoforged/neoforge/network/handlers/ClientPayloadHandler.java b/src/main/java/net/neoforged/neoforge/network/handlers/ClientPayloadHandler.java index 531b3ca0d2..efd17ee853 100644 --- a/src/main/java/net/neoforged/neoforge/network/handlers/ClientPayloadHandler.java +++ b/src/main/java/net/neoforged/neoforge/network/handlers/ClientPayloadHandler.java @@ -151,10 +151,7 @@ public static void handle(AdvancedContainerSetDataPayload msg, IPayloadContext c public static void handle(final ClientboundCustomSetTimePayload payload, final IPayloadContext context) { @SuppressWarnings("resource") final ClientLevel level = Minecraft.getInstance().level; - level.getLevelData().setGameTime(payload.gameTime()); - level.getLevelData().setDayTime(payload.dayTime()); - // TODO porting: check whether the custom time system relies on this - //level.getGameRules().getRule(GameRules.RULE_DAYLIGHT).set(payload.gameRule(), null); + level.setTimeFromServer(payload.gameTime(), payload.dayTime(), payload.gameRule()); level.setDayTimeFraction(payload.dayTimeFraction()); level.setDayTimePerTick(payload.dayTimePerTick()); }