Initial commit
This commit is contained in:
119
.gitignore
vendored
Normal file
119
.gitignore
vendored
Normal file
@@ -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
|
||||
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@@ -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.
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# GalaxyAPI
|
||||
|
||||
An extremely basic API used for GalaxyNetwork's plugins to add commonly used functions
|
||||
89
build.gradle.kts
Normal file
89
build.gradle.kts
Normal file
@@ -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<BasicAuthentication>("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<BasicAuthentication>("basic")
|
||||
}
|
||||
}
|
||||
}
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
groupId = "xyz.lncvrt"
|
||||
artifactId = rootProject.name.lowercase()
|
||||
version = rootProject.version as String?
|
||||
artifact(tasks.shadowJar)
|
||||
}
|
||||
}
|
||||
}
|
||||
0
gradle.properties
Normal file
0
gradle.properties
Normal file
1
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
1
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1 @@
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
1
settings.gradle.kts
Normal file
1
settings.gradle.kts
Normal file
@@ -0,0 +1 @@
|
||||
rootProject.name = "GalaxyAPI"
|
||||
29
src/main/kotlin/xyz/lncvrt/galaxyapi/GalaxyAPI.kt
Normal file
29
src/main/kotlin/xyz/lncvrt/galaxyapi/GalaxyAPI.kt
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/main/kotlin/xyz/lncvrt/galaxyapi/utils/MessageFormat.kt
Normal file
14
src/main/kotlin/xyz/lncvrt/galaxyapi/utils/MessageFormat.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package xyz.lncvrt.galaxyapi.utils
|
||||
|
||||
@Suppress("unused")
|
||||
class MessageFormat {
|
||||
companion object {
|
||||
fun setPrefix(text: String): String {
|
||||
return "<bold><gradient:#${Messages.PRIMARY_COLOR}:#${Messages.SECONDARY_COLOR}:#${Messages.PRIMARY_COLOR}>GalaxyNetwork</gradient> <gray>»</gray></bold> $text"
|
||||
}
|
||||
|
||||
fun setStaffPrefix(text: String): String {
|
||||
return "<bold><gradient:#${Messages.PRIMARY_COLOR}:#${Messages.SECONDARY_COLOR}:#${Messages.PRIMARY_COLOR}>GalaxyNetwork</gradient> <gradient:green:dark_green:green>Staff Mode</gradient> <gray>»</gray></bold> $text"
|
||||
}
|
||||
}
|
||||
}
|
||||
6
src/main/kotlin/xyz/lncvrt/galaxyapi/utils/Messages.kt
Normal file
6
src/main/kotlin/xyz/lncvrt/galaxyapi/utils/Messages.kt
Normal file
@@ -0,0 +1,6 @@
|
||||
package xyz.lncvrt.galaxyapi.utils
|
||||
|
||||
object Messages {
|
||||
const val PRIMARY_COLOR = "c864f0"
|
||||
const val SECONDARY_COLOR = "8c2db4"
|
||||
}
|
||||
4
src/main/resources/plugin.yml
Normal file
4
src/main/resources/plugin.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
name: GalaxyAPI
|
||||
version: '${version}'
|
||||
main: xyz.lncvrt.galaxyapi.GalaxyAPI
|
||||
api-version: '1.20'
|
||||
Reference in New Issue
Block a user