2016-05-12 04:07:46 +02:00
|
|
|
From e1870e7610f50cc6024f509c899d00ab7fb198d8 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-05-12 04:07:46 +02:00
|
|
|
index 7fd8585..b151c13 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-05-12 04:07:46 +02:00
|
|
|
@@ -1284,10 +1284,12 @@ public abstract class EntityLiving extends Entity {
|
2016-03-09 05:21:08 +01:00
|
|
|
return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue();
|
|
|
|
}
|
|
|
|
|
2016-05-12 04:07:46 +02:00
|
|
|
+ public final int getStuckArrows() { return this.bY(); } // Paper // OBFHELPER
|
|
|
|
public final int bY() {
|
2016-03-09 05:21:08 +01:00
|
|
|
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-05-12 04:07:46 +02:00
|
|
|
index f13ca63..16da1c9 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-28 03:48:50 +02:00
|
|
|
@@ -553,4 +553,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
|
|
public boolean isCollidable() {
|
|
|
|
return getHandle().collides;
|
2016-03-09 05:21:08 +01:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public int getArrowsStuck() {
|
|
|
|
+ return this.getHandle().getStuckArrows();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setArrowsStuck(int arrows) {
|
|
|
|
+ this.getHandle().setStuckArrows(arrows);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
--
|
2016-05-12 04:07:46 +02:00
|
|
|
2.8.2
|
2016-03-09 05:21:08 +01:00
|
|
|
|