diff options
Diffstat (limited to 'patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch')
-rw-r--r-- | patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch new file mode 100644 index 0000000000..4b2ba339c3 --- /dev/null +++ b/patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -0,0 +1,60 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: mrapple <[email protected]> +Date: Sun, 25 Nov 2012 13:43:39 -0600 +Subject: [PATCH] Add methods for working with arrows stuck in living entities + +Upstream added methods for this, original methods are now +deprecated + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index b34829d780d9f695b8109f4baed7cc251f2b6fdc..7d05d87e3c8ebbd65b15dcf09324e2e4f95959e5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -289,10 +289,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + } + + @Override +- public void setArrowsInBody(int count) { ++ public void setArrowsInBody(final int count, final boolean fireEvent) { // Paper + Preconditions.checkArgument(count >= 0, "New arrow amount must be >= 0"); ++ if (!fireEvent) { // Paper + this.getHandle().getEntityData().set(net.minecraft.world.entity.LivingEntity.DATA_ARROW_COUNT_ID, count); ++ // Paper start ++ } else { ++ this.getHandle().setArrowCount(count); ++ } ++ // Paper end ++ } ++ ++ // Paper start - Add methods for working with arrows stuck in living entities ++ @Override ++ public void setNextArrowRemoval(final int ticks) { ++ Preconditions.checkArgument(ticks >= 0, "New amount of ticks before next arrow removal must be >= 0"); ++ this.getHandle().removeArrowTime = ticks; ++ } ++ ++ @Override ++ public int getNextArrowRemoval() { ++ return this.getHandle().removeArrowTime; + } ++ // Paper end - Add methods for working with arrows stuck in living entities + + @Override + public boolean isInvulnerable() { +@@ -833,4 +852,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + this.getHandle().persistentInvisibility = invisible; + this.getHandle().setSharedFlag(5, invisible); + } ++ ++ // Paper start ++ @Override ++ public int getArrowsStuck() { ++ return this.getHandle().getArrowCount(); ++ } ++ ++ @Override ++ public void setArrowsStuck(final int arrows) { ++ this.getHandle().setArrowCount(arrows); ++ } ++ // Paper end + } |