13
0
geforkt von Mirrors/Paper
Paper/Spigot-Server-Patches/0072-Add-methods-for-working-with-arrows-stuck-in-living-.patch

48 Zeilen
1.8 KiB
Diff

From 93008463fc0aeff69213286894da86add44a934b 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
2016-06-23 04:18:41 +02:00
index 42ef70f..124811f 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
2016-06-09 05:57:14 +02:00
@@ -1307,10 +1307,12 @@ public abstract class EntityLiving extends Entity {
return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue();
}
2016-06-09 05:57:14 +02:00
+ public final int getStuckArrows() { return this.cb(); } // Paper - OBFHELPER
public final int cb() {
return ((Integer) this.datawatcher.get(EntityLiving.h)).intValue();
}
2016-06-09 05:57:14 +02:00
+ public final void setStuckArrows(int arrows) { this.f(arrows); } // Paper - OBFHELPER
public final void f(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
--- 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
}
--
2016-06-23 04:18:41 +02:00
2.9.0