Paper/Spigot-Server-Patches/0212-Configurable-sprint-interruption-on-attack.patch
Aikar 36f34f01c0
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
da9ef3c5 #496: Add methods to get/set ItemStacks in EquipmentSlots
3abebc9f #492: Let Tameable extend Animals rather than Entity
941111a0 #495: Expose ItemStack and hand used in PlayerShearEntityEvent
4fe19cae #494: InventoryView - Add missing Brewing FUEL_TIME

CraftBukkit Changes:
933e9094 #664: Add methods to get/set ItemStacks in EquipmentSlots
18722312 #662: Expose ItemStack and hand used in PlayerShearEntityEvent
2020-05-06 06:05:22 -04:00

39 lines
2.0 KiB
Diff

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 77cdbfadf9c3eddb6a02460c321fa816d1bab8ac..171c8e3031cf4bf4da062663089cc0cb4552fab6 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -356,4 +356,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
index fda1b3d91b14080bf04a02c1340c63a6eb37911d..14a0e3d41ccd896da3b1126a403b0b684cada907 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1112,7 +1112,11 @@ public abstract class EntityHuman extends EntityLiving {
}
this.setMot(this.getMot().d(0.6D, 1.0D, 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) {