Skip to content

Commit

Permalink
use new PropertyParser tag registration format (automated change)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 21, 2022
1 parent 0c71076 commit 6f53755
Show file tree
Hide file tree
Showing 102 changed files with 165 additions and 169 deletions.
Expand Up @@ -45,7 +45,7 @@ public static void registerTags() {
// @description
// Returns whether a ranged mob (skeleton, stray, wither skeleton, drowned, illusioner, or piglin) is "charging" up an attack (its arms are raised).
// -->
PropertyParser.<EntityArmsRaised, ElementTag>registerTag(ElementTag.class, "arms_raised", (attribute, object) -> {
PropertyParser.registerTag(EntityArmsRaised.class, ElementTag.class, "arms_raised", (attribute, object) -> {
return new ElementTag(object.getRanged().isChargingAttack());
});
}
Expand Down
Expand Up @@ -46,7 +46,7 @@ public static void registerTags() {
// Returns whether a falling_block will auto-expire (after 30 seconds, or 5 when outside the world).
// See also <@link tag EntityTag.time_lived>
// -->
PropertyParser.<EntityAutoExpire, ElementTag>registerTag(ElementTag.class, "auto_expire", (attribute, object) -> {
PropertyParser.registerTag(EntityAutoExpire.class, ElementTag.class, "auto_expire", (attribute, object) -> {
return new ElementTag(object.doesAutoExpire());
});
}
Expand Down
Expand Up @@ -53,7 +53,7 @@ public static void registerTags() {
// @description
// If the entity is an armor stand, returns whether the armor stand can tick.
// -->
PropertyParser.<EntityCanTick, ElementTag>registerTag(ElementTag.class, "can_tick", (attribute, entity) -> {
PropertyParser.registerTag(EntityCanTick.class, ElementTag.class, "can_tick", (attribute, entity) -> {
return new ElementTag(((ArmorStand) entity.entity.getBukkitEntity()).canTick());
});
}
Expand Down
Expand Up @@ -45,7 +45,7 @@ public static void registerTags() {
// @description
// If the entity is a turtle, returns whether it is carrying an egg. A turtle that is carrying an egg isn't visually different, but can't breed and will eventually lay the egg.
// -->
PropertyParser.<EntityCarryingEgg, ElementTag>registerTag(ElementTag.class, "carrying_egg", (attribute, entity) -> {
PropertyParser.registerTag(EntityCarryingEgg.class, ElementTag.class, "carrying_egg", (attribute, entity) -> {
return new ElementTag(((Turtle) entity.entity.getBukkitEntity()).hasEgg());
});
}
Expand Down
Expand Up @@ -47,7 +47,7 @@ public static void registerTags() {
// @description
// Returns the potion item a witch is drinking, or air if none.
// -->
PropertyParser.<EntityDrinkingPotion, ItemTag>registerTag(ItemTag.class, "drinking_potion", (attribute, object) -> {
PropertyParser.registerTag(EntityDrinkingPotion.class, ItemTag.class, "drinking_potion", (attribute, object) -> {
return new ItemTag(object.getWitch().getDrinkingPotion());
});

Expand All @@ -60,7 +60,7 @@ public static void registerTags() {
// @description
// Returns the duration remaining until a witch is done drinking a potion.
// -->
PropertyParser.<EntityDrinkingPotion, DurationTag>registerTag(DurationTag.class, "potion_drink_duration", (attribute, object) -> {
PropertyParser.registerTag(EntityDrinkingPotion.class, DurationTag.class, "potion_drink_duration", (attribute, object) -> {
return new DurationTag((long) object.getWitch().getPotionUseTimeLeft());
});
}
Expand Down
Expand Up @@ -45,7 +45,7 @@ public static void registerTags() {
// @description
// Returns the duration remaining until the wither becomes vulnerable.
// -->
PropertyParser.<EntityWitherInvulnerable, DurationTag>registerTag(DurationTag.class, "invulnerable_duration", (attribute, object) -> {
PropertyParser.registerTag(EntityWitherInvulnerable.class, DurationTag.class, "invulnerable_duration", (attribute, object) -> {
return new DurationTag((long) object.getWither().getInvulnerableTicks());
});
}
Expand Down
Expand Up @@ -74,7 +74,7 @@ public static void registerTags() {
// Returns a map of basic armor stand data, with keys matching EntityTag property names.
// Keys: base_plate, visible, marker, is_small, arms
// -->
PropertyParser.<ItemArmorStand, MapTag>registerTag(MapTag.class, "armor_stand_data", (attribute, item) -> {
PropertyParser.registerTag(ItemArmorStand.class, MapTag.class, "armor_stand_data", (attribute, item) -> {
return item.getDataMap();
});
}
Expand Down
Expand Up @@ -61,7 +61,7 @@ public static void registerTags() {
// Returns the entity's spawn reason.
// Valid spawn reasons can be found at <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html>
// -->
PropertyParser.<PaperEntityProperties, ElementTag>registerTag(ElementTag.class, "spawn_reason", (attribute, entity) -> {
PropertyParser.registerTag(PaperEntityProperties.class, ElementTag.class, "spawn_reason", (attribute, entity) -> {
return new ElementTag(entity.entity.getBukkitEntity().getEntitySpawnReason().name());
});

Expand All @@ -74,7 +74,7 @@ public static void registerTags() {
// If the entity is an experience orb, returns its spawn reason.
// Valid spawn reasons can be found at <@link url https://papermc.io/javadocs/paper/1.17/org/bukkit/entity/ExperienceOrb.SpawnReason.html>
// -->
PropertyParser.<PaperEntityProperties, ElementTag>registerTag(ElementTag.class, "xp_spawn_reason", (attribute, entity) -> {
PropertyParser.registerTag(PaperEntityProperties.class, ElementTag.class, "xp_spawn_reason", (attribute, entity) -> {
if (!(entity.entity.getBukkitEntity() instanceof ExperienceOrb)) {
attribute.echoError("Entity " + entity.entity + " is not an experience orb.");
return null;
Expand All @@ -91,7 +91,7 @@ public static void registerTags() {
// If the entity is an experience orb, returns the entity that triggered it spawning (if any).
// For example, if a player killed an entity this would return the player.
// -->
PropertyParser.<PaperEntityProperties, EntityFormObject>registerTag(EntityFormObject.class, "xp_trigger", (attribute, entity) -> {
PropertyParser.registerTag(PaperEntityProperties.class, EntityFormObject.class, "xp_trigger", (attribute, entity) -> {
if (!(entity.entity.getBukkitEntity() instanceof ExperienceOrb)) {
attribute.echoError("Entity " + entity.entity + " is not an experience orb.");
return null;
Expand All @@ -116,7 +116,7 @@ public static void registerTags() {
// If the entity is an experience orb, returns the entity that it was created from (if any).
// For example, if the xp orb was spawned from breeding this would return the baby.
// -->
PropertyParser.<PaperEntityProperties, EntityFormObject>registerTag(EntityFormObject.class, "xp_source", (attribute, entity) -> {
PropertyParser.registerTag(PaperEntityProperties.class, EntityFormObject.class, "xp_source", (attribute, entity) -> {
if (!(entity.entity.getBukkitEntity() instanceof ExperienceOrb)) {
attribute.echoError("Entity " + entity.entity + " is not an experience orb.");
return null;
Expand All @@ -140,7 +140,7 @@ public static void registerTags() {
// @description
// Returns the initial spawn location of this entity.
// -->
PropertyParser.<PaperEntityProperties, LocationTag>registerTag(LocationTag.class, "spawn_location", (attribute, entity) -> {
PropertyParser.registerTag(PaperEntityProperties.class, LocationTag.class, "spawn_location", (attribute, entity) -> {
Location loc = entity.entity.getBukkitEntity().getOrigin();
return loc != null ? new LocationTag(loc) : null;
});
Expand All @@ -153,7 +153,7 @@ public static void registerTags() {
// @description
// Returns whether the entity was spawned from a spawner.
// -->
PropertyParser.<PaperEntityProperties, ElementTag>registerTag(ElementTag.class, "from_spawner", (attribute, entity) -> {
PropertyParser.registerTag(PaperEntityProperties.class, ElementTag.class, "from_spawner", (attribute, entity) -> {
return new ElementTag(entity.entity.getBukkitEntity().fromMobSpawner());
});
}
Expand Down
Expand Up @@ -48,7 +48,7 @@ public static void registerTags() {
// @description
// Returns the rarity of an item, as "common", "uncommon", "rare", or "epic".
// -->
PropertyParser.<PaperItemTagProperties, ElementTag>registerTag(ElementTag.class, "rarity", (attribute, item) -> {
PropertyParser.registerTag(PaperItemTagProperties.class, ElementTag.class, "rarity", (attribute, item) -> {
return new ElementTag(item.item.getItemStack().getRarity().name());
});
}
Expand Down
Expand Up @@ -53,7 +53,7 @@ public static void registerTags() {
// @description
// Returns whether the player affects monster spawning. When false, no monsters will spawn naturally because of this player.
// -->
PropertyParser.<PaperPlayerProperties, ElementTag>registerTag(ElementTag.class, "affects_monster_spawning", (attribute, player) -> {
PropertyParser.registerTag(PaperPlayerProperties.class, ElementTag.class, "affects_monster_spawning", (attribute, player) -> {
return new ElementTag(player.player.getPlayerEntity().getAffectsSpawning());
});
}
Expand Down
Expand Up @@ -54,7 +54,7 @@ public static void registerTags() {
// @description
// Deprecated: replaced by Minecraft's simulation_distance and view_distance config pairing
// -->
PropertyParser.<PaperWorldProperties, ElementTag>registerTag(ElementTag.class, "no_tick_view_distance", (attribute, world) -> {
PropertyParser.registerTag(PaperWorldProperties.class, ElementTag.class, "no_tick_view_distance", (attribute, world) -> {
BukkitImplDeprecations.paperNoTickViewDistance.warn(attribute.context);
return new ElementTag(world.world.getWorld().getNoTickViewDistance());
});
Expand Down
Expand Up @@ -78,7 +78,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, BiomeTag>registerStaticTag(BiomeTag.class, "as_biome", (attribute, object) -> {
PropertyParser.registerStaticTag(BukkitElementProperties.class, BiomeTag.class, "as_biome", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), BiomeTag.valueOf(object.asString(), attribute.context), "BiomeTag", attribute.hasAlternative());
});
Expand All @@ -91,7 +91,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, ChunkTag>registerTag(ChunkTag.class, "as_chunk", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, ChunkTag.class, "as_chunk", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), ChunkTag.valueOf(object.asString(), attribute.context), "ChunkTag", attribute.hasAlternative());
}, "aschunk");
Expand All @@ -104,7 +104,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, ColorTag>registerStaticTag(ColorTag.class, "as_color", (attribute, object) -> {
PropertyParser.registerStaticTag(BukkitElementProperties.class, ColorTag.class, "as_color", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), ColorTag.valueOf(object.asString(), attribute.context), "ColorTag", attribute.hasAlternative());
}, "ascolor");
Expand All @@ -117,7 +117,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, CuboidTag>registerTag(CuboidTag.class, "as_cuboid", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, CuboidTag.class, "as_cuboid", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), CuboidTag.valueOf(object.asString(), attribute.context), "CuboidTag", attribute.hasAlternative());
}, "ascuboid");
Expand All @@ -130,7 +130,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, EllipsoidTag>registerTag(EllipsoidTag.class, "as_ellipsoid", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, EllipsoidTag.class, "as_ellipsoid", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), EllipsoidTag.valueOf(object.asString(), attribute.context), "EllipsoidTag", attribute.hasAlternative());
});
Expand All @@ -143,7 +143,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, EnchantmentTag>registerStaticTag(EnchantmentTag.class, "as_enchantment", (attribute, object) -> {
PropertyParser.registerStaticTag(BukkitElementProperties.class, EnchantmentTag.class, "as_enchantment", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), EnchantmentTag.valueOf(object.asString(), attribute.context), "EnchantmentTag", attribute.hasAlternative());
});
Expand All @@ -156,7 +156,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, EntityTag>registerTag(EntityTag.class, "as_entity", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, EntityTag.class, "as_entity", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), EntityTag.valueOf(object.asString(), attribute.context), "EntityTag", attribute.hasAlternative());
}, "asentity");
Expand All @@ -169,7 +169,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, InventoryTag>registerTag(InventoryTag.class, "as_inventory", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, InventoryTag.class, "as_inventory", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), InventoryTag.valueOf(object.asString(), attribute.context), "InventoryTag", attribute.hasAlternative());
}, "asinventory");
Expand All @@ -182,7 +182,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, ItemTag>registerTag(ItemTag.class, "as_item", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, ItemTag.class, "as_item", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), ItemTag.valueOf(object.asString(), attribute.context), "ItemTag", attribute.hasAlternative());
}, "asitem");
Expand All @@ -195,7 +195,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, LocationTag>registerTag(LocationTag.class, "as_location", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, LocationTag.class, "as_location", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), LocationTag.valueOf(object.asString(), attribute.context), "LocationTag", attribute.hasAlternative());
}, "aslocation");
Expand All @@ -208,7 +208,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, MaterialTag>registerStaticTag(MaterialTag.class, "as_material", (attribute, object) -> {
PropertyParser.registerStaticTag(BukkitElementProperties.class, MaterialTag.class, "as_material", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), MaterialTag.valueOf(object.asString(), attribute.context), "MaterialTag", attribute.hasAlternative());
}, "asmaterial");
Expand All @@ -221,7 +221,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, NPCTag>registerTag(NPCTag.class, "as_npc", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, NPCTag.class, "as_npc", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), NPCTag.valueOf(object.asString(), attribute.context), "NPCTag", attribute.hasAlternative());
}, "asnpc");
Expand All @@ -234,7 +234,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, PlayerTag>registerTag(PlayerTag.class, "as_player", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, PlayerTag.class, "as_player", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), PlayerTag.valueOf(object.asString(), attribute.context), "PlayerTag", attribute.hasAlternative());
}, "asplayer");
Expand All @@ -247,7 +247,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, PluginTag>registerStaticTag(PluginTag.class, "as_plugin", (attribute, object) -> {
PropertyParser.registerStaticTag(BukkitElementProperties.class, PluginTag.class, "as_plugin", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), PluginTag.valueOf(object.asString(), attribute.context), "PluginTag", attribute.hasAlternative());
}, "asplugin");
Expand All @@ -260,7 +260,7 @@ public static void registerTags() {
// @description
// Deprecated in favor of <@link tag ObjectTag.as>
// -->
PropertyParser.<BukkitElementProperties, PolygonTag>registerTag(PolygonTag.class, "as_polygon", (attribute, object) -> {
PropertyParser.registerTag(BukkitElementProperties.class, PolygonTag.class, "as_polygon", (attribute, object) -> {
Deprecations.asXTags.warn(attribute.context);
return ElementTag.handleNull(object.asString(), PolygonTag.valueOf(object.asString(), attribute.context), "PolygonTag", attribute.hasAlternative());
});
Expand Down

0 comments on commit 6f53755

Please sign in to comment.