Paper/Spigot-Server-Patches/0253-Configurable-sprint-interruption-on-attack.patch

42 lines
1.9 KiB
Diff
Raw Normal View History

2018-09-09 20:38:27 +02:00
From 04010471fd6283265d586eb38347d7a4abbe8b88 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
2018-09-09 20:38:27 +02:00
index c9a44863..9ff73d53 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -401,4 +401,9 @@ public class PaperWorldConfig {
private void squidMaxSpawnHeight() {
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
2018-09-09 20:38:27 +02:00
index 5975578b..5e13cb06 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
2018-09-09 20:38:27 +02:00
@@ -1088,7 +1088,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) {
--
2018-09-09 20:38:27 +02:00
2.18.0.windows.1