From 1d1e4ec70b444deeb27f2f67868f40366881e6ff Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Mon, 29 Sep 2025 16:49:58 +0800 Subject: [PATCH] fix: fixes #62 --- .../features/0010-Leaves-Base-Protocol-Core.patch | 4 ++-- .../leavesmc/leaves/protocol/core/LeavesProtocolManager.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lophine-server/minecraft-patches/features/0010-Leaves-Base-Protocol-Core.patch b/lophine-server/minecraft-patches/features/0010-Leaves-Base-Protocol-Core.patch index e7f6031..be5c6a0 100644 --- a/lophine-server/minecraft-patches/features/0010-Leaves-Base-Protocol-Core.patch +++ b/lophine-server/minecraft-patches/features/0010-Leaves-Base-Protocol-Core.patch @@ -8,14 +8,14 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/ea91106ae57fc4cc1 Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java -index 8405157ec35a443e238fa6866772c839621d73d7..a261f66c29412039bbbaed4758bcade2e076da56 100644 +index 8405157ec35a443e238fa6866772c839621d73d7..67f3454e6479abb241a7d94699d4f7bec22da56b 100644 --- a/io/papermc/paper/threadedregions/RegionizedServer.java +++ b/io/papermc/paper/threadedregions/RegionizedServer.java @@ -334,6 +334,8 @@ public final class RegionizedServer { } // Luminol end - Add a config to enable tick command -+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(tickCount); // Leaves - protocol ++ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(); // Leaves - protocol + // tick connections this.tickConnections(); diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java index 1e9ad7f..65b0713 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java @@ -24,6 +24,7 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import org.leavesmc.leaves.protocol.core.invoker.*; import org.slf4j.Logger; @@ -251,9 +252,9 @@ public class LeavesProtocolManager { return false; } - public static void handleTick(long tickCount) { + public static void handleTick() { for (var tickerInfo : TICKERS) { - if (tickCount % tickerInfo.owner().tickerInterval(tickerInfo.handler().tickerId()) == 0) { + if (MinecraftServer.getServer().checkTickCount(tickerInfo.owner().tickerInterval(tickerInfo.handler().tickerId()))) { tickerInfo.invoke(); } }