3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-14 18:40:10 +01:00

deprecate and update some entity tags (#10932)

Dieser Commit ist enthalten in:
Lulu13022002 2024-06-21 18:51:00 +02:00 committet von GitHub
Ursprung 081146c56e
Commit 0409a68f50
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 10 neuen und 20 gelöschten Zeilen

Datei anzeigen

@ -841,7 +841,7 @@ index 0000000000000000000000000000000000000000..be212b4fbeabab32a4dab6ae554768c3
+}
diff --git a/src/main/java/io/papermc/paper/tag/BaseTag.java b/src/main/java/io/papermc/paper/tag/BaseTag.java
new file mode 100644
index 0000000000000000000000000000000000000000..262b7f7e2c3cf39006392dd5197d4595a0bfb507
index 0000000000000000000000000000000000000000..216a40c0c7830ce97b6767d3c70d3b1fd25c0510
--- /dev/null
+++ b/src/main/java/io/papermc/paper/tag/BaseTag.java
@@ -0,0 +1,184 @@
@ -884,7 +884,7 @@ index 0000000000000000000000000000000000000000..262b7f7e2c3cf39006392dd5197d4595
+ }
+
+ public BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Collection<T> values, @NotNull Predicate<T>... 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);
@ -1079,10 +1079,10 @@ index 0000000000000000000000000000000000000000..c89c4619aaf388197834d98eb95af2f1
+}
diff --git a/src/main/java/io/papermc/paper/tag/EntityTags.java b/src/main/java/io/papermc/paper/tag/EntityTags.java
new file mode 100644
index 0000000000000000000000000000000000000000..5376e51adf5af15572b0d760b17f2de6d3f24a9b
index 0000000000000000000000000000000000000000..bc07aaa5a001f8b58d0603d5db88f9c51064fd27
--- /dev/null
+++ b/src/main/java/io/papermc/paper/tag/EntityTags.java
@@ -0,0 +1,54 @@
@@ -0,0 +1,56 @@
+package io.papermc.paper.tag;
+
+import org.bukkit.NamespacedKey;
@ -1105,8 +1105,8 @@ index 0000000000000000000000000000000000000000..5376e51adf5af15572b0d760b17f2de6
+ * @see <a href="https://minecraft.wiki/wiki/Mob#Undead_mobs">https://minecraft.wiki/wiki/Mob#Undead_mobs</a>
+ */
+ 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..5376e51adf5af15572b0d760b17f2de6
+ /**
+ * Covers all water based mobs
+ * @see <a href="https://minecraft.wiki/wiki/Mob#Aquatic_mobs">https://minecraft.wiki/wiki/Mob#Aquatic_mobs</a>
+ * @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 e2a9b7db56e3048d1872f008a104bc33ddba98c3..b587897a26e9464b61a29e7482c60d2a66469571 100644

Datei anzeigen

@ -56,18 +56,6 @@ index b2ff1da3386223a544ab5fc363a90c66c8869242..8c7b50906fc5b84c5570408f35741081
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 8bfec649f7c6dda956bc388a21b489f3565ff384..a303bb1a8d8b5749de5d69d079383e6da2e446d1 100644
--- a/src/main/java/org/bukkit/Tag.java
+++ b/src/main/java/org/bukkit/Tag.java
@@ -1253,6 +1253,7 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla tag representing entities which can turn in boats.
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
Tag<EntityType> 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 8d2dd78fc588a6817dfede8040b9909a7d5bde67..f737a2aae3f57a1bfe4cf68ea66f603da4eebd47 100644
--- a/src/main/java/org/bukkit/block/Crafter.java