-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
map sounds + cram gui progress + relational placeholders impl
- Loading branch information
Showing
19 changed files
with
353 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Command: C:\Program Files\Java\jdk-17\bin\java.exe -Xmx1G -classpath C:\Users\Mangr\.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.10.1\c293b2384ae12af74f407fa3aaa553bba4ac6763\tiny-remapper-0.10.1-fat.jar net.fabricmc.tinyremapper.Main D:\PC\Projects\KtBukkitGui\api\build\libs\ktgui-2.4.3-alpha-dev-all.jar D:\PC\Projects\KtBukkitGui\api\build\libs\api-2.4.3-alpha.jar C:\Users\Mangr\.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\extractDevBundle.dir\data\mojang+yarn-spigot-reobf.tiny mojang+yarn spigot C:\Users\Mangr\.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\applyMojangMappedPaperclipPatch.jar --threads=1 | ||
Finished after 2700.36 ms. | ||
Command: C:\Users\Mangr\.gradle\jdks\adoptium-21-x64-hotspot-windows\bin\java.exe -Xmx1G -classpath C:\Users\Mangr\.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.10.1\c293b2384ae12af74f407fa3aaa553bba4ac6763\tiny-remapper-0.10.1-fat.jar net.fabricmc.tinyremapper.Main D:\PC\Projects\KtBukkitGui\api\build\libs\ktgui-2.4.4-alpha-dev-all.jar D:\PC\Projects\KtBukkitGui\api\build\libs\api-2.4.4-alpha.jar C:\Users\Mangr\.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\extractDevBundle.dir\data\mojang+yarn-spigot-reobf.tiny mojang+yarn spigot C:\Users\Mangr\.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\applyMojangMappedPaperclipPatch.jar --threads=1 | ||
Finished after 2715.83 ms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.mattmx.ktgui.dsl | ||
|
||
import com.mattmx.ktgui.commands.declarative.ChainCommandBuilder | ||
import com.mattmx.ktgui.commands.declarative.arg.Argument | ||
import com.mattmx.ktgui.papi.Placeholder | ||
import com.mattmx.ktgui.papi.PlaceholderExpansionWrapper | ||
import com.mattmx.ktgui.papi.PlaceholderParseContext | ||
import com.mattmx.ktgui.papi.RelationalPlaceholderParseContext | ||
import com.mattmx.ktgui.scheduling.syncDelayed | ||
import org.bukkit.plugin.java.JavaPlugin | ||
import java.util.* | ||
|
||
inline fun JavaPlugin.placeholderExpansion(builder: PlaceholderExpansionWrapper.() -> Unit) = | ||
PlaceholderExpansionWrapper(this) | ||
.apply(builder) | ||
.apply { | ||
syncDelayed(2) { register() } | ||
} | ||
|
||
fun PlaceholderExpansionWrapper.placeholder(string: String, supplier: PlaceholderParseContext.() -> Any?) = | ||
Placeholder(this, ChainCommandBuilder(string)).apply { | ||
parseDefault = Optional.of(supplier) | ||
registerPlaceholder(this) | ||
} | ||
|
||
fun PlaceholderExpansionWrapper.placeholder(chain: ChainCommandBuilder, supplier: PlaceholderParseContext.() -> Any?) = | ||
Placeholder(this, chain).apply { | ||
parseDefault = Optional.of(supplier) | ||
registerPlaceholder(this) | ||
} | ||
|
||
fun PlaceholderExpansionWrapper.placeholder(argument: Argument<*>, supplier: PlaceholderParseContext.() -> Any?) = | ||
Placeholder( | ||
this, | ||
Placeholder.emptyCommandBuilder().argument(argument) | ||
).apply { | ||
parseDefault = Optional.of(supplier) | ||
registerPlaceholder(this) | ||
} | ||
|
||
fun PlaceholderExpansionWrapper.relational(string: String, supplier: RelationalPlaceholderParseContext.() -> Any?) = | ||
Placeholder(this, ChainCommandBuilder(string)).apply { | ||
parseRelational = Optional.of(supplier) | ||
registerPlaceholder(this) | ||
} | ||
|
||
fun PlaceholderExpansionWrapper.relational(chain: ChainCommandBuilder, supplier: RelationalPlaceholderParseContext.() -> Any?) = | ||
Placeholder(this, chain).apply { | ||
parseRelational = Optional.of(supplier) | ||
registerPlaceholder(this) | ||
} | ||
|
||
fun PlaceholderExpansionWrapper.relational(argument: Argument<*>, supplier: RelationalPlaceholderParseContext.() -> Any?) = | ||
Placeholder( | ||
this, | ||
Placeholder.emptyCommandBuilder().argument(argument) | ||
).apply { | ||
parseRelational = Optional.of(supplier) | ||
registerPlaceholder(this) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.