mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 14:51:27 +01:00
Configurable sprint interruption on attack (#1085)
If the sprint interruption is disabled players continue sprinting when they attack entities.
This commit is contained in:
parent
45f29dbd99
commit
bfd81cc275
@ -0,0 +1,39 @@
|
|||||||
|
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
|
||||||
|
index 038f874b3..c903c89cf 100644
|
||||||
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||||
|
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
|
||||||
|
index 35fde8b23..0b51903e2 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||||
|
@@ -0,0 +0,0 @@ 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) {
|
||||||
|
--
|
Loading…
Reference in New Issue
Block a user