From d39fef6fe97f9550746db7e5e5aad77c165663f8 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Mon, 7 Apr 2025 21:46:54 -0700 Subject: [PATCH] Test switching to new API --- build.gradle.kts | 36 +++++++++++-------- .../lncvrt/galaxycreations/GalaxyCreations.kt | 4 --- .../events/PlayerJoinListener.kt | 3 +- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index caace23..c52dc80 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "xyz.lncvrt" -version = "1.0.0" +version = "1.0.1-SNAPSHOT" repositories { mavenCentral() @@ -15,10 +15,14 @@ repositories { maven("https://oss.sonatype.org/content/groups/public/") { name = "sonatype" } + maven("https://repo.lncvrt.xyz/releases") { + name = "lncvrtRepositoryReleases" + } } dependencies { compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT") + compileOnly("xyz.lncvrt:galaxyapi:1.0.0") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") } @@ -27,19 +31,21 @@ kotlin { jvmToolchain(targetJavaVersion) } -tasks.build { - dependsOn("shadowJar") -} - -tasks.processResources { - val props = mapOf("version" to version) - inputs.properties(props) - filteringCharset = "UTF-8" - filesMatching("plugin.yml") { - expand(props) +tasks { + build { + dependsOn("shadowJar") } -} -tasks.runServer { - minecraftVersion("1.21") -} + processResources { + val props = mapOf("version" to version) + inputs.properties(props) + filteringCharset = "UTF-8" + filesMatching("plugin.yml") { + expand(props) + } + } + + runServer { + minecraftVersion("1.21") + } +} \ No newline at end of file diff --git a/src/main/kotlin/xyz/lncvrt/galaxycreations/GalaxyCreations.kt b/src/main/kotlin/xyz/lncvrt/galaxycreations/GalaxyCreations.kt index d1356ae..9ba645c 100644 --- a/src/main/kotlin/xyz/lncvrt/galaxycreations/GalaxyCreations.kt +++ b/src/main/kotlin/xyz/lncvrt/galaxycreations/GalaxyCreations.kt @@ -12,8 +12,4 @@ class GalaxyCreations : JavaPlugin() { server.pluginManager.registerEvents(PlayerJoinListener(this), this) server.pluginManager.registerEvents(ProjectileLaunchListener(), this) } - - internal fun setPrefix(message: String): String { - return "GalaxyNetwork ยป $message" - } } diff --git a/src/main/kotlin/xyz/lncvrt/galaxycreations/events/PlayerJoinListener.kt b/src/main/kotlin/xyz/lncvrt/galaxycreations/events/PlayerJoinListener.kt index d8c9d4c..20a7559 100644 --- a/src/main/kotlin/xyz/lncvrt/galaxycreations/events/PlayerJoinListener.kt +++ b/src/main/kotlin/xyz/lncvrt/galaxycreations/events/PlayerJoinListener.kt @@ -3,6 +3,7 @@ package xyz.lncvrt.galaxycreations.events import org.bukkit.event.EventHandler import org.bukkit.event.Listener import org.bukkit.event.player.PlayerJoinEvent +import xyz.lncvrt.galaxyapi.utils.MessageFormat import xyz.lncvrt.galaxycreations.GalaxyCreations class PlayerJoinListener(private val plugin: GalaxyCreations) : Listener { @@ -11,7 +12,7 @@ class PlayerJoinListener(private val plugin: GalaxyCreations) : Listener { val player = event.getPlayer() if (!event.getPlayer().hasPlayedBefore()) { player.performCommand("p auto") - player.sendMessage(plugin.miniMessage.deserialize(plugin.setPrefix("Welcome to Galaxy Network: Creative Server!\nYou have been teleported to your own plot!\nHere, you can build almost anything you want\nIf you need help, run the /discord command and we will help you!\nIf you need to, you can go to your plot again by doing the command /p home to return back\nYou can also do /p claim in an empty plot to claim it as your own if you needed more space."))) + player.sendMessage(plugin.miniMessage.deserialize(MessageFormat.setPrefix("Welcome to Galaxy Network: Creative Server!\nYou have been teleported to your own plot!\nHere, you can build almost anything you want\nIf you need help, run the /discord command and we will help you!\nIf you need to, you can go to your plot again by doing the command /p home to return back\nYou can also do /p claim in an empty plot to claim it as your own if you needed more space."))) } } } \ No newline at end of file