mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Updated Upstream (Leaf)
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
||||||
|
Date: Thu, 1 Feb 2024 12:48:58 -0500
|
||||||
|
Subject: [PATCH] Redirect to Gale's method to fix plugin incompatibility
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
index 6d25421091018d1dc0c7bccbce31d8b4244639bb..15c9557b07c9fc392b80e5957bc6ea12c6b89b86 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@@ -258,6 +258,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||||
|
static final Logger LOGGER = LogUtils.getLogger();
|
||||||
|
private static final int LATENCY_CHECK_INTERVAL = 15000;
|
||||||
|
public static final double DEFAULT_MAX_INTERACTION_DISTANCE_SQUARED = Mth.square(6.0D); // Gale - make max interaction distance configurable
|
||||||
|
+ public static double MAX_INTERACTION_DISTANCE = DEFAULT_MAX_INTERACTION_DISTANCE_SQUARED; // Leaf - Redirect to Gale's `getMaxInteractionDistanceSquared` method to fix plugin incompatibility
|
||||||
|
private static final int NO_BLOCK_UPDATES_TO_ACK = -1;
|
||||||
|
private static final int TRACKED_MESSAGE_DISCONNECT_THRESHOLD = 4096;
|
||||||
|
private static final Component CHAT_VALIDATION_FAILED = Component.translatable("multiplayer.disconnect.chat_validation_failed");
|
||||||
|
@@ -372,7 +373,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||||
|
// Gale start - make max interaction distance configurable
|
||||||
|
public static double getMaxInteractionDistanceSquared(Level level) {
|
||||||
|
var config = level.galeConfig().gameplayMechanics;
|
||||||
|
- return config.playerMaxInteractionDistance < 0 ? ServerGamePacketListenerImpl.DEFAULT_MAX_INTERACTION_DISTANCE_SQUARED : config.playerMaxInteractionDistanceSquared;
|
||||||
|
+ // Leaf - Redirect
|
||||||
|
+ MAX_INTERACTION_DISTANCE = config.playerMaxInteractionDistance < 0 ? ServerGamePacketListenerImpl.DEFAULT_MAX_INTERACTION_DISTANCE_SQUARED : config.playerMaxInteractionDistanceSquared;
|
||||||
|
+ return MAX_INTERACTION_DISTANCE;
|
||||||
|
+ // Leaf end
|
||||||
|
}
|
||||||
|
// Gale end - make max interaction distance configurable
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
||||||
|
Date: Mon, 19 Feb 2024 13:10:16 -0500
|
||||||
|
Subject: [PATCH] Redirect vanilla getProfiler in PathNavigationRegion
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||||
|
index b87c9a6189161e776fa488c1ac6215edca596184..7e2bcc08cac90d4e095fc782e77bd8e64d77c220 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||||
|
@@ -155,4 +155,10 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
|
||||||
|
public int getHeight() {
|
||||||
|
return this.level.getHeight();
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Leaf start - Redirect to fix plugin incompatibility
|
||||||
|
+ public net.minecraft.util.profiling.ProfilerFiller getProfiler() {
|
||||||
|
+ return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Gale - Purpur - remove vanilla profiler
|
||||||
|
+ }
|
||||||
|
+ // Leaf end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user