Deprecate duplicate API for arrow stuck count (#8829)

This commit is contained in:
Jake Potrebic 2023-02-07 07:43:20 -08:00 committed by GitHub
parent 4da844f1e3
commit b9b4c9a314
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 126 additions and 72 deletions

View file

@ -3,12 +3,42 @@ From: mrapple <tony@oc.tc>
Date: Sun, 25 Nov 2012 13:47:27 -0600
Subject: [PATCH] Add methods for working with arrows stuck in living entities
Upstream added methods for this so the original methods
are now deprecated
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 2b816f0e6bdb912ceeff82c0043272b3970fe243..f00502b59f15c3a92ce18e7d1aa4e546fd45b16a 100644
index 2b816f0e6bdb912ceeff82c0043272b3970fe243..9977bb3cb5a66c84db816f8e4597db1c053f77c8 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -689,4 +689,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -215,12 +215,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
public int getArrowsInBody();
+ // Paper start
+ /**
+ * Set the amount of arrows in the entity's body.
+ * <p>
+ * Does not fire the {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent}.
+ *
+ * @param count amount of arrows in entity's body
+ */
+ default void setArrowsInBody(final int count) {
+ this.setArrowsInBody(count, false);
+ }
+ // Paper end
+
/**
* Set the amount of arrows in the entity's body.
*
* @param count amount of arrows in entity's body
+ * @param fireEvent whether to fire the {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent} event
*/
- public void setArrowsInBody(int count);
+ void setArrowsInBody(int count, boolean fireEvent); // Paper
/**
* Returns the living entity's current maximum no damage ticks.
@@ -689,4 +703,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @return Whether the entity is invisible
*/
public boolean isInvisible();
@ -17,14 +47,19 @@ index 2b816f0e6bdb912ceeff82c0043272b3970fe243..f00502b59f15c3a92ce18e7d1aa4e546
+ /**
+ * Get the number of arrows stuck in this entity
+ * @return Number of arrows stuck
+ * @deprecated use {@link #getArrowsInBody()}
+ */
+ @Deprecated
+ int getArrowsStuck();
+
+ /**
+ * Set the number of arrows stuck in this entity
+ *
+ * @param arrows Number of arrows to stick in this entity
+ * @deprecated use {@link #setArrowsInBody(int, boolean)}. <b>This method previously fired {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent} so if
+ * you want to retain exact functionality, pass {@code true} for {@code fireEvent}.</b>
+ */
+ @Deprecated
+ void setArrowsStuck(int arrows);
+ // Paper end
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] LivingEntity#setKiller
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index f00502b59f15c3a92ce18e7d1aa4e546fd45b16a..036936671d816fc553ad2fdf8324609ab610b7f5 100644
index 069711e792f92c2afa9dc661a2b14c55ffa54114..3489c719089e5cc0cc4710e8a06417c02dd76767 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -281,6 +281,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -295,6 +295,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@Nullable
public Player getKiller();

View file

@ -5,12 +5,12 @@ Subject: [PATCH] Make shield blocking delay configurable
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 036936671d816fc553ad2fdf8324609ab610b7f5..75629874849e4cdcf0465b653f27baaca5247fea 100644
index 3489c719089e5cc0cc4710e8a06417c02dd76767..81d89daf9691b5338b53bb7b0749ad802f5d026f 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -712,5 +712,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param arrows Number of arrows to stick in this entity
@@ -731,5 +731,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
@Deprecated
void setArrowsStuck(int arrows);
+
+ /**

View file

@ -20,10 +20,10 @@ index 13b74e942012169611f2791f8b4493d04710e4c0..9c711d0b2c2f7b0c0603847590e8a1a9
public ItemStack getItemInUse();
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 75629874849e4cdcf0465b653f27baaca5247fea..c80e75b72ac863db19e3d234e349876dd8797924 100644
index 81d89daf9691b5338b53bb7b0749ad802f5d026f..8241a89ac92845a2a8c2398dbeb76529abebd37c 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -726,5 +726,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -745,5 +745,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param delay Delay in ticks
*/
void setShieldBlockingDelay(int delay);

View file

@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..f0067c2e953d18e1a33536980071ba3f
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 98484c748db12dbdcdbe456befa30ad87864420b..3618a138a602fde4d3f045e9982dd95c0376b30d 100644
index affe38b8c04f71ff6ef60dced1a5e829324429af..eacb21bea254a104cc0ef2288e2f9886dc09d888 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -926,5 +926,25 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -945,5 +945,25 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
@NotNull
org.bukkit.inventory.EquipmentSlot getHandRaised();

View file

@ -5,10 +5,10 @@ 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 3618a138a602fde4d3f045e9982dd95c0376b30d..4b2bbeebe724682a53850f92872169d7cfbeb552 100644
index eacb21bea254a104cc0ef2288e2f9886dc09d888..1e510a40f48fdf1337cdd0cc8ec8bc378dab94da 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -946,5 +946,28 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -965,5 +965,28 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param jumping entity jump state
*/
void setJumping(boolean jumping);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 4b2bbeebe724682a53850f92872169d7cfbeb552..f52c7d2ac653dde284de8d83ebe034afa2cde90a 100644
index 1e510a40f48fdf1337cdd0cc8ec8bc378dab94da..194159adbab5e6ee86a07a9a67a3ca40e103f535 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -897,6 +897,13 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -916,6 +916,13 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@NotNull
org.bukkit.inventory.ItemStack getActiveItem();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Expose LivingEntity hurt direction
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index f52c7d2ac653dde284de8d83ebe034afa2cde90a..f44f510b3194c9716ec59caa195f83dde2b2773a 100644
index 194159adbab5e6ee86a07a9a67a3ca40e103f535..53a8d79788f2d9d4b46e6aece1d76863dd5fb727 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -976,5 +976,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -995,5 +995,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param quantity quantity of item
*/
void playPickupItemAnimation(@NotNull Item item, int quantity);

View file

@ -23,10 +23,10 @@ index aa534b1a9a1fb84a2fbd4b372f313bb4b63325fa..43b53c21af01e0f496c8aaacff82dfdf
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index f44f510b3194c9716ec59caa195f83dde2b2773a..21ca1df6b484390a644d1f0894ebcac0080ff570 100644
index 53a8d79788f2d9d4b46e6aece1d76863dd5fb727..a38606c07d681b210124949001c9439835d6d3c9 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -532,6 +532,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -546,6 +546,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
public boolean hasLineOfSight(@NotNull Entity other);

View file

@ -5,12 +5,12 @@ Subject: [PATCH] Stinger API
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 21ca1df6b484390a644d1f0894ebcac0080ff570..6f7483a86b713b7b85e595f55b167e1547bc4b8e 100644
index 9ab91154c74b5a3001cf4d5df1b4ae1e26508b60..27187efdbcf1cf20a53175f1177c16dc40acab3c 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -385,6 +385,36 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -399,6 +399,36 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
public void setArrowsInBody(int count);
void setArrowsInBody(int count, boolean fireEvent); // Paper
+ // Paper Start - Bee Stinger API
+ /**

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#swingHand(EquipmentSlot) convenience method
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 6f7483a86b713b7b85e595f55b167e1547bc4b8e..475fdef28596cf8454da58d04d4c4153719a4a68 100644
index 6512d2bf94adfc32046ddae25a7c2906db7b1441..15c803ad038585bf3c37e4504d53177d31850acf 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1033,5 +1033,23 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1052,5 +1052,23 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param hurtDirection hurt direction
*/
void setHurtDirection(float hurtDirection);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add entity knockback API
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 475fdef28596cf8454da58d04d4c4153719a4a68..1999cd1b1aaa23589da4e11cf80139b8e7a2a539 100644
index 15c803ad038585bf3c37e4504d53177d31850acf..b18a833019c81b8e46535a1b4c42ba3987a97c90 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1051,5 +1051,17 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1070,5 +1070,17 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
this.swingOffHand();
}
}

View file

@ -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 1999cd1b1aaa23589da4e11cf80139b8e7a2a539..c27aaec51ae4de593da4443e1e8a773e1b59aafa 100644
index b18a833019c81b8e46535a1b4c42ba3987a97c90..717c7419d872286e38b6919503ab0e6537c55387 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1063,5 +1063,48 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1082,5 +1082,48 @@ 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);