Skip to content

Commit 25f07ed

Browse files
committed
feat: support non self closing tags for placeholderapi
1 parent 16f0c48 commit 25f07ed

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/de/rexlmanu/fairychat/plugin/utility/LegacySupport.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public static String replaceLegacyWithTags(String input) {
9999
final String papiPlaceholder =
100100
argumentQueue.popOr("papi tag requires an argument").value();
101101

102+
boolean notSelfClosing = argumentQueue.hasNext() && argumentQueue.pop().isFalse();
103+
102104
// Then get PAPI to parse the placeholder for the given player.
103105
final String parsedPlaceholder =
104106
PlaceholderAPI.setPlaceholders(player, '%' + papiPlaceholder + '%');
@@ -110,6 +112,9 @@ public static String replaceLegacyWithTags(String input) {
110112
Component component = parsePossibleLegacy(parsedPlaceholder);
111113

112114
// Finally, return the tag instance to insert the placeholder!
115+
if (notSelfClosing) {
116+
return Tag.inserting(component);
117+
}
113118
return Tag.selfClosingInserting(component);
114119
});
115120
}

0 commit comments

Comments
 (0)