From 6084ac368f577f6534f1c9340fd99738663be062 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Wed, 22 Sep 2021 10:23:21 -0700 Subject: [PATCH] Fix upstream nullability on entity equipment getters (#6519) --- patches/api/0053-Fix-upstream-javadocs.patch | 44 +++++++++++++++++++ .../0059-Shoulder-Entities-Release-API.patch | 4 +- ...d-method-to-open-already-placed-sign.patch | 4 +- .../0119-InventoryCloseEvent-Reason-API.patch | 4 +- ...Allow-disabling-armour-stand-ticking.patch | 10 ++--- patches/api/0130-Expand-ArmorStand-API.patch | 4 +- patches/api/0150-Mob-Pathfinding-API.patch | 16 +++---- patches/api/0159-Add-sun-related-API.patch | 6 +-- patches/api/0206-Potential-bed-API.patch | 4 +- ...al-open-container-api-to-HumanEntity.patch | 4 +- ...-add-isDeeplySleeping-to-HumanEntity.patch | 4 +- patches/api/0307-Add-Mob-lookAt-API.patch | 6 +-- 12 files changed, 76 insertions(+), 34 deletions(-) diff --git a/patches/api/0053-Fix-upstream-javadocs.patch b/patches/api/0053-Fix-upstream-javadocs.patch index 2f2c092e6e..0e867f42d0 100644 --- a/patches/api/0053-Fix-upstream-javadocs.patch +++ b/patches/api/0053-Fix-upstream-javadocs.patch @@ -31,6 +31,50 @@ index 1d13a4c289e6a764b3b080455a86e17a5e60929e..294b6092b438ad3d09bf3ad28d08ffdf * * @return an array containing all previous players */ +diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java +index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c47609c05 100644 +--- a/src/main/java/org/bukkit/entity/ArmorStand.java ++++ b/src/main/java/org/bukkit/entity/ArmorStand.java +@@ -360,5 +360,8 @@ public interface ArmorStand extends LivingEntity { + * @param move {@code true} if this armour stand can move, {@code false} otherwise + */ + void setCanMove(boolean move); ++ ++ @Override ++ org.bukkit.inventory.@NotNull EntityEquipment getEquipment(); + // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java +index db4ba67618d29f72d695c66c27d771795565a1d0..0ab94ddd3b88eee8040233a89823bd2fadc78d55 100644 +--- a/src/main/java/org/bukkit/entity/HumanEntity.java ++++ b/src/main/java/org/bukkit/entity/HumanEntity.java +@@ -21,6 +21,11 @@ import org.jetbrains.annotations.Nullable; + */ + public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder { + ++ // Paper start ++ @Override ++ org.bukkit.inventory.@NotNull EntityEquipment getEquipment(); ++ // Paper end ++ + /** + * Returns the name of this player + * +diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java +index be9334a8b5fba9181ad63c211697e798be63da25..0514a141cb93a650be38c63d4336d46e4304f4b6 100644 +--- a/src/main/java/org/bukkit/entity/Mob.java ++++ b/src/main/java/org/bukkit/entity/Mob.java +@@ -8,6 +8,10 @@ import org.jetbrains.annotations.Nullable; + */ + public interface Mob extends LivingEntity, Lootable { + ++ // Paper start ++ @Override ++ org.bukkit.inventory.@org.jetbrains.annotations.NotNull EntityEquipment getEquipment(); ++ // Paper end + /** + * Instructs this Mob to set the specified LivingEntity as its target. + *

diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 9d5c5b5f7d7ae4f0278410833d9d385242872498..2301a5c6ada86b63b1c0207a6d89b0da4c167bbb 100644 --- a/src/main/java/org/bukkit/entity/Player.java diff --git a/patches/api/0059-Shoulder-Entities-Release-API.patch b/patches/api/0059-Shoulder-Entities-Release-API.patch index 0cb4374499..24c7419ce5 100644 --- a/patches/api/0059-Shoulder-Entities-Release-API.patch +++ b/patches/api/0059-Shoulder-Entities-Release-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index db4ba67618d29f72d695c66c27d771795565a1d0..f748e3d3836df4da76fa883a51b9582bc31a4f8c 100644 +index 0ab94ddd3b88eee8040233a89823bd2fadc78d55..396092fd249928ca01133eeeeb61f0ad90b2e332 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -310,6 +310,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -315,6 +315,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getExpToLevel(); diff --git a/patches/api/0093-Add-method-to-open-already-placed-sign.patch b/patches/api/0093-Add-method-to-open-already-placed-sign.patch index bd472de2f2..4188bded0b 100644 --- a/patches/api/0093-Add-method-to-open-already-placed-sign.patch +++ b/patches/api/0093-Add-method-to-open-already-placed-sign.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index f748e3d3836df4da76fa883a51b9582bc31a4f8c..a46cefbb0508c192fdfefd685c7ad3973bb9c0c9 100644 +index 396092fd249928ca01133eeeeb61f0ad90b2e332..5cc025b69c4f405be8f7098d0dcef40fa522b39f 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -471,6 +471,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -476,6 +476,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ @Deprecated public void setShoulderEntityRight(@Nullable Entity entity); diff --git a/patches/api/0119-InventoryCloseEvent-Reason-API.patch b/patches/api/0119-InventoryCloseEvent-Reason-API.patch index a674e86b30..63ddfc1a2d 100644 --- a/patches/api/0119-InventoryCloseEvent-Reason-API.patch +++ b/patches/api/0119-InventoryCloseEvent-Reason-API.patch @@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index a46cefbb0508c192fdfefd685c7ad3973bb9c0c9..66f11e9670770e05a164922cc0f2aa863c066203 100644 +index 5cc025b69c4f405be8f7098d0dcef40fa522b39f..1d573d33304e9c15a9949af68dab0626ae04dce4 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -153,6 +153,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -158,6 +158,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public void closeInventory(); diff --git a/patches/api/0127-Allow-disabling-armour-stand-ticking.patch b/patches/api/0127-Allow-disabling-armour-stand-ticking.patch index 917b4de199..1bb68e268b 100644 --- a/patches/api/0127-Allow-disabling-armour-stand-ticking.patch +++ b/patches/api/0127-Allow-disabling-armour-stand-ticking.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 91fc11dda99de506be83d40df8929bf7cd8e8d85..bf7ded92ed2d39f57bc828a6290a8e9e7afe3a0c 100644 +index 7dc631ebd009f5f5c3ac1699c3f3515c47609c05..2ee3814a52945f541e049b621b9552f8ae9e261d 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java -@@ -360,5 +360,21 @@ public interface ArmorStand extends LivingEntity { - * @param move {@code true} if this armour stand can move, {@code false} otherwise - */ - void setCanMove(boolean move); +@@ -363,5 +363,21 @@ public interface ArmorStand extends LivingEntity { + + @Override + org.bukkit.inventory.@NotNull EntityEquipment getEquipment(); + + /** + * Tests if this armor stand can tick. diff --git a/patches/api/0130-Expand-ArmorStand-API.patch b/patches/api/0130-Expand-ArmorStand-API.patch index 60fe1451e8..a05dd67b88 100644 --- a/patches/api/0130-Expand-ArmorStand-API.patch +++ b/patches/api/0130-Expand-ArmorStand-API.patch @@ -8,7 +8,7 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index bf7ded92ed2d39f57bc828a6290a8e9e7afe3a0c..21c8ec6d8b795799b5b110be57ffd27fc8dcabe3 100644 +index 2ee3814a52945f541e049b621b9552f8ae9e261d..707639096657f995cc812c7b50108eeed48e8181 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -14,7 +14,7 @@ public interface ArmorStand extends LivingEntity { @@ -29,7 +29,7 @@ index bf7ded92ed2d39f57bc828a6290a8e9e7afe3a0c..21c8ec6d8b795799b5b110be57ffd27f */ @Deprecated void setItemInHand(@Nullable ItemStack item); -@@ -376,5 +376,71 @@ public interface ArmorStand extends LivingEntity { +@@ -379,5 +379,71 @@ public interface ArmorStand extends LivingEntity { * @param tick {@code true} if this armour stand can tick, {@code false} otherwise */ void setCanTick(final boolean tick); diff --git a/patches/api/0150-Mob-Pathfinding-API.patch b/patches/api/0150-Mob-Pathfinding-API.patch index 8408100069..5a234bb7e6 100644 --- a/patches/api/0150-Mob-Pathfinding-API.patch +++ b/patches/api/0150-Mob-Pathfinding-API.patch @@ -230,7 +230,7 @@ index 0000000000000000000000000000000000000000..e2a6f9c3881ff9d7373ac30e60009200 + } +} diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index be9334a8b5fba9181ad63c211697e798be63da25..b132287817d35579ca5128a1ed5c242bf229771a 100644 +index 0514a141cb93a650be38c63d4336d46e4304f4b6..cc30b4e22ee238de13f031398fc566f4123694ff 100644 --- a/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java @@ -1,6 +1,7 @@ @@ -241,19 +241,17 @@ index be9334a8b5fba9181ad63c211697e798be63da25..b132287817d35579ca5128a1ed5c242b import org.jetbrains.annotations.Nullable; /** -@@ -8,6 +9,15 @@ import org.jetbrains.annotations.Nullable; - */ - public interface Mob extends LivingEntity, Lootable { - -+ // Paper start +@@ -11,6 +12,13 @@ public interface Mob extends LivingEntity, Lootable { + // Paper start + @Override + org.bukkit.inventory.@org.jetbrains.annotations.NotNull EntityEquipment getEquipment(); ++ + /** + * Enables access to control the pathing of an Entity + * @return Pathfinding Manager for this entity + */ + @NotNull + com.destroystokyo.paper.entity.Pathfinder getPathfinder(); -+ // Paper end -+ + // Paper end /** * Instructs this Mob to set the specified LivingEntity as its target. - *

diff --git a/patches/api/0159-Add-sun-related-API.patch b/patches/api/0159-Add-sun-related-API.patch index 020695c84b..1f99757dd8 100644 --- a/patches/api/0159-Add-sun-related-API.patch +++ b/patches/api/0159-Add-sun-related-API.patch @@ -26,10 +26,10 @@ index 2a371a93c99cb034df897fa82d816ee852a2c4e7..f2dc2c9138c3e2e3431837cb24307be8 * Gets the full in-game time on this world since the world generation * diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index b132287817d35579ca5128a1ed5c242bf229771a..d726453c041a980576312b6bee96a07837f37974 100644 +index cc30b4e22ee238de13f031398fc566f4123694ff..55c5227a340e34621160afc9fae3ea843492881d 100644 --- a/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java -@@ -16,6 +16,13 @@ public interface Mob extends LivingEntity, Lootable { +@@ -19,6 +19,13 @@ public interface Mob extends LivingEntity, Lootable { */ @NotNull com.destroystokyo.paper.entity.Pathfinder getPathfinder(); @@ -41,5 +41,5 @@ index b132287817d35579ca5128a1ed5c242bf229771a..d726453c041a980576312b6bee96a078 + */ + boolean isInDaylight(); // Paper end - /** + * Instructs this Mob to set the specified LivingEntity as its target. diff --git a/patches/api/0206-Potential-bed-API.patch b/patches/api/0206-Potential-bed-API.patch index 1e630dff90..0a28d99471 100644 --- a/patches/api/0206-Potential-bed-API.patch +++ b/patches/api/0206-Potential-bed-API.patch @@ -8,10 +8,10 @@ Adds a new method to fetch the location of a player's bed without generating any getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 66f11e9670770e05a164922cc0f2aa863c066203..c307a58b17324d6df8c21fa45f0f1e34810f1828 100644 +index 1d573d33304e9c15a9949af68dab0626ae04dce4..9cb7a9b1e1d7c20760a54bdf6aea346828ad8fc7 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -240,6 +240,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -245,6 +245,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getSleepTicks(); diff --git a/patches/api/0226-Add-additional-open-container-api-to-HumanEntity.patch b/patches/api/0226-Add-additional-open-container-api-to-HumanEntity.patch index 52fe9f1bc3..a1edb0f80a 100644 --- a/patches/api/0226-Add-additional-open-container-api-to-HumanEntity.patch +++ b/patches/api/0226-Add-additional-open-container-api-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add additional open container api to HumanEntity diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index c307a58b17324d6df8c21fa45f0f1e34810f1828..112c891e54e8f30ac10e6865efc2a8ee8d172188 100644 +index 9cb7a9b1e1d7c20760a54bdf6aea346828ad8fc7..aae6331de24c1a65e3f708cfdc3890364bc8e681 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -148,6 +148,92 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -153,6 +153,92 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder @Nullable public InventoryView openMerchant(@NotNull Merchant merchant, boolean force); diff --git a/patches/api/0286-add-isDeeplySleeping-to-HumanEntity.patch b/patches/api/0286-add-isDeeplySleeping-to-HumanEntity.patch index cc4e80e8a0..90704b46d5 100644 --- a/patches/api/0286-add-isDeeplySleeping-to-HumanEntity.patch +++ b/patches/api/0286-add-isDeeplySleeping-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add isDeeplySleeping to HumanEntity diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 112c891e54e8f30ac10e6865efc2a8ee8d172188..0ad7a3d4d40d58eb950e34668f9554bb73f934fb 100644 +index aae6331de24c1a65e3f708cfdc3890364bc8e681..28d1ff809e44bda0324ffac957c1d455be02e783 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -319,6 +319,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -324,6 +324,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public void setCooldown(@NotNull Material material, int ticks); diff --git a/patches/api/0307-Add-Mob-lookAt-API.patch b/patches/api/0307-Add-Mob-lookAt-API.patch index b1a75288cb..26177f2369 100644 --- a/patches/api/0307-Add-Mob-lookAt-API.patch +++ b/patches/api/0307-Add-Mob-lookAt-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Mob#lookAt API diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index d726453c041a980576312b6bee96a07837f37974..7d4ce660adb21e579e564796568945ee20f0ca59 100644 +index 55c5227a340e34621160afc9fae3ea843492881d..07bedbc15ba2463d3c629ae68d229286d4033f79 100644 --- a/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java -@@ -23,6 +23,88 @@ public interface Mob extends LivingEntity, Lootable { +@@ -26,6 +26,88 @@ public interface Mob extends LivingEntity, Lootable { * @return True if mob is exposed to daylight */ boolean isInDaylight(); @@ -95,5 +95,5 @@ index d726453c041a980576312b6bee96a07837f37974..7d4ce660adb21e579e564796568945ee + */ + int getMaxHeadPitch(); // Paper end - /** + * Instructs this Mob to set the specified LivingEntity as its target.