9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-22 08:29:28 +00:00
Files
Leaf/patches/server/0064-Redirect-to-Gale-s-method-to-fix-plugin-incompatibil.patch
2024-02-29 09:31:12 -05:00

31 lines
2.2 KiB
Diff

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 8d4fbf7dd77ef5233936aa5c2bce2e63ecbdebab..42885c7f374f619fe63d9fe22a4b7f88d68008c3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -251,6 +251,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
static final Logger LOGGER = LogUtils.getLogger();
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");
@@ -332,7 +333,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// 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