Skip to content

Commit

Permalink
add %eternaltags_has-unlocked%
Browse files Browse the repository at this point in the history
  • Loading branch information
Oribuin committed May 16, 2024
1 parent 2967e37 commit 401a48e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/xyz/oribuin/eternaltags/hook/Expansion.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ public String onRequest(@Nullable OfflinePlayer offlineUser, @NotNull String par
case "tag_description" -> activeTag != null ? TagsUtils.formatList(activeTag.getDescription(), Setting.DESCRIPTION_DELIMITER.getString()) : this.formattedPlaceholder;
case "tag_order" -> activeTag != null ? String.valueOf(activeTag.getOrder()) : this.formattedPlaceholder;
case "active" -> String.valueOf(activeTag != null);
case "has-unlocked" -> {
if (activeTag == null)
yield Setting.TAG_LOCKED_FORMAT.getString();

yield this.manager.canUseTag(player, activeTag) ? Setting.TAG_UNLOCKED_FORMAT.getString() : Setting.TAG_LOCKED_FORMAT.getString();
}

// These are the tags that return a number.
case "joined" -> this.joinTags(this.manager.getPlayerTags(offlineUser.getPlayer()));
Expand Down

0 comments on commit 401a48e

Please sign in to comment.