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-04-12 21:14:06 +02:00
|
|
|
index 96805bc64fd3593373ba9eecf29bd13d33d9e053..e3dfef027fb7f6aedd3e3411af6457671b5507a7 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
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear 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:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -3828,12 +3828,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;
|
2024-01-21 19:37:09 +01:00
|
|
|
+ return item.getUseAnimation(this.useItem) != UseAnim.BLOCK ? false : item.getUseDuration(this.useItem) - 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-04-06 21:53:39 +02:00
|
|
|
index 19f8cfe1146374169208f26632763a882291431c..1c6abeff5b541cdea914ac956f2ab1d2e1c5769f 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-04-06 21:53:39 +02:00
|
|
|
@@ -855,5 +855,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
|
|
|
|
}
|