2016-03-27 06:38:58 +00:00
|
|
|
From ea1fa24b9dba982cd21c482ccb91a2e870d7de54 Mon Sep 17 00:00:00 2001
|
2016-03-09 04:21:08 +00: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-26 06:38:02 +00:00
|
|
|
index 0891ff1..8be17ae 100644
|
2016-03-09 04:21:08 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2016-03-26 06:38:02 +00:00
|
|
|
@@ -1271,10 +1271,12 @@ public abstract class EntityLiving extends Entity {
|
2016-03-09 04:21:08 +00: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-27 06:38:58 +00:00
|
|
|
index 85c88b5..55bdd06 100644
|
2016-03-09 04:21:08 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2016-03-27 06:38:58 +00:00
|
|
|
@@ -543,4 +543,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
|
|
public boolean hasAI() {
|
|
|
|
return (this.getHandle() instanceof EntityInsentient) ? !((EntityInsentient) this.getHandle()).cR() : false; // PAIL: rename
|
2016-03-09 04:21:08 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public int getArrowsStuck() {
|
|
|
|
+ return this.getHandle().getStuckArrows();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setArrowsStuck(int arrows) {
|
|
|
|
+ this.getHandle().setStuckArrows(arrows);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
--
|
2016-03-26 06:38:02 +00:00
|
|
|
2.7.4
|
2016-03-09 04:21:08 +00:00
|
|
|
|