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
|
2023-12-25 23:51:56 +01:00
|
|
|
index 39e02e922e67915c23ce4565eba33f656cbe81b6..dff2427e32b92a6deca0df81d0820353c5fc242a 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
|
2023-12-05 23:12:48 +01:00
|
|
|
@@ -3808,12 +3808,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();
|
|
|
|
|
|
|
|
- return item.getUseAnimation(this.useItem) != UseAnim.BLOCK ? false : item.getUseDuration(this.useItem) - this.useItemRemaining >= 5;
|
|
|
|
+ return item.getUseAnimation(this.useItem) != UseAnim.BLOCK ? false : item.getUseDuration(this.useItem) - this.useItemRemaining >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2021-06-12 21:30:37 +02:00
|
|
|
|
2021-06-11 14:02:28 +02:00
|
|
|
+ // Paper start
|
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;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
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
|
2023-12-25 23:51:56 +01:00
|
|
|
index f1195a4dd11370066008aaf6c7c4a8b4d628d822..4ae1f2c25f3012cee5abdb579e6b452a78ba8a1c 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
|
2023-12-25 23:51:56 +01:00
|
|
|
@@ -813,5 +813,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
|
|
|
|
}
|