geforkt von Mirrors/Paper
48 Zeilen
1.8 KiB
Diff
48 Zeilen
1.8 KiB
Diff
From 8c3db58f89aa782429d2f32e0da3c3cf9f3d39a9 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 fe6fe3f..fbc20ba 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -1379,10 +1379,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 aaea4e8..2a77cd4 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -559,4 +559,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.9.3
|
|
|