Paper/patches/api/0211-Add-playPickupItemAnimation-to-LivingEntity.patch
2023-02-19 08:57:10 -06: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 f76090f1f7ae7e3c026896b82e6379e5c2fd26fe..76fdfa7b00cb905163567a204a727cf047d9261a 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -965,5 +965,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
}