geforkt von Mirrors/Paper
Merge pull request #71 from kashike/feature/what-are-these-pokey-things-OH-MY-GOD-HELP-THEY-HURT
Dieser Commit ist enthalten in:
Commit
4fba7d5bdc
@ -0,0 +1,32 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: mrapple <tony@oc.tc>
|
||||
Date: Sun, 25 Nov 2012 13:47:27 -0600
|
||||
Subject: [PATCH] Add methods for working with arrows stuck in living entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti
|
||||
* @return whether the operation was successful
|
||||
*/
|
||||
public boolean setLeashHolder(Entity holder);
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Get the number of arrows stuck in this entity
|
||||
+ *
|
||||
+ * @return Number of arrows stuck
|
||||
+ */
|
||||
+ int getArrowsStuck();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the number of arrows stuck in this entity
|
||||
+ *
|
||||
+ * @param arrows Number of arrows to stick in this entity
|
||||
+ */
|
||||
+ void setArrowsStuck(int arrows);
|
||||
+ // Paper end
|
||||
}
|
||||
--
|
@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
}
|
||||
--
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren