Skip to content

Commit

Permalink
add deprecation warning for dynamic argument prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 28, 2021
1 parent a20c492 commit 37542f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -123,6 +123,9 @@ public final Argument argAtIndex(int index) {
TagManager.fillArgumentObjects(internalArg, arg, context);
if (internalArg.hadColon && arg.prefix == null && ((ElementTag) arg.object).isRawInput) {
arg.fillStr(arg.object.toString());
if (arg.prefix != null) {
Deprecations.dynamicPrefix.warn(this);
}
}
arg.canBeElement = arg.object instanceof ElementTag;
}
Expand Down
Expand Up @@ -220,6 +220,9 @@ public class Deprecations {
// In Bukkit impl, Added 2021/10/24, bump to normal slow warning by 2023.
public static Warning entityArmorPose = new VerySlowWarning("The old EntityTag.armor_pose and armor_pose_list tags are dperecated in favor of armor_pose_map.");

// Added 2021/10/28, bump to normal slow warning by 2023.
public static Warning dynamicPrefix = new VerySlowWarning("Dynamically prefixed arguments (for 'prefix:value' arguments, like '<[sometag]>:<[somevalue]>') were never officially permitted and are now deprecated. You must specify a prefix explicitly if one is needed.");

// ==================== FUTURE deprecations ====================

// In Bukkit impl, Added 2021/04/13, deprecate officially by 2022.
Expand Down

0 comments on commit 37542f9

Please sign in to comment.