Paper/Spigot-API-Patches/0220-Add-playPickupItemAnimation-to-LivingEntity.patch
Aikar ce2eae5ce3
[Auto] Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
b56e8160 #519: Add ArrowBodyCountChangeEvent

CraftBukkit Changes:
39806409e #697: Add ArrowBodyCountChangeEvent
2020-09-02 05:12:25 -04:00

40 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 23 Aug 2020 19:36:08 +0200
Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index d225a59f149cdc770ee3243f9604291c28f5a2ed..f3813210e63d9859c0461833a502b43361a2e134 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -791,5 +791,28 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param jumping entity jump state
*/
void setJumping(boolean jumping);
+
+ /**
+ * Plays pickup item animation towards this entity.
+ * <p/>
+ * <b>This will remove the item on the client.</b>
+ * <p/>
+ * Quantity is inferred to be that of the {@link Item}.
+ *
+ * @param item item to pickup
+ */
+ default void playPickupItemAnimation(@NotNull Item item) {
+ playPickupItemAnimation(item, item.getItemStack().getAmount());
+ }
+
+ /**
+ * Plays pickup item animation towards this entity.
+ * <p/>
+ * <b>This will remove the item on the client.</b>
+ *
+ * @param item item to pickup
+ * @param quantity quantity of item
+ */
+ void playPickupItemAnimation(@NotNull Item item, int quantity);
// Paper end
}