2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
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
|
2024-09-15 21:39:53 +02:00
|
|
|
index 7a7c404778757e6778305c9f8334a4fba1f466a6..d58439f85f4d3a9b863ecadb3b42b2ee3270a772 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
2024-09-15 21:39:53 +02:00
|
|
|
@@ -3969,12 +3969,24 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
2021-06-11 14:02:28 +02:00
|
|
|
if (this.isUsingItem() && !this.useItem.isEmpty()) {
|
|
|
|
Item item = this.useItem.getItem();
|
|
|
|
|
2024-06-13 21:04:27 +02:00
|
|
|
- return item.getUseAnimation(this.useItem) != UseAnim.BLOCK ? false : item.getUseDuration(this.useItem, this) - this.useItemRemaining >= 5;
|
|
|
|
+ return item.getUseAnimation(this.useItem) != UseAnim.BLOCK ? false : item.getUseDuration(this.useItem, this) - this.useItemRemaining >= getShieldBlockingDelay(); // Paper - Make shield blocking delay configurable
|
2021-06-11 14:02:28 +02:00
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2021-06-12 21:30:37 +02:00
|
|
|
|
2024-01-21 19:37:09 +01:00
|
|
|
+ // Paper start - Make shield blocking delay configurable
|
2023-06-07 23:35:19 +02:00
|
|
|
+ public int shieldBlockingDelay = this.level().paperConfig().misc.shieldBlockingDelay;
|
2021-06-11 14:02:28 +02:00
|
|
|
+
|
|
|
|
+ public int getShieldBlockingDelay() {
|
|
|
|
+ return shieldBlockingDelay;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setShieldBlockingDelay(int shieldBlockingDelay) {
|
|
|
|
+ this.shieldBlockingDelay = shieldBlockingDelay;
|
|
|
|
+ }
|
2024-01-21 19:37:09 +01:00
|
|
|
+ // Paper end - Make shield blocking delay configurable
|
2021-06-12 21:30:37 +02:00
|
|
|
+
|
|
|
|
public boolean isSuppressingSlidingDownLadder() {
|
|
|
|
return this.isShiftKeyDown();
|
|
|
|
}
|
2021-06-11 14:02:28 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2024-09-15 21:39:53 +02:00
|
|
|
index 475fcc2d1d61a94b81dc839ba0240f317afcfe56..5ca07b2cdc30f23632a23249c615ac9a8c7c96c7 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2024-09-15 21:39:53 +02:00
|
|
|
@@ -847,5 +847,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2023-02-07 16:43:20 +01:00
|
|
|
public void setArrowsStuck(final int arrows) {
|
|
|
|
this.getHandle().setArrowCount(arrows);
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int getShieldBlockingDelay() {
|
|
|
|
+ return getHandle().getShieldBlockingDelay();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setShieldBlockingDelay(int delay) {
|
|
|
|
+ getHandle().setShieldBlockingDelay(delay);
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|