aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0197-Make-shield-blocking-delay-configurable.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-12-03 17:58:41 +0100
committerNassim Jahnke <[email protected]>2024-12-03 17:58:41 +0100
commitc0a3d51ab35930e410fcd9752ceaff6c3f581c24 (patch)
treef53076a8b0787d2f544f73f468df94619e5eb1a5 /patches/unapplied/server/0197-Make-shield-blocking-delay-configurable.patch
parentda7138233f6392e791d790d1c3407414c855f9c2 (diff)
downloadPaper-c0a3d51ab35930e410fcd9752ceaff6c3f581c24.tar.gz
Paper-c0a3d51ab35930e410fcd9752ceaff6c3f581c24.zip
Start update, apply API patches
Diffstat (limited to 'patches/unapplied/server/0197-Make-shield-blocking-delay-configurable.patch')
-rw-r--r--patches/unapplied/server/0197-Make-shield-blocking-delay-configurable.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/patches/unapplied/server/0197-Make-shield-blocking-delay-configurable.patch b/patches/unapplied/server/0197-Make-shield-blocking-delay-configurable.patch
new file mode 100644
index 0000000000..87567dd988
--- /dev/null
+++ b/patches/unapplied/server/0197-Make-shield-blocking-delay-configurable.patch
@@ -0,0 +1,56 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath <[email protected]>
+Date: Sat, 16 Jun 2018 01:18:16 -0500
+Subject: [PATCH] Make shield blocking delay configurable
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+index a03583daf6cac850c154e0e89dc3fa00a844903f..349aa25d6e52190534ea68a31b6e2ae29a689944 100644
+--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+@@ -4102,12 +4102,24 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ if (this.isUsingItem() && !this.useItem.isEmpty()) {
+ Item item = this.useItem.getItem();
+
+- return item.getUseAnimation(this.useItem) != ItemUseAnimation.BLOCK ? null : (item.getUseDuration(this.useItem, this) - this.useItemRemaining < 5 ? null : this.useItem);
++ return item.getUseAnimation(this.useItem) != ItemUseAnimation.BLOCK ? null : (item.getUseDuration(this.useItem, this) - this.useItemRemaining < getShieldBlockingDelay() ? null : this.useItem); // Paper - Make shield blocking delay configurable
+ } else {
+ return null;
+ }
+ }
+
++ // Paper start - Make shield blocking delay configurable
++ public int shieldBlockingDelay = this.level().paperConfig().misc.shieldBlockingDelay;
++
++ public int getShieldBlockingDelay() {
++ return shieldBlockingDelay;
++ }
++
++ public void setShieldBlockingDelay(int shieldBlockingDelay) {
++ this.shieldBlockingDelay = shieldBlockingDelay;
++ }
++ // Paper end - Make shield blocking delay configurable
++
+ public boolean isSuppressingSlidingDownLadder() {
+ return this.isShiftKeyDown();
+ }
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+index 452fe788152f7c38ab4b6c627e3ba37da3d9b9d9..e5186fbd4030d7b39443090b711e855dcbc39426 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+@@ -873,5 +873,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+ public void setArrowsStuck(final int arrows) {
+ this.getHandle().setArrowCount(arrows);
+ }
++
++ @Override
++ public int getShieldBlockingDelay() {
++ return getHandle().getShieldBlockingDelay();
++ }
++
++ @Override
++ public void setShieldBlockingDelay(int delay) {
++ getHandle().setShieldBlockingDelay(delay);
++ }
+ // Paper end
+ }