diff --git a/.gitignore b/.gitignore index a83abe5..91ecf5d 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,5 @@ out/ .vscode/ ### Other ### -development/run/ \ No newline at end of file +development/run/ +development/src/main/kotlin/ \ No newline at end of file diff --git a/development/build.gradle.kts b/development/build.gradle.kts index 22d774e..0101350 100644 --- a/development/build.gradle.kts +++ b/development/build.gradle.kts @@ -32,7 +32,7 @@ bukkit { apiVersion = "1.20" version = "${project.version}" authors = listOf("Tech") - main = "me.tech.development.DevelopmentPlugin" + main = "DevelopmentPlugin" commands { register("openui") diff --git a/development/src/main/kotlin/me/tech/development/DevelopmentPlugin.kt b/development/src/main/kotlin/me/tech/development/DevelopmentPlugin.kt deleted file mode 100644 index 60f05a0..0000000 --- a/development/src/main/kotlin/me/tech/development/DevelopmentPlugin.kt +++ /dev/null @@ -1,42 +0,0 @@ -package me.tech.development - -import me.tech.mcchestui.* -import net.kyori.adventure.text.Component -import org.bukkit.GameMode -import org.bukkit.Material -import org.bukkit.entity.Player -import org.bukkit.event.EventHandler -import org.bukkit.event.Listener -import org.bukkit.event.player.PlayerJoinEvent -import org.bukkit.plugin.java.JavaPlugin - -class DevelopmentPlugin : JavaPlugin(), Listener { - override fun onEnable() { - getCommand("openui")?.setExecutor { sender, _, _, _ -> - (sender as? Player)?.openGUI(open(sender)) - true - } - - // op & set gamemode on local server. - server.pluginManager.registerEvents(object : Listener { - @EventHandler - fun PlayerJoinEvent.on() { - player.gameMode = GameMode.CREATIVE - player.isOp = true - } - }, this) - } - - private fun open(player: Player): GUI { - return gui( - this, - title = Component.text("Test UI"), - type = GUIType.Chest(rows = 3) - ) { - slot(1, 1) { - item = item(Material.CAKE) - onClick = { it.sendMessage("You've clicked the cake!") } - } - } - } -} \ No newline at end of file