Paper/patches/server/0063-Add-methods-for-working-with-arrows-stuck-in-living-.patch
Jake Potrebic a73ed9572e
Updated Upstream (CraftBukkit/Spigot) (#9598)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
b76ceb4f5 PR-1235: Move EntityType return to base Entity class
e795d7490 SPIGOT-7458: Exception when Entity CommandSender executes Vanilla command
46c7fc3b1 SPIGOT-7452: Player#openSign cannot edit
d91e5aa0b SPIGOT-7447: Rewrite --forceUpgrade to minimise diff and properly handle CraftBukkit world layout
921ae06d6 Revert "SPIGOT-7447: Fix --forceUpgrade"

Spigot Changes:
94e187b5 Rebuild patches
3bce7935 SPIGOT-7091: Update bungeecord-chat
2023-08-13 16:32:51 -07:00

47 lines
1.8 KiB
Diff

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
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 b3fcbc3f5f0f8e9ca53fce85a4b86d4c292765df..bba6bce470a11c792bb2edc2171021437e2c9704 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -267,9 +267,15 @@ 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
}
@Override
@@ -783,4 +789,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
}