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
|
2022-12-07 17:46:46 +01:00
|
|
|
index e49803f36ffea3329a67542882ee58e4762a08e5..bc90eb2e644916f73f02d94de1dcc9f3f7307390 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
|
2022-10-02 09:56:36 +02:00
|
|
|
@@ -3726,12 +3726,24 @@ public abstract class LivingEntity extends Entity {
|
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
|
2022-06-09 10:51:45 +02:00
|
|
|
+ public int shieldBlockingDelay = 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
|
2022-09-12 13:31:45 +02:00
|
|
|
index a08fd99fb97d8c880c855e6af2a99afcfa8098b5..80efb900e37069f4ff39c35d39456959ca24bfe8 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
|
2022-09-12 13:31:45 +02:00
|
|
|
@@ -785,5 +785,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
public void setArrowsStuck(int arrows) {
|
|
|
|
getHandle().setArrowCount(arrows);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int getShieldBlockingDelay() {
|
|
|
|
+ return getHandle().getShieldBlockingDelay();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setShieldBlockingDelay(int delay) {
|
|
|
|
+ getHandle().setShieldBlockingDelay(delay);
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|