mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Add playPickupItemAnimation to LivingEntity
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
From 1628dc68442402b9fe5f25bbc0e94643a29fd7d6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sat, 19 Oct 2019 02:25:05 -0500
|
||||||
|
Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||||
|
|
||||||
|
---
|
||||||
|
.../java/org/bukkit/entity/LivingEntity.java | 17 +++++++++++++++++
|
||||||
|
1 file changed, 17 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
index 7196c1b79..5789b4584 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
@@ -731,5 +731,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||||
|
* @param jumping Jump state
|
||||||
|
*/
|
||||||
|
void setJumping(boolean jumping);
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Plays pickup item animation
|
||||||
|
+ *
|
||||||
|
+ * @param item Item to pickup
|
||||||
|
+ */
|
||||||
|
+ default void playPickupItemAnimation(@NotNull Item item) {
|
||||||
|
+ playPickupItemAnimation(item, item.getItemStack().getAmount());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Plays pickup item animation
|
||||||
|
+ *
|
||||||
|
+ * @param item Item to pickup
|
||||||
|
+ * @param quantity Quantity of item
|
||||||
|
+ */
|
||||||
|
+ void playPickupItemAnimation(@NotNull Item item, int quantity);
|
||||||
|
// Purpur end
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.23.0.rc1
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
From 6fefb38c58704df607767cb7d8fc8cee0e1430b1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sat, 19 Oct 2019 02:25:16 -0500
|
||||||
|
Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||||
|
|
||||||
|
---
|
||||||
|
.../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 +++++
|
||||||
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
index e408c89220..572d21b349 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
@@ -747,5 +747,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
|
((EntityInsentient) getHandle()).getControllerJump().jump();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
|
||||||
|
+ getHandle().receive(((CraftItem)item).getHandle(), quantity);
|
||||||
|
+ }
|
||||||
|
// Purpur end
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.23.0.rc1
|
||||||
|
|
||||||
Reference in New Issue
Block a user