Paper/Spigot-Server-Patches/0076-Add-methods-for-working-with-arrows-stuck-in-living-.patch

48 lines
1.8 KiB
Diff

From d558be34000c9c6dd375cfca27aeb4a46d9719f0 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
index 342fcb7..d0e0285 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1279,10 +1279,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 aed3e4f..0502593 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -553,4 +553,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.8.0