|
| 1 | +From a78e3f3a650b05f6babce1e7114337057d5a30db Mon Sep 17 00:00:00 2001 |
| 2 | +From: RoccoDev < [email protected]> |
| 3 | +Date: Fri, 17 Oct 2025 05:43:01 +0200 |
| 4 | +Subject: [PATCH] Make combat line of sight check configurable |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java |
| 8 | +index faee58d45..c17812626 100644 |
| 9 | +--- a/src/main/java/net/minecraft/server/PlayerConnection.java |
| 10 | ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java |
| 11 | +@@ -1393,7 +1393,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList |
| 12 | + } |
| 13 | + } |
| 14 | + // KigPaper end |
| 15 | +- boolean flag = this.player.hasLineOfSight(entity); |
| 16 | ++ // KigPaper - make configurable |
| 17 | ++ boolean flag = !PaperSpigotConfig.combatLineOfSightCheck || this.player.hasLineOfSight(entity); |
| 18 | + double d0 = 36.0D; |
| 19 | + |
| 20 | + if (!flag) { |
| 21 | +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java |
| 22 | +index 5fa3aa5b5..d99ace156 100644 |
| 23 | +--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java |
| 24 | ++++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java |
| 25 | +@@ -214,7 +214,7 @@ public class PaperSpigotConfig |
| 26 | + public static float knockbackHorizontalMultiplier, knockbackVerticalMultiplier, knockbackHorizontalSprinting, knockbackVerticalSprinting, knockbackFriction; |
| 27 | + public static boolean betterVehicleHitboxes, nettyReadTimeout, forceConditionalAutoFlush, savePlayerFiles, enableBookDeserialization, |
| 28 | + accurateMoveTiming, accurateBlockCollisions, bedMessageActions, kickChatMessageLength, entityExplosionConsistency, |
| 29 | +- kickTabCompleteSpam; |
| 30 | ++ kickTabCompleteSpam, combatLineOfSightCheck; |
| 31 | + public static RegionFile.CompressionAlgorithm regionCompressionAlgorithm; |
| 32 | + |
| 33 | + private static void knockbackHorizontalMultiplier() { |
| 34 | +@@ -264,5 +264,8 @@ public class PaperSpigotConfig |
| 35 | + private static void kickTabCompleteSpam() { |
| 36 | + kickTabCompleteSpam = getBoolean("kick-tab-complete-spam", false); |
| 37 | + } |
| 38 | ++ private static void combatLineOfSightCheck() { |
| 39 | ++ combatLineOfSightCheck = getBoolean("combat-line-of-sight-check", true); |
| 40 | ++ } |
| 41 | + // KigPaper end |
| 42 | + } |
| 43 | +-- |
| 44 | +2.51.0 |
| 45 | + |
0 commit comments