From cccaa58b370ea1d06cb7c18f9c635dd0a91085e6 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 015caa7..946c925 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1264,10 +1264,12 @@ 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 5e1aec2..95965fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -521,4 +521,16 @@ 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 } -- 2.7.2