2016-03-16 08:21:39 +01:00
|
|
|
From fe207a679722e373b467c738106f8a5566bb9b8c Mon Sep 17 00:00:00 2001
|
2016-03-09 05:21:08 +01:00
|
|
|
From: mrapple <tony@oc.tc>
|
|
|
|
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
|
2016-03-16 08:21:39 +01:00
|
|
|
index d2f7cc2..e5d1fe0 100644
|
2016-03-09 05:21:08 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2016-03-12 21:23:17 +01:00
|
|
|
@@ -1265,10 +1265,12 @@ public abstract class EntityLiving extends Entity {
|
2016-03-09 05:21:08 +01:00
|
|
|
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
|
2016-03-12 21:23:17 +01:00
|
|
|
index 6f25d18..693d5cb 100644
|
2016-03-09 05:21:08 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2016-03-12 21:23:17 +01:00
|
|
|
@@ -531,4 +531,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2016-03-09 05:21:08 +01:00
|
|
|
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
|
|
|
|
|