Test switching to new API

This commit is contained in:
2025-04-07 21:46:54 -07:00
parent 659d3364b3
commit d39fef6fe9
3 changed files with 23 additions and 20 deletions

View File

@@ -5,7 +5,7 @@ plugins {
} }
group = "xyz.lncvrt" group = "xyz.lncvrt"
version = "1.0.0" version = "1.0.1-SNAPSHOT"
repositories { repositories {
mavenCentral() mavenCentral()
@@ -15,10 +15,14 @@ repositories {
maven("https://oss.sonatype.org/content/groups/public/") { maven("https://oss.sonatype.org/content/groups/public/") {
name = "sonatype" name = "sonatype"
} }
maven("https://repo.lncvrt.xyz/releases") {
name = "lncvrtRepositoryReleases"
}
} }
dependencies { dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT") 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") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
} }
@@ -27,11 +31,12 @@ kotlin {
jvmToolchain(targetJavaVersion) jvmToolchain(targetJavaVersion)
} }
tasks.build { tasks {
build {
dependsOn("shadowJar") dependsOn("shadowJar")
} }
tasks.processResources { processResources {
val props = mapOf("version" to version) val props = mapOf("version" to version)
inputs.properties(props) inputs.properties(props)
filteringCharset = "UTF-8" filteringCharset = "UTF-8"
@@ -40,6 +45,7 @@ tasks.processResources {
} }
} }
tasks.runServer { runServer {
minecraftVersion("1.21") minecraftVersion("1.21")
} }
}

View File

@@ -12,8 +12,4 @@ class GalaxyCreations : JavaPlugin() {
server.pluginManager.registerEvents(PlayerJoinListener(this), this) server.pluginManager.registerEvents(PlayerJoinListener(this), this)
server.pluginManager.registerEvents(ProjectileLaunchListener(), this) server.pluginManager.registerEvents(ProjectileLaunchListener(), this)
} }
internal fun setPrefix(message: String): String {
return "<gradient:light_purple:dark_purple:light_purple><bold>GalaxyNetwork</gradient> <gray><bold>»</bold></gray> $message"
}
} }

View File

@@ -3,6 +3,7 @@ package xyz.lncvrt.galaxycreations.events
import org.bukkit.event.EventHandler import org.bukkit.event.EventHandler
import org.bukkit.event.Listener import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerJoinEvent import org.bukkit.event.player.PlayerJoinEvent
import xyz.lncvrt.galaxyapi.utils.MessageFormat
import xyz.lncvrt.galaxycreations.GalaxyCreations import xyz.lncvrt.galaxycreations.GalaxyCreations
class PlayerJoinListener(private val plugin: GalaxyCreations) : Listener { class PlayerJoinListener(private val plugin: GalaxyCreations) : Listener {
@@ -11,7 +12,7 @@ class PlayerJoinListener(private val plugin: GalaxyCreations) : Listener {
val player = event.getPlayer() val player = event.getPlayer()
if (!event.getPlayer().hasPlayedBefore()) { if (!event.getPlayer().hasPlayedBefore()) {
player.performCommand("p auto") player.performCommand("p auto")
player.sendMessage(plugin.miniMessage.deserialize(plugin.setPrefix("<light_purple>Welcome to Galaxy Network: Creative Server!\nYou have been teleported <rainbow>to your own plot!</rainbow>\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 <u><click:suggest_command:'/p home'>/p home</click></u> to return back\nYou can also do <u><click:suggest_command:'/p claim'>/p claim</click></u> in an empty plot to claim it as your own if you needed more space.</light_purple>"))) player.sendMessage(plugin.miniMessage.deserialize(MessageFormat.setPrefix("<light_purple>Welcome to Galaxy Network: Creative Server!\nYou have been teleported <rainbow>to your own plot!</rainbow>\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 <u><click:suggest_command:'/p home'>/p home</click></u> to return back\nYou can also do <u><click:suggest_command:'/p claim'>/p claim</click></u> in an empty plot to claim it as your own if you needed more space.</light_purple>")))
} }
} }
} }