mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 03:55:14 +01:00
Further clarify functionality of damageItemStack methods (#8878)
This commit is contained in:
parent
8b37e9e2aa
commit
ddc0a99f52
@ -8,10 +8,10 @@ to simulate damage done to an itemstack and all
|
||||
the logic associated with damaging them
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index f5a4160afb75549dd56a237cf99ec733efef9b4c..285b4028eb45439c052d6a2e9001a8c0bfacd49a 100644
|
||||
index f5a4160afb75549dd56a237cf99ec733efef9b4c..efcf093bc908a3a5711a06e579503100514f57aa 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1082,5 +1082,48 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -1082,5 +1082,52 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param directionZ The relative z position of the knockback source direction
|
||||
*/
|
||||
void knockback(double strength, double directionX, double directionZ);
|
||||
@ -38,21 +38,25 @@ index f5a4160afb75549dd56a237cf99ec733efef9b4c..285b4028eb45439c052d6a2e9001a8c0
|
||||
+ void broadcastSlotBreak(org.bukkit.inventory.@NotNull EquipmentSlot slot, @NotNull Collection<Player> players);
|
||||
+
|
||||
+ /**
|
||||
+ * Damages this itemstack by the specified amount. This
|
||||
+ * runs all logic associated with damaging an itemstack like
|
||||
+ * events and stat changes.
|
||||
+ * Damages the itemstack in this slot by the specified amount.
|
||||
+ * <p>
|
||||
+ * This runs all logic associated with damaging an itemstack like
|
||||
+ * gamemode and enchantment checks, events, stat changes, and advancement
|
||||
+ * triggers.
|
||||
+ *
|
||||
+ * @param stack the itemstack to damage
|
||||
+ * @param amount the amount of damage to do
|
||||
+ * @return the damaged itemstack, or an empty stack if it broke. It may be the same instance as the stack passed it, but it may not.
|
||||
+ * @return the damaged itemstack, or an empty stack if it broke. There are no
|
||||
+ * guarantees the returned itemstack is the same instance
|
||||
+ */
|
||||
+ @NotNull ItemStack damageItemStack(@NotNull ItemStack stack, int amount);
|
||||
+
|
||||
+ /**
|
||||
+ * Damages the itemstack in this slot by the specified amount.
|
||||
+ * <p>
|
||||
+ * This runs all logic associated with damaging an itemstack like
|
||||
+ * events, stat changes, and notifying clients to play
|
||||
+ * break animations.
|
||||
+ * gamemode and enchantment checks, events, stat changes, advancement
|
||||
+ * triggers, and notifying clients to play break animations.
|
||||
+ *
|
||||
+ * @param slot the slot of the stack to damage
|
||||
+ * @param amount the amount of damage to do
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Entity Body Yaw API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 6555397148b84dba7a87cae505544b65452f1742..1da1c293ac8a13d22743c26d35624155bfa73a16 100644
|
||||
index df91f612978dcea83a99f8403820cea1ab462c06..d045f41d929c6101060caf3a9fb48c8ffc036f16 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1125,5 +1125,21 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -1129,5 +1129,21 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param amount the amount of damage to do
|
||||
*/
|
||||
void damageItemStack(org.bukkit.inventory.@NotNull EquipmentSlot slot, int amount);
|
||||
|
Loading…
Reference in New Issue
Block a user