Skip to content

Commit

Permalink
added another root placeholder dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-MX committed Jul 15, 2024
1 parent 7367bb1 commit 5ef159e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/src/main/kotlin/com/mattmx/ktgui/papi/dsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ fun PlaceholderExpansionWrapper.placeholder(string: String, supplier: Placeholde
Placeholder(this, ChainCommandBuilder(string), supplier).apply { registerPlaceholder(this) }

fun PlaceholderExpansionWrapper.placeholder(chain: ChainCommandBuilder, supplier: PlaceholderParseContext.() -> Any?) =
Placeholder(this, chain, supplier).apply { registerPlaceholder(this) }
Placeholder(this, chain, supplier).apply { registerPlaceholder(this) }

fun PlaceholderExpansionWrapper.placeholder(argument: Argument<*>, supplier: PlaceholderParseContext.() -> Any?) =
Placeholder(
this,
Placeholder.emptyCommandBuilder().argument(argument),
supplier
).apply { registerPlaceholder(this) }

0 comments on commit 5ef159e

Please sign in to comment.