Skip to content

Commit

Permalink
change advanced_matches to advanced_matches_text
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 27, 2021
1 parent 90dc874 commit 9109834
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
Expand Up @@ -968,19 +968,19 @@ else if (CoreUtilities.toLowerCase(element).contains(CoreUtilities.toLowerCase(c
}, "equals_with_case");

// <--[tag]
// @attribute <ElementTag.advanced_matches[<matcher>]>
// @attribute <ElementTag.advanced_matches_text[<matcher>]>
// @returns ElementTag(Boolean)
// @group element checking
// @description
// Returns whether the element matches some matcher text, using the system behind <@link language Advanced Script Event Matching>.
// -->
registerTag("advanced_matches", (attribute, object) -> {
registerTag("advanced_matches_text", (attribute, object) -> {
if (!attribute.hasContext(1)) {
attribute.echoError("The tag ElementTag.advanced_matches[...] must have a value.");
return null;
}
return new ElementTag(ScriptEvent.createMatcher(attribute.getContext(1)).doesMatch(object.element));
});
}, "advanced_matches");

// <--[tag]
// @attribute <ElementTag.regex_matches[<regex>]>
Expand Down
Expand Up @@ -292,6 +292,6 @@ public Attribute getAttributes() {

@Override
public String toString() {
return core_attributes.toString() + (hasValue() ? ":" + mainRef.value : "") + (hasAlternative() ? "||" + mainRef.alternative : "");
return core_attributes.toString() + (hasValue() ? ":" + mainRef.value : "") + (mainRef.alternative != null ? "||" + mainRef.alternative : "");
}
}
Expand Up @@ -33,11 +33,6 @@ public DefinitionTagBase() {
return null;
}
ObjectTag def = definitionProvider.getDefinitionObject(defName);
if (attribute.startsWith("exists", 2)) {
Deprecations.defExistsTag.warn(attribute.context);
attribute.fulfill(1);
return new ElementTag(def != null);
}
if (def == null) {
attribute.echoError("Invalid definition name '" + defName + "'.");
return null;
Expand Down
Expand Up @@ -225,9 +225,6 @@ public class Deprecations {
// In Bukkit impl, Added 2020/07/12, deprecate officially by 2022.
public static Warning entityEquipmentSubtags = new FutureWarning(pointlessSubtagPrefix + " 'entity.equipment.slotname' is deprecated: use 'entity.equipment_map.get[slotname]' instead.");

// Added 2020/07/23, deprecate officially by 2022.
public static Warning defExistsTag = new FutureWarning("The def[].exists tag is deprecated: use a fallback and null check, or just set definitions more consistently.");

// In Bukkit impl, Added 2020/10/18, deprecate officially by 2022.
public static Warning itemDisplayNameMechanism = new FutureWarning("The item 'display_name' mechanism is now just the 'display' mechanism.");

Expand Down

0 comments on commit 9109834

Please sign in to comment.