2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2021-06-12 21:30:37 +02:00
|
|
|
index da4a110809eee691c1d5b072de335d75e1516eae..9225372cb9ef51a8cfbd4cee543c250aa2ac9c49 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-06-12 21:30:37 +02:00
|
|
|
@@ -352,4 +352,9 @@ public class PaperWorldConfig {
|
2021-06-11 14:02:28 +02:00
|
|
|
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/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
2021-06-16 06:53:50 +02:00
|
|
|
index 91f96f5718f7a7f2e0ce56f4dbf894d8a052630c..8932cb934d77c0c120cad8392acbbc1c049dcfa7 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
2021-06-12 21:30:37 +02:00
|
|
|
@@ -1240,7 +1240,11 @@ public abstract class Player extends LivingEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
|
|
|
|
- this.setSprinting(false);
|
|
|
|
+ // Paper start - Configuration option to disable automatic sprint interruption
|
|
|
|
+ if (!level.paperConfig.disableSprintInterruptionOnAttack) {
|
|
|
|
+ this.setSprinting(false);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flag3) {
|