generated from flytegg/mcw-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
33 changed files
with
235 additions
and
214 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
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
plugins { | ||
alias(libs.plugins.kotlin) | ||
alias(libs.plugins.shadow) | ||
alias(libs.plugins.paperweight) | ||
alias(libs.plugins.run.paper) | ||
} | ||
|
||
group = "gg.flyte" | ||
version = "1.0.0" | ||
|
||
repositories { | ||
maven("https://jitpack.io") | ||
maven("https://repo.flyte.gg/releases") | ||
maven("https://repo.papermc.io/repository/maven-public/") | ||
maven("https://oss.sonatype.org/content/groups/public/") | ||
maven("https://repo.codemc.io/repository/maven-snapshots/") | ||
} | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT") | ||
|
||
implementation(libs.twilight) | ||
implementation(libs.paperlib) | ||
|
||
implementation(libs.lamp.common) | ||
implementation(libs.lamp.bukkit) | ||
|
||
implementation(libs.anvil.gui) | ||
implementation(libs.mongodb) | ||
compileOnly(libs.noteblock.api) | ||
} | ||
|
||
tasks { | ||
build { dependsOn(shadowJar) } | ||
assemble { dependsOn(reobfJar) } | ||
runServer { minecraftVersion("1.20.1") } | ||
compileKotlin { kotlinOptions.jvmTarget = "17" } | ||
reobfJar { outputJar.set(layout.buildDirectory.file("libs/flyte-christmas-plugin.jar")) } | ||
|
||
|
||
shadowJar { | ||
val pack = "gg.flyte.event.shaded." | ||
relocate("gg.flyte.twilight", "${pack}twilight") | ||
relocate("revxrsal.commands", "${pack}lamp") | ||
relocate("com.google.gson", "${pack}gson") | ||
relocate("kotlin", "${pack}kotlin") | ||
relocate("com.mongodb", "${pack}mongodb") | ||
relocate("io.github.cdimascio.dotenv", "${pack}dotenv") | ||
relocate("net.wesjd.anvilgui", "${pack}anvilgui") | ||
relocate("org.bson", "${pack}bson") | ||
relocate("org.intellij.lang.annotations", "${pack}jetbrains.annotations") | ||
relocate("org.jetbrains.annotations", "${pack}jetbrains.annotations") | ||
relocate("io.papermc.lib", "${pack}paperlib") | ||
} | ||
} |
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,36 @@ | ||
[versions] | ||
# Plugins | ||
kotlin = "1.9.20" | ||
shadow = "8.1.1" | ||
paperweight = "1.5.10" | ||
run-paper = "2.2.2" | ||
|
||
# Libraries | ||
twilight = "1.0.30" | ||
paperlib = "1.0.7" | ||
bstats = "3.0.2" | ||
lamp = "3.1.8" | ||
adventure = "4.14.0" | ||
adventure-platform-bukkit = "4.3.1" | ||
|
||
[libraries] | ||
twilight = { module = "gg.flyte:twilight", version.ref = "twilight" } | ||
paperlib = { module = "io.papermc:paperlib", version.ref = "paperlib" } | ||
bstats = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" } | ||
|
||
lamp-common = { module = "com.github.Revxrsal.Lamp:common", version.ref = "lamp" } | ||
lamp-bukkit = { module = "com.github.Revxrsal.Lamp:bukkit", version.ref = "lamp" } | ||
|
||
adventure = { module = "net.kyori:adventure", version.ref = "adventure" } | ||
adventure-text-minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure" } | ||
adventure-platform-bukkit = { module = "net.kyori:adventure-platform-bukkit", version.ref = "adventure-platform-bukkit" } | ||
|
||
anvil-gui = { module = "net.wesjd:anvilgui", version = "1.7.0-SNAPSHOT" } | ||
mongodb = { module = "org.mongodb:mongodb-driver-sync", version = "4.9.0" } | ||
noteblock-api = { module = "com.github.koca2000:NoteBlockAPI", version = "1.6.2" } | ||
|
||
[plugins] | ||
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } | ||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" } | ||
paperweight = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight" } | ||
run-paper = { id = "xyz.jpenilla.run-paper", version.ref = "run-paper" } |
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,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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,3 +1,2 @@ | ||
|
||
rootProject.name = "ls-christmas-plugin" | ||
rootProject.name = "flyte-christmas-plugin" | ||
|
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,48 @@ | ||
package gg.flyte.event | ||
|
||
import gg.flyte.event.debug.DebugCommand | ||
import gg.flyte.event.game.GameCommand | ||
import gg.flyte.event.game.GameType | ||
import gg.flyte.twilight.Twilight | ||
import gg.flyte.twilight.extension.enumValue | ||
import org.bukkit.Bukkit | ||
import revxrsal.commands.bukkit.BukkitCommandHandler | ||
import revxrsal.commands.exception.CommandErrorException | ||
import revxrsal.commands.ktx.autoCompleter | ||
|
||
object CommandManager { | ||
|
||
init { | ||
BukkitCommandHandler.create(Twilight.plugin).apply { | ||
registerAutoComplete() | ||
registerCommands() | ||
registerBrigadier() | ||
} | ||
} | ||
|
||
private fun BukkitCommandHandler.registerCommands() { | ||
register( | ||
GameCommand, | ||
DebugCommand | ||
) | ||
} | ||
|
||
private fun BukkitCommandHandler.registerAutoComplete() { | ||
registerValueResolver(GameType::class.java) { | ||
enumValue<GameType>(it.pop()) ?: throw CommandErrorException("Invalid game type!", it.pop()) | ||
} | ||
|
||
registerValueResolver(DebugCommand.WorldName::class.java) { DebugCommand.WorldName(it.pop()) } | ||
|
||
autoCompleter { | ||
registerParameterSuggestions(GameType::class.java) { _, _, _ -> | ||
GameType.entries.map { it.name.uppercase() } | ||
} | ||
|
||
registerParameterSuggestions(DebugCommand.WorldName::class.java) { _, _, _ -> | ||
Bukkit.getWorlds().map { it.name } | ||
} | ||
} | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...m/learnspigot/event/debug/DebugCommand.kt → ...tlin/gg/flyte/event/debug/DebugCommand.kt
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
2 changes: 1 addition & 1 deletion
2
...kotlin/com/learnspigot/event/game/Game.kt → src/main/kotlin/gg/flyte/event/game/Game.kt
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
14 changes: 7 additions & 7 deletions
14
...in/com/learnspigot/event/game/GameType.kt → ...in/kotlin/gg/flyte/event/game/GameType.kt
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
4 changes: 2 additions & 2 deletions
4
...learnspigot/event/game/lobby/LobbyGame.kt → ...in/gg/flyte/event/game/lobby/LobbyGame.kt
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
8 changes: 4 additions & 4 deletions
8
...pigot/event/game/lobby/LobbyGameEngine.kt → ...flyte/event/game/lobby/LobbyGameEngine.kt
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.