2018-05-30 22:31:55 +02:00
|
|
|
From 02d1a77b8eb9fbaf23afe0f5b09bca76497f1369 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
|
2018-05-30 22:31:55 +02:00
|
|
|
index 9a5939a7..2bdedd83 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
|
2018-05-30 22:31:55 +02:00
|
|
|
@@ -502,4 +502,9 @@ public class PaperWorldConfig {
|
2018-04-18 15:46:48 +02:00
|
|
|
disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents);
|
|
|
|
log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled"));
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ 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-04-22 16:45:56 +02:00
|
|
|
index 35fde8b2..0b51903e 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
|
|
|
|
@@ -1030,7 +1030,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-05-30 22:31:55 +02:00
|
|
|
2.17.0
|
2018-04-18 15:46:48 +02:00
|
|
|
|