Paper/Spigot-Server-Patches/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch
Zach Brown 974b0afca9
Remove last bit of chunk exists region file fix
CraftBukkit removed their implementation that caused this issue,
switching to Mojang's implementation which doesn't appear to share it. I
already removed the important bit in the last upstream merge, this is
just unused and unnecessary now. So we remove it.
2017-04-29 05:27:31 -05:00

48 lines
1.8 KiB
Diff

From b8425c39d7e6296671d9ddc5862172ab9da70d57 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 e5fa1c3ba..247224117 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();
}
+ public final int getStuckArrows() { return this.cc(); } // Paper - OBFHELPER
public final int cc() {
return ((Integer) this.datawatcher.get(EntityLiving.bq)).intValue();
}
+ public final void setStuckArrows(int arrows) { this.f(arrows); } // Paper - OBFHELPER
public final void f(int i) {
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
index 61032eb2f..348a8c758 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -572,4 +572,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.12.2.windows.2