aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0216-Add-playPickupItemAnimation-to-LivingEntity.patch
blob: 1416b1373a34fa443a92ee0d13985c4ee1427401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 5ab8db52160049e36464df4e20e374b8849ef29c..1b6c2b2cfb910e7651e7f18ea407e31db685af8a 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -822,5 +822,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
 }