@@ -0,0 +1,31 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||||
|
Date: Sat, 16 Jun 2018 01:17:39 -0500
|
||||||
|
Subject: [PATCH] Make shield blocking delay configurable
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
index 42cf95e1..5921c952 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti
|
||||||
|
* @param arrows Number of arrows to stick in this entity
|
||||||
|
*/
|
||||||
|
void setArrowsStuck(int arrows);
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Get the delay (in ticks) before blocking is effective for this entity
|
||||||
|
+ *
|
||||||
|
+ * @return Delay in ticks
|
||||||
|
+ */
|
||||||
|
+ int getShieldBlockingDelay();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Set the delay (in ticks) before blocking is effective for this entity
|
||||||
|
+ *
|
||||||
|
+ * @param delay Delay in ticks
|
||||||
|
+ */
|
||||||
|
+ void setShieldBlockingDelay(int delay);
|
||||||
|
// Paper end
|
||||||
|
}
|
||||||
|
--
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
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/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
|
index 03a9a96f..99ad40fa 100644
|
||||||
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||||
|
disableEnderpearlExploit = getBoolean("game-mechanics.disable-unloaded-chunk-enderpearl-exploit", disableEnderpearlExploit);
|
||||||
|
log("Disable Unloaded Chunk Enderpearl Exploit: " + (disableEnderpearlExploit ? "enabled" : "disabled"));
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public int shieldBlockingDelay = 5;
|
||||||
|
+ private void shieldBlockingDelay() {
|
||||||
|
+ shieldBlockingDelay = getInt("game-mechanics.shield-blocking-delay", 5);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
index 9adcabd4..65bc19b1 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||||
|
if (this.isHandRaised() && !this.activeItem.isEmpty()) {
|
||||||
|
Item item = this.activeItem.getItem();
|
||||||
|
|
||||||
|
- return item.f(this.activeItem) != EnumAnimation.BLOCK ? false : item.e(this.activeItem) - this.bp >= 5;
|
||||||
|
+ return item.f(this.activeItem) != EnumAnimation.BLOCK ? false : item.e(this.activeItem) - this.bp >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||||
|
public boolean cS() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Paper start
|
||||||
|
+ public int shieldBlockingDelay = world.paperConfig.shieldBlockingDelay;
|
||||||
|
+
|
||||||
|
+ public int getShieldBlockingDelay() {
|
||||||
|
+ return shieldBlockingDelay;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void setShieldBlockingDelay(int shieldBlockingDelay) {
|
||||||
|
+ this.shieldBlockingDelay = shieldBlockingDelay;
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
index a7b07637..14fb474f 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
--
|
||||||
Reference in New Issue
Block a user