From ac4b9756ce60d3bf705411746a956e86f758dd3c Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 22 Sep 2021 10:23:21 -0700 Subject: [PATCH] Fix upstream nullability on entity equipment getters (#6519) --- patches/api/Add-Mob-lookAt-API.patch | 2 +- patches/api/Add-sun-related-API.patch | 2 +- ...Allow-disabling-armour-stand-ticking.patch | 6 +-- patches/api/Fix-upstream-javadocs.patch | 44 +++++++++++++++++++ patches/api/Mob-Pathfinding-API.patch | 14 +++--- 5 files changed, 55 insertions(+), 13 deletions(-) diff --git a/patches/api/Add-Mob-lookAt-API.patch b/patches/api/Add-Mob-lookAt-API.patch index 6a61e428a0..ba87ab0181 100644 --- a/patches/api/Add-Mob-lookAt-API.patch +++ b/patches/api/Add-Mob-lookAt-API.patch @@ -95,5 +95,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ + int getMaxHeadPitch(); // Paper end - /** + * Instructs this Mob to set the specified LivingEntity as its target. diff --git a/patches/api/Add-sun-related-API.patch b/patches/api/Add-sun-related-API.patch index c39ae9ba06..4674cf2fec 100644 --- a/patches/api/Add-sun-related-API.patch +++ b/patches/api/Add-sun-related-API.patch @@ -41,5 +41,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ + boolean isInDaylight(); // Paper end - /** + * Instructs this Mob to set the specified LivingEntity as its target. diff --git a/patches/api/Allow-disabling-armour-stand-ticking.patch b/patches/api/Allow-disabling-armour-stand-ticking.patch index 722fc385c3..97dc760578 100644 --- a/patches/api/Allow-disabling-armour-stand-ticking.patch +++ b/patches/api/Allow-disabling-armour-stand-ticking.patch @@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -0,0 +0,0 @@ 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(); + + /** + * Tests if this armor stand can tick. diff --git a/patches/api/Fix-upstream-javadocs.patch b/patches/api/Fix-upstream-javadocs.patch index 6e5456757a..8e94854f30 100644 --- a/patches/api/Fix-upstream-javadocs.patch +++ b/patches/api/Fix-upstream-javadocs.patch @@ -31,6 +31,50 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * * @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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/ArmorStand.java ++++ b/src/main/java/org/bukkit/entity/ArmorStand.java +@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/HumanEntity.java ++++ b/src/main/java/org/bukkit/entity/HumanEntity.java +@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Mob.java ++++ b/src/main/java/org/bukkit/entity/Mob.java +@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Player.java diff --git a/patches/api/Mob-Pathfinding-API.patch b/patches/api/Mob-Pathfinding-API.patch index a8edb05ffd..dd6a0bc1c2 100644 --- a/patches/api/Mob-Pathfinding-API.patch +++ b/patches/api/Mob-Pathfinding-API.patch @@ -241,19 +241,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.jetbrains.annotations.Nullable; /** -@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; - */ - public interface Mob extends LivingEntity, Lootable { - -+ // Paper start +@@ -0,0 +0,0 @@ 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. - *