From ffff490cc88b5b9893e4a0c056c7742528250757 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Fri, 21 Jun 2024 18:51:00 +0200 Subject: [PATCH] deprecate and update some entity tags (#10932) --- patches/api/Add-Material-Tags.patch | 12 +++++++----- patches/api/Experimental-annotations-change.patch | 12 ------------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/patches/api/Add-Material-Tags.patch b/patches/api/Add-Material-Tags.patch index 3c604aa8d4..d83b9beb90 100644 --- a/patches/api/Add-Material-Tags.patch +++ b/patches/api/Add-Material-Tags.patch @@ -884,7 +884,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + public BaseTag(@NotNull Class clazz, @NotNull NamespacedKey key, @NotNull Collection values, @NotNull Predicate... globalPredicates) { -+ this.key = key != null ? key : NamespacedKey.randomKey(); ++ this.key = key; + this.tagged = clazz.isEnum() ? createEnumSet(clazz) : new HashSet<>(); + this.tagged.addAll(values); + this.globalPredicates = Lists.newArrayList(globalPredicates); @@ -1105,8 +1105,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @see https://minecraft.wiki/wiki/Mob#Undead_mobs + */ + public static final EntitySetTag UNDEADS = new EntitySetTag(keyFor("undeads")) -+ .add(DROWNED, HUSK, PHANTOM, SKELETON, SKELETON_HORSE, STRAY, WITHER, WITHER_SKELETON, ZOGLIN, ZOMBIE, ZOMBIE_HORSE, ZOMBIE_VILLAGER, ZOMBIFIED_PIGLIN) -+ .ensureSize("UNDEADS", 13).lock(); ++ .add(DROWNED, HUSK, PHANTOM, SKELETON, SKELETON_HORSE, STRAY, WITHER, WITHER_SKELETON, ZOGLIN, ZOMBIE, ZOMBIE_HORSE, ZOMBIE_VILLAGER, ZOMBIFIED_PIGLIN, BOGGED) ++ .ensureSize("UNDEADS", 14).lock(); + + /** + * Covers all horses @@ -1132,10 +1132,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + /** + * Covers all water based mobs + * @see https://minecraft.wiki/wiki/Mob#Aquatic_mobs ++ * @deprecated in favour of {@link org.bukkit.Tag#ENTITY_TYPES_AQUATIC} + */ ++ @Deprecated + public static final EntitySetTag WATER_BASED = new EntitySetTag(keyFor("water_based")) -+ .add(AXOLOTL, DOLPHIN, SQUID, GLOW_SQUID, GUARDIAN, ELDER_GUARDIAN, TURTLE, COD, SALMON, PUFFERFISH, TROPICAL_FISH) -+ .ensureSize("WATER_BASED", 11).lock(); ++ .add(AXOLOTL, DOLPHIN, SQUID, GLOW_SQUID, GUARDIAN, ELDER_GUARDIAN, TURTLE, COD, SALMON, PUFFERFISH, TROPICAL_FISH, TADPOLE) ++ .ensureSize("WATER_BASED", 12).lock(); +} diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/api/Experimental-annotations-change.patch b/patches/api/Experimental-annotations-change.patch index 865a913cb2..9122059b35 100644 --- a/patches/api/Experimental-annotations-change.patch +++ b/patches/api/Experimental-annotations-change.patch @@ -56,18 +56,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ITEM_BUNDLE_REMOVE_ONE("item.bundle.remove_one"), ITEM_CHORUS_FRUIT_TELEPORT("item.chorus_fruit.teleport"), ITEM_CROP_PLANT("item.crop.plant"), -diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/Tag.java -+++ b/src/main/java/org/bukkit/Tag.java -@@ -0,0 +0,0 @@ public interface Tag extends Keyed { - /** - * Vanilla tag representing entities which can turn in boats. - */ -+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - Tag ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class); - /** - * Vanilla tag representing all entities sensitive to illager enchantments. diff --git a/src/main/java/org/bukkit/block/Crafter.java b/src/main/java/org/bukkit/block/Crafter.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/block/Crafter.java