diff --git a/Spigot-API-Patches/Entity-Jump-API.patch b/Spigot-API-Patches/Entity-Jump-API.patch index b191070675..818e31d486 100644 --- a/Spigot-API-Patches/Entity-Jump-API.patch +++ b/Spigot-API-Patches/Entity-Jump-API.patch @@ -61,9 +61,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource - * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food) */ - boolean isHandRaised(); + @NotNull + org.bukkit.inventory.EquipmentSlot getHandRaised(); + + /** + * Get entity jump state. diff --git a/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch index 947d4b7701..7de09d651f 100644 --- a/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch @@ -48,5 +48,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food) + */ + boolean isHandRaised(); ++ ++ /** ++ * Gets the hand raised by this living entity. Will be either ++ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or ++ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}. ++ * ++ * @return the hand raised ++ */ ++ @NotNull ++ org.bukkit.inventory.EquipmentSlot getHandRaised(); // Paper end } diff --git a/Spigot-Server-Patches/Add-playPickupItemAnimation-to-LivingEntity.patch b/Spigot-Server-Patches/Add-playPickupItemAnimation-to-LivingEntity.patch index 8f44eec800..3c35084a97 100644 --- a/Spigot-Server-Patches/Add-playPickupItemAnimation-to-LivingEntity.patch +++ b/Spigot-Server-Patches/Add-playPickupItemAnimation-to-LivingEntity.patch @@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -0,0 +0,0 @@ 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); diff --git a/Spigot-Server-Patches/Entity-Jump-API.patch b/Spigot-Server-Patches/Entity-Jump-API.patch index 47219a7201..cbec4f8ca4 100644 --- a/Spigot-Server-Patches/Entity-Jump-API.patch +++ b/Spigot-Server-Patches/Entity-Jump-API.patch @@ -38,8 +38,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { - public boolean isHandRaised() { - return getHandle().isHandRaised(); + public org.bukkit.inventory.EquipmentSlot getHandRaised() { + return getHandle().getRaisedHand() == net.minecraft.world.EnumHand.MAIN_HAND ? org.bukkit.inventory.EquipmentSlot.HAND : org.bukkit.inventory.EquipmentSlot.OFF_HAND; } + + @Override @@ -55,6 +55,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ((EntityInsentient) getHandle()).getControllerJump().jump(); + } + } -+ // Paper end } diff --git a/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch index 2c0d3d8f81..5720ca4918 100644 --- a/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch @@ -58,6 +58,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public boolean isHandRaised() { + return getHandle().isHandRaised(); ++ } ++ ++ @Override ++ public org.bukkit.inventory.EquipmentSlot getHandRaised() { ++ return getHandle().getRaisedHand() == net.minecraft.world.EnumHand.MAIN_HAND ? org.bukkit.inventory.EquipmentSlot.HAND : org.bukkit.inventory.EquipmentSlot.OFF_HAND; + } // Paper end }