mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 19:52:55 +01:00
243d2313b9
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: 323d6ca3 #535: Add EntityCategory API to LivingEntity 7d3323d8 #526: Add Block#applyBoneMeal() CraftBukkit Changes:bf451617
SPIGOT-6109: Improve loot handlingbfea4559
SPIGOT-6111: NPE in CraftHumanEntity#openWorkbench & CraftHumanEntity#openEnchantingee7116b4
Add note to CONTRIBUTING.md to suggest keeping commit messages / titles the sameeae15943
#721: Add EntityCategory API to LivingEntity8c611560
#702: Add Block#applyBoneMeal()8408de02
#716: Fix barrel open API playing sound twice74b6982b
#711: Add Full RGB support to the console
52 lines
2 KiB
Diff
52 lines
2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Fri, 29 Jun 2018 00:19:19 -0400
|
|
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
|
|
|
|
How long an entity has raised hands to charge an attack or use an item
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
index 022a6ef9158db937291051d6c4dfbc27f747bc3d..069d9131406d7e29db56f51940a0809a0dd9e703 100644
|
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
@@ -12,6 +12,7 @@ import org.bukkit.attribute.Attributable;
|
|
import org.bukkit.block.Block;
|
|
import org.bukkit.entity.memory.MemoryKey;
|
|
import org.bukkit.inventory.EntityEquipment;
|
|
+import org.bukkit.inventory.ItemStack;
|
|
import org.bukkit.potion.PotionEffect;
|
|
import org.bukkit.potion.PotionEffectType;
|
|
import org.bukkit.projectiles.ProjectileSource;
|
|
@@ -600,5 +601,32 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
|
* @param delay Delay in ticks
|
|
*/
|
|
void setShieldBlockingDelay(int delay);
|
|
+
|
|
+ /**
|
|
+ * Get's the item being actively "used" or consumed.
|
|
+ * @return The item. Will be null if no active item.
|
|
+ */
|
|
+ @Nullable
|
|
+ ItemStack getActiveItem();
|
|
+
|
|
+ /**
|
|
+ * Get's remaining time a player needs to keep hands raised with an item to finish using it.
|
|
+ * @return Remaining ticks to use the item
|
|
+ */
|
|
+ int getItemUseRemainingTime();
|
|
+
|
|
+ /**
|
|
+ * Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
|
|
+ *
|
|
+ * @return Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
|
|
+ */
|
|
+ int getHandRaisedTime();
|
|
+
|
|
+ /**
|
|
+ * Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
|
|
+ *
|
|
+ * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
|
|
+ */
|
|
+ boolean isHandRaised();
|
|
// Paper end
|
|
}
|