Skip to content

Commit

Permalink
Merge pull request #105 from SenPr/master
Browse files Browse the repository at this point in the history
Parse placeholders in value for `placeholder_equals` and `placeholder_contains` conditions.
  • Loading branch information
WillFP authored Jul 27, 2023
2 parents 0ecbe66 + ae029e6 commit 52420ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ object ConditionPlaceholderContains : Condition<NoCompileData>("placeholder_cont

override fun isMet(player: Player, config: Config, compileData: NoCompileData): Boolean {
return config.getFormattedString("placeholder", placeholderContext(player = player))
.contains(config.getString("value"), ignoreCase = config.getBool("ignore_case"))
.contains(config.getFormattedString("value", placeholderContext(player = player)),
ignoreCase = config.getBool("ignore_case"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ object ConditionPlaceholderEquals : Condition<NoCompileData>("placeholder_equals

override fun isMet(player: Player, config: Config, compileData: NoCompileData): Boolean {
return config.getFormattedString("placeholder", placeholderContext(player = player))
.equals(config.getString("value"), ignoreCase = true)
.equals(config.getFormattedString("value", placeholderContext(player = player)),
ignoreCase = config.getBool("ignore_case"))
}
}

0 comments on commit 52420ec

Please sign in to comment.