Skip to content

Commit

Permalink
(experimental) document some deprecated tags in meta
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 28, 2021
1 parent 8cd5adb commit 2b2b05c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,29 @@ public static void registerTags() {
return entity.getPoseMap();
});

// <--[tag]
// @attribute <EntityTag.armor_pose_list>
// @returns ListTag
// @mechanism EntityTag.armor_pose
// @Deprecated Use 'armor_pose_map'
// @group attributes
// @description
// Deprecated in favor of <@link tag EntityTag.armor_pose_map>
// -->
PropertyParser.<EntityArmorPose, ListTag>registerTag(ListTag.class, "armor_pose_list", (attribute, entity) -> {
Deprecations.entityArmorPose.warn(attribute.context);
return entity.getPoseList();
});

// <--[tag]
// @attribute <EntityTag.armor_pose>
// @returns LocationTag
// @mechanism EntityTag.armor_pose
// @Deprecated Use 'armor_pose_map'
// @group attributes
// @description
// Deprecated in favor of <@link tag EntityTag.armor_pose_map>
// -->
PropertyParser.<EntityArmorPose, LocationTag>registerTag(LocationTag.class, "armor_pose", (attribute, entity) -> {
Deprecations.entityArmorPose.warn(attribute.context);
if (!attribute.hasContext(1)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
return enchants.getObjectAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <ItemTag.enchantments>
// @returns ListTag
// @mechanism ItemTag.enchantments
// @group properties
// @Deprecated Use 'enchantment_types' or 'enchantment_map'
// @description
// Deprecated in favor of <@link tag ItemTag.enchantment_types> or <@link tag ItemTag.enchantment_map>
// -->
if (attribute.startsWith("enchantments")) {
Deprecations.itemEnchantmentsLegacy.warn(attribute.context);
Set<Map.Entry<Enchantment, Integer>> enchantments = getEnchantments();
Expand Down

0 comments on commit 2b2b05c

Please sign in to comment.