This commit is contained in:
Helvetica Volubi
2026-06-25 17:49:55 +08:00
parent 8cd8f4fbad
commit 1cd09226f6
3 changed files with 5 additions and 3 deletions
@@ -295,7 +295,8 @@ public class LeavesProtocolManager {
} }
public static void handleTick() { public static void handleTick() {
long currentTime = System.currentTimeMillis() / MinecraftServer.getServer().tickRateManager().nanosecondsPerTick(); float interval = MinecraftServer.getServer().tickRateManager().millisecondsPerTick();
long currentTime = interval >= 1 ? System.currentTimeMillis() / (long) MinecraftServer.getServer().tickRateManager().millisecondsPerTick() : (long) (System.currentTimeMillis() / MinecraftServer.getServer().tickRateManager().millisecondsPerTick());
if (currentTime == lastAcceptTime) return; if (currentTime == lastAcceptTime) return;
lastAcceptTime = currentTime; lastAcceptTime = currentTime;
for (var tickerInfo : TICKERS) { for (var tickerInfo : TICKERS) {
@@ -46,7 +46,7 @@ public class ProtocolUtils {
private static final byte[] EMPTY = new byte[0]; private static final byte[] EMPTY = new byte[0];
public static String buildProtocolVersion(String protocol) { public static String buildProtocolVersion(String protocol) {
return protocol + "-leaves-" + ServerBuildInfo.buildInfo().asString(ServerBuildInfo.StringRepresentation.VERSION_SIMPLE); return protocol + "-lophine-" + ServerBuildInfo.buildInfo().asString(ServerBuildInfo.StringRepresentation.VERSION_SIMPLE);
} }
public static void sendEmptyPacket(ServerPlayer player, Identifier id) { public static void sendEmptyPacket(ServerPlayer player, Identifier id) {
@@ -345,7 +345,8 @@ public class ServuxStructuresProtocol implements LeavesProtocol {
PACKET_C2S_STRUCTURES_UNREGISTER(4), PACKET_C2S_STRUCTURES_UNREGISTER(4),
PACKET_S2C_STRUCTURE_DATA_START(5), PACKET_S2C_STRUCTURE_DATA_START(5),
PACKET_S2C_SPAWN_METADATA(10), PACKET_S2C_SPAWN_METADATA(10),
PACKET_C2S_REQUEST_SPAWN_METADATA(11); PACKET_C2S_REQUEST_SPAWN_METADATA(11),
PACKET_S2C_WEATHER_DATA(12);
public final int type; public final int type;