From 0eb02b3760d23aa1d3d5879ee0a98e91caf1f908 Mon Sep 17 00:00:00 2001 From: Riley Park Date: Tue, 8 Mar 2016 20:21:08 -0800 Subject: [PATCH] Add methods for working with arrows stuck in living entities --- ...working-with-arrows-stuck-in-living-.patch | 32 +++++++++++++ ...working-with-arrows-stuck-in-living-.patch | 45 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch create mode 100644 Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch new file mode 100644 index 0000000000..f69fbf3cd8 --- /dev/null +++ b/Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: mrapple +Date: Sun, 25 Nov 2012 13:47:27 -0600 +Subject: [PATCH] Add methods for working with arrows stuck in living entities + + +diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 + * @return whether the operation was successful + */ + public boolean setLeashHolder(Entity holder); ++ ++ // Paper start ++ /** ++ * Get the number of arrows stuck in this entity ++ * ++ * @return Number of arrows stuck ++ */ ++ int getArrowsStuck(); ++ ++ /** ++ * Set the number of arrows stuck in this entity ++ * ++ * @param arrows Number of arrows to stick in this entity ++ */ ++ void setArrowsStuck(int arrows); ++ // Paper end + } +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch new file mode 100644 index 0000000000..bfb8f3d77d --- /dev/null +++ b/Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: mrapple +Date: Sun, 25 Nov 2012 13:43:39 -0600 +Subject: [PATCH] Add methods for working with arrows stuck in living entities + + +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 { + return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue(); + } + ++ public final int getStuckArrows() { return this.bX(); } // Paper - deobfuscation helper + public final int bX() { + return ((Integer) this.datawatcher.get(EntityLiving.h)).intValue(); + } + ++ public final void setStuckArrows(int arrows) { this.k(arrows); } // Paper - deobfuscation helper + public final void k(int i) { + this.datawatcher.set(EntityLiving.h, Integer.valueOf(i)); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 AttributeInstance getAttribute(Attribute attribute) { + return getHandle().craftAttributes.getAttribute(attribute); + } ++ ++ // Paper start ++ @Override ++ public int getArrowsStuck() { ++ return this.getHandle().getStuckArrows(); ++ } ++ ++ @Override ++ public void setArrowsStuck(int arrows) { ++ this.getHandle().setStuckArrows(arrows); ++ } ++ // Paper end + } +-- \ No newline at end of file