Skip to content

Commit

Permalink
fix tags not in parseResolver being in the base MM instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Jan 27, 2023
1 parent d8d7b55 commit 0e249df
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,12 @@ fun Component.handlePlayerPings(player: Player, pingedPlayer: Player) {
player.sendMessage(pingerMessage)
}

/** Build a unique instance of MM with specific tagresolvers to format
/** Build a unique instance of MiniMessage with an empty TagResolver and deserializes with a generated one that takes permissions into account
* @param player Format tags based on a player's permission, or null to parse all tags
* @param ignorePermissions Whether to ignore permissions and parse all tags
*/
fun String.parseTags(player: Player? = null, ignorePermissions: Boolean = false): Component {
//TODO Figure out why this doesn't respect denied standard perms?
return MiniMessage.miniMessage().deserialize(this.fixSerializedTags(), player.buildTagResolver(ignorePermissions))
return MiniMessage.builder().tags(TagResolver.empty()).build().deserialize(this.fixSerializedTags(), player.buildTagResolver(ignorePermissions))
}

fun Player?.buildTagResolver(ignorePermissions: Boolean = false): TagResolver {
Expand Down

0 comments on commit 0e249df

Please sign in to comment.