2019-07-20 06:01:24 +02:00
|
|
|
From 76ffd33135a20f2afca038b2b83f653dfcb7924a Mon Sep 17 00:00:00 2001
|
2018-04-18 15:46:48 +02:00
|
|
|
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
|
2019-07-20 06:01:24 +02:00
|
|
|
index 94ffba97b4..0b6e812d8d 100644
|
2018-04-18 15:46:48 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-07-03 22:44:07 +02:00
|
|
|
@@ -349,4 +349,9 @@ public class PaperWorldConfig {
|
2018-07-21 23:24:18 +02:00
|
|
|
private void squidMaxSpawnHeight() {
|
2018-07-18 20:55:52 +02:00
|
|
|
squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D);
|
2018-04-18 15:46:48 +02:00
|
|
|
}
|
2018-07-21 23:24:18 +02:00
|
|
|
+
|
2018-04-18 15:46:48 +02:00
|
|
|
+ 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
|
2019-07-20 06:01:24 +02:00
|
|
|
index 778356381d..494425e594 100644
|
2018-04-18 15:46:48 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
2019-07-20 06:01:24 +02:00
|
|
|
@@ -1045,7 +1045,11 @@ public abstract class EntityHuman extends EntityLiving {
|
2019-04-29 05:14:31 +02:00
|
|
|
}
|
2018-04-18 15:46:48 +02:00
|
|
|
|
2019-04-29 05:14:31 +02:00
|
|
|
this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D));
|
2018-04-18 15:46:48 +02:00
|
|
|
- this.setSprinting(false);
|
|
|
|
+ // Paper start - Configuration option to disable automatic sprint interruption
|
|
|
|
+ if (!world.paperConfig.disableSprintInterruptionOnAttack) {
|
|
|
|
+ this.setSprinting(false);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flag3) {
|
|
|
|
--
|
2019-06-25 21:18:50 +02:00
|
|
|
2.22.0
|
2018-04-18 15:46:48 +02:00
|
|
|
|