From e4ae7c57b7e7b06c04ffc61b37ffac2c639f0060 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 19 Sep 2021 14:50:54 +1000 Subject: [PATCH] SPIGOT-6738: Add entity type tags By: md_5 --- paper-api/src/main/java/org/bukkit/Tag.java | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Tag.java b/paper-api/src/main/java/org/bukkit/Tag.java index 53b66c28f0..c86ac9f44c 100644 --- a/paper-api/src/main/java/org/bukkit/Tag.java +++ b/paper-api/src/main/java/org/bukkit/Tag.java @@ -1,6 +1,7 @@ package org.bukkit; import java.util.Set; +import org.bukkit.entity.EntityType; import org.jetbrains.annotations.NotNull; /** @@ -585,6 +586,50 @@ public interface Tag extends Keyed { * Vanilla fluid tag representing water and flowing water. */ Tag FLUIDS_WATER = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("water"), Fluid.class); + /** + * Key for the built in entity registry. + */ + String REGISTRY_ENTITY_TYPES = "entity_types"; + /** + * Vanilla tag representing skeletons. + */ + Tag ENTITY_TYPES_SKELETONS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("skeletons"), EntityType.class); + /** + * Vanilla tag representing raiders. + */ + Tag ENTITY_TYPES_RAIDERS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("raiders"), EntityType.class); + /** + * Vanilla tag representing entities which can live in beehives. + */ + Tag ENTITY_TYPES_BEEHIVE_INHABITORS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("beehive_inhabitors"), EntityType.class); + /** + * Vanilla tag representing arrows. + */ + Tag ENTITY_TYPES_ARROWS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("arrows"), EntityType.class); + /** + * Vanilla tag representing projectiles. + */ + Tag ENTITY_TYPES_IMPACT_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("impact_projectiles"), EntityType.class); + /** + * Vanilla tag representing mobs which can walk on powder snow. + */ + Tag ENTITY_TYPES_POWDER_SNOW_WALKABLE_MOBS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("powder_snow_walkable_mobs"), EntityType.class); + /** + * Vanilla tag representing which entities axolotls are always hostile to. + */ + Tag ENTITY_TYPES_AXOLOTL_ALWAYS_HOSTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("axolotl_always_hostiles"), EntityType.class); + /** + * Vanilla tag representing axolotl targets. + */ + Tag ENTITY_TYPES_AXOLOTL_HUNT_TARGETS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("axolotl_hunt_targets"), EntityType.class); + /** + * Vanilla tag representing entities immune from freezing. + */ + Tag ENTITY_TYPES_FREEZE_IMMUNE_ENTITY_TYPES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("freeze_immune_entity_types"), EntityType.class); + /** + * Vanilla tag representing entities extra susceptible to freezing. + */ + Tag ENTITY_TYPES_FREEZE_HURTS_EXTRA_TYPES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("freeze_hurts_extra_types"), EntityType.class); /** * Returns whether or not this tag has an entry for the specified item.