commit a6ba3b87a72a658aa629b1c4b5422cdcc10ec9ca Author: Lncvrt Date: Mon Apr 7 21:34:05 2025 -0700 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5f737e --- /dev/null +++ b/.gitignore @@ -0,0 +1,119 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Cache of project +.gradletasknamecache + +**/build/ + +# Common working directory +run/ +runs/ + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..5e52004 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Lncvrt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9fbf70e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# GalaxyAPI + +An extremely basic API used for GalaxyNetwork's plugins to add commonly used functions \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..7babcba --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,89 @@ +plugins { + kotlin("jvm") version "2.1.20" + id("com.github.johnrengelman.shadow") version "8.1.1" + id("xyz.jpenilla.run-paper") version "2.3.1" + `maven-publish` +} + +group = "xyz.lncvrt" +version = "1.0.0-SNAPSHOT" + +repositories { + mavenCentral() + maven("https://repo.papermc.io/repository/maven-public/") { + name = "papermc-repo" + } + maven("https://oss.sonatype.org/content/groups/public/") { + name = "sonatype" + } +} + +dependencies { + compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") +} + +val targetJavaVersion = 17 +kotlin { + jvmToolchain(targetJavaVersion) +} + +tasks { + shadowJar { + archiveBaseName.set(rootProject.name) + archiveClassifier.set("") + } + + build { + dependsOn("shadowJar") + } + + + processResources { + val props = mapOf("version" to version) + inputs.properties(props) + filteringCharset = "UTF-8" + filesMatching("plugin.yml") { + expand(props) + } + } + + runServer { + minecraftVersion("1.20.1") + } +} + +publishing { + repositories { + maven { + name = "lncvrtRepositoryReleases" + url = uri("https://repo.lncvrt.xyz/releases") + credentials { + username = System.getenv("LNCVRT_REPO_USERNAME") + password = System.getenv("LNCVRT_REPO_PASSWORD") + } + authentication { + create("basic") + } + } + maven { + name = "lncvrtRepositorySnapshots" + url = uri("https://repo.lncvrt.xyz/snapshots") + credentials { + username = System.getenv("LNCVRT_REPO_USERNAME") + password = System.getenv("LNCVRT_REPO_PASSWORD") + } + authentication { + create("basic") + } + } + } + publications { + create("maven") { + groupId = "xyz.lncvrt" + artifactId = rootProject.name.lowercase() + version = rootProject.version as String? + artifact(tasks.shadowJar) + } + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..e69de29 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..0d8ab51 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..e3bd27d --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "GalaxyAPI" diff --git a/src/main/kotlin/xyz/lncvrt/galaxyapi/GalaxyAPI.kt b/src/main/kotlin/xyz/lncvrt/galaxyapi/GalaxyAPI.kt new file mode 100644 index 0000000..ea7500b --- /dev/null +++ b/src/main/kotlin/xyz/lncvrt/galaxyapi/GalaxyAPI.kt @@ -0,0 +1,29 @@ +package xyz.lncvrt.galaxyapi + +import io.papermc.paper.event.player.AsyncChatEvent +import net.kyori.adventure.text.minimessage.MiniMessage +import org.bukkit.event.EventHandler +import org.bukkit.event.Listener +import org.bukkit.plugin.java.JavaPlugin +import xyz.lncvrt.galaxyapi.utils.MessageFormat + +@Suppress("unused") +class GalaxyAPI : JavaPlugin(), Listener { + override fun onEnable() { + instance = this + server.pluginManager.registerEvents(this, this) + } + + @EventHandler + fun test(event: AsyncChatEvent) { + event.player.sendMessage(MiniMessage.miniMessage().deserialize(MessageFormat.setStaffPrefix("test"))) + } + + companion object { + private lateinit var instance: GalaxyAPI + + fun getInstance(): GalaxyAPI { + return instance + } + } +} diff --git a/src/main/kotlin/xyz/lncvrt/galaxyapi/utils/MessageFormat.kt b/src/main/kotlin/xyz/lncvrt/galaxyapi/utils/MessageFormat.kt new file mode 100644 index 0000000..5e092f8 --- /dev/null +++ b/src/main/kotlin/xyz/lncvrt/galaxyapi/utils/MessageFormat.kt @@ -0,0 +1,14 @@ +package xyz.lncvrt.galaxyapi.utils + +@Suppress("unused") +class MessageFormat { + companion object { + fun setPrefix(text: String): String { + return "GalaxyNetwork » $text" + } + + fun setStaffPrefix(text: String): String { + return "GalaxyNetwork Staff Mode » $text" + } + } +} diff --git a/src/main/kotlin/xyz/lncvrt/galaxyapi/utils/Messages.kt b/src/main/kotlin/xyz/lncvrt/galaxyapi/utils/Messages.kt new file mode 100644 index 0000000..fb5d856 --- /dev/null +++ b/src/main/kotlin/xyz/lncvrt/galaxyapi/utils/Messages.kt @@ -0,0 +1,6 @@ +package xyz.lncvrt.galaxyapi.utils + +object Messages { + const val PRIMARY_COLOR = "c864f0" + const val SECONDARY_COLOR = "8c2db4" +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..033fe49 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,4 @@ +name: GalaxyAPI +version: '${version}' +main: xyz.lncvrt.galaxyapi.GalaxyAPI +api-version: '1.20'