3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/Spigot-Server-Patches/0081-Add-methods-for-working-with-arrows-stuck-in-living-.patch
2016-03-09 19:48:14 -06:00

48 Zeilen
1.9 KiB
Diff

From 75bad843fd7489be586bd503a4e6f4155f13474a 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 b10475f..37d877e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1264,10 +1264,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 ebf378b..c9564bd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -503,4 +503,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public AttributeInstance getAttribute(Attribute attribute) {
return getHandle().craftAttributes.getAttribute(attribute);
}
+
+ // Paper start
+ @Override
+ public int getArrowsStuck() {
+ return this.getHandle().getStuckArrows();
+ }
+
+ @Override
+ public void setArrowsStuck(int arrows) {
+ this.getHandle().setStuckArrows(arrows);
+ }
+ // Paper end
}
--
2.7.2