3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 21:10:17 +01:00
Paper/Spigot-Server-Patches/0259-Configurable-sprint-interruption-on-attack.patch
Shane Freeder c99e4a22aa
NOT FINISHED! 1.13 pre-7
I need more creative commit messages.
2018-07-19 00:16:19 +01:00

41 Zeilen
1.8 KiB
Diff

From 3769a500e46acd96215769b0495c589417820678 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Sat, 14 Apr 2018 20:20:46 +0200
Subject: [PATCH] Configurable sprint interruption on attack
If the sprint interruption is disabled players continue sprinting when they attack entities.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 830b99cd7..87d2dd131 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -424,4 +424,8 @@ public class PaperWorldConfig {
squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D);
}
+ public boolean disableSprintInterruptionOnAttack;
+ private void disableSprintInterruptionOnAttack() {
+ disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 65f4ea6cc..a766a1467 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1073,7 +1073,11 @@ public abstract class EntityHuman extends EntityLiving {
this.motX *= 0.6D;
this.motZ *= 0.6D;
- this.setSprinting(false);
+ // Paper start - Configuration option to disable automatic sprint interruption
+ if (!world.paperConfig.disableSprintInterruptionOnAttack) {
+ this.setSprinting(false);
+ }
+ // Paper end
}
if (flag3) {
--
2.18.0