testserver/Spigot-Server-Patches/0065-Add-methods-for-workin...

48 lines
1.8 KiB
Diff
Raw Normal View History

2017-01-28 23:36:03 +00:00
From 0682a1c8a0a5f078c6d72d7035fe17a64e6316e2 Mon Sep 17 00:00:00 2001
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
2017-01-28 23:36:03 +00:00
index a2d476818..193dadf43 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1380,10 +1380,12 @@ public abstract class EntityLiving extends Entity {
return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue();
}
2016-11-17 02:23:38 +00:00
+ public final int getStuckArrows() { return this.cc(); } // Paper - OBFHELPER
public final int cc() {
return ((Integer) this.datawatcher.get(EntityLiving.bq)).intValue();
}
2016-06-09 03:57:14 +00:00
+ public final void setStuckArrows(int arrows) { this.f(arrows); } // Paper - OBFHELPER
public final void f(int i) {
2016-11-17 02:23:38 +00:00
this.datawatcher.set(EntityLiving.bq, 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
2017-01-28 23:36:03 +00:00
index c1af8ddbd..392e72bb5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
2017-01-28 23:36:03 +00:00
@@ -560,4 +560,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public boolean isCollidable() {
return getHandle().collides;
}
+
+ // Paper start
+ @Override
+ public int getArrowsStuck() {
+ return this.getHandle().getStuckArrows();
+ }
+
+ @Override
+ public void setArrowsStuck(int arrows) {
+ this.getHandle().setStuckArrows(arrows);
+ }
+ // Paper end
}
--
2.11.0