diff --git a/build.gradle.kts b/build.gradle.kts index 1a4a744d..b1428856 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,7 @@ plugins { id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0" id("xyz.jpenilla.run-paper") version "2.3.1" id("io.github.goooler.shadow") version "8.1.8" + kotlin("jvm") } description = "A template repository for easily developing Minecraft Paper plugins." @@ -45,6 +46,7 @@ dependencies { implementation("net.lingala.zip4j", "zip4j", "2.11.5") implementation("com.github.EsotericFoundation:utility.kt:0.4.0") implementation("com.github.EsotericFoundation:plugin-library:0.4.0") + implementation(kotlin("stdlib-jdk8")) } tasks { diff --git a/settings.gradle.kts b/settings.gradle.kts index f9a5495f..96b185ee 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,9 @@ +pluginManagement { + plugins { + kotlin("jvm") version "2.0.21" + } +} + plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } diff --git a/src/main/java/foundation/esoteric/minecraft/plugins/template/PaperTemplatePlugin.kt b/src/main/java/foundation/esoteric/minecraft/plugins/template/PaperTemplatePlugin.kt index ed30acdf..b1acdec7 100644 --- a/src/main/java/foundation/esoteric/minecraft/plugins/template/PaperTemplatePlugin.kt +++ b/src/main/java/foundation/esoteric/minecraft/plugins/template/PaperTemplatePlugin.kt @@ -1,19 +1,17 @@ -package foundation.esoteric.minecraft.plugins.template; +package foundation.esoteric.minecraft.plugins.template -import dev.jorel.commandapi.CommandAPI; -import dev.jorel.commandapi.CommandAPIBukkitConfig; -import org.bukkit.plugin.java.JavaPlugin; +import dev.jorel.commandapi.CommandAPI +import dev.jorel.commandapi.CommandAPIBukkitConfig +import org.bukkit.plugin.java.JavaPlugin -public final class PaperTemplatePlugin extends JavaPlugin { +class PaperTemplatePlugin : JavaPlugin() { + override fun onEnable() { + dataFolder.mkdir() + saveDefaultConfig() - @Override - public void onEnable() { - getDataFolder().mkdir(); - saveDefaultConfig(); + val commandAPIConfig = CommandAPIBukkitConfig(this) - CommandAPIBukkitConfig commandAPIConfig = new CommandAPIBukkitConfig(this); - - CommandAPI.onLoad(commandAPIConfig); - CommandAPI.onEnable(); - } + CommandAPI.onLoad(commandAPIConfig) + CommandAPI.onEnable() + } }