Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Pull Request

on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
submodules: recursive

- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: '25'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew clean build shadowJar
31 changes: 15 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Release with ShadowJars
name: Release and Publish

on:
push:
Expand All @@ -8,7 +8,7 @@ on:

jobs:
build:
name: Build ShadowJars and Create Release
name: Build and Publish
runs-on: ubuntu-latest

steps:
Expand All @@ -18,32 +18,33 @@ jobs:
ref: main
submodules: recursive

- name: Set up JDK 25
uses: actions/setup-java@v5
- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: '25'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
with:
cache-disabled: true

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Print Gradle Wrapper Properties
run: cat gradle/wrapper/gradle-wrapper.properties

- name: Clear Gradle Cache
run: rm -rf ~/.gradle/caches && rm -rf ~/.gradle/wrapper

- name: Build ShadowJars
run: ./gradlew clean build shadowJar

- name: Publish to SimpleCloud Repository
run: ./gradlew publish
env:
SIMPLECLOUD_USERNAME: ${{ secrets.SIMPLECLOUD_USERNAME }}
SIMPLECLOUD_PASSWORD: ${{ secrets.SIMPLECLOUD_PASSWORD }}

- name: Get Gradle Version
id: gradle_version
run: echo "GRADLE_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_ENV

- name: Get Commit Hash
id: commit_hash
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Publish to Modrinth
run: ./gradlew modrinth && ./gradlew modrinthSyncBody
env:
Expand All @@ -52,9 +53,7 @@ jobs:
- name: Create Release
run: |
jars=()
# Find JAR files in any submodule's build/libs directory
for jar in $(find . -type f -name "*.jar" -path "*/build/libs/*.jar" -not -path "./build/libs/*"); do
# Check if the filename contains a version number (e.g., a dash followed by numbers)
if [[ $(basename "$jar") =~ -[0-9]+\.[0-9]+ ]]; then
echo "Skipping $jar due to version number"
else
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@

> All information about this project can be found in our detailed [documentation][docs-thisproject].

The Prefixes Plugin provides comprehensive rank management for chat, tab list and name tag displays. Groups are either defined in the plugin config or read from LuckPerms, and within a SimpleCloud network chat messages and tab list entries can be synced across servers.
A Paper plugin and Minestom library for prefixes, suffixes and name colors in chat, the tab list and name tags. Groups come from a simple config or straight from LuckPerms, and on a SimpleCloud network chat and tab list can be shared across servers.

## Features

- [x] **LuckPerms Integration**: Use the built-in config groups or let the plugin convert your LuckPerms groups into prefix groups.
- [x] **Chat, Tab List & Name Tags**: Prefixes, suffixes, colors and display names are applied to chat messages, the tab list and player name tags.
- [x] **Cross-Server Sync**: Share chat messages and tab list entries between all servers, selected server groups or persistent servers of your network.
- [x] **MiniMessage Formats**: Prefixes, suffixes, display names and chat formats are fully customizable with placeholder support.
- [x] **Supported Server Software**: Supports Paper and Forks.
- [x] **Quick Setup**: Easy installation process for all supported software.
- [x] **Chat, Tab List & Name Tags**: Prefixes, suffixes and colors everywhere.
- [x] **Config or LuckPerms**: Define groups in the config or use your LuckPerms groups.
- [x] **Sorted Tab List**: Players are ordered by group priority.
- [x] **Network Sync**: Share chat and tab list across your SimpleCloud network.
- [x] **MiniMessage Formats**: Fully customizable with placeholders.
- [x] **Developer API**: Set prefixes per player or even per viewer, e.g. for teams or friends.
- [x] **Supported Software**: Paper(and forks) and Minestom as a Library.

## Dependency

Expand Down Expand Up @@ -68,7 +69,7 @@ Clone the repository with its pinned Custom Names source before building:
```shell
git clone --recurse-submodules https://github.com/simplecloudapp/prefixes-plugin.git
cd prefixes-plugin
bash ./gradlew build
./gradlew build
```

## License
Expand Down
33 changes: 30 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("maven-publish")
alias(libs.plugins.kotlin)
alias(libs.plugins.shadow)
}

check(file("custom-names/custom-names-api/src/main/kotlin").isDirectory) {
"The custom-names submodule is missing, run 'git submodule update --init' first"
}

allprojects {
group = "app.simplecloud.plugin"
version = "1.0.3"
version = "1.1.0"

repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://oss.sonatype.org/content/repositories/central")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.spectr.is/snapshots")
maven("https://repo.simplecloud.app/snapshots")
maven("https://buf.build/gen/maven")
}
Expand All @@ -24,14 +30,14 @@ subprojects {
apply {
plugin("org.jetbrains.kotlin.jvm")
plugin("com.gradleup.shadow")
plugin("maven-publish")
}

dependencies {
implementation(rootProject.libs.kotlinx.coroutines.core)
testImplementation(rootProject.libs.kotlin.test)

compileOnly(rootProject.libs.luckperms.api)
compileOnly(rootProject.libs.simplecloud.api)
}

kotlin {
Expand All @@ -53,7 +59,9 @@ subprojects {

tasks.shadowJar {
mergeServiceFiles()
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName.set("${project.name}.jar")
exclude("google/protobuf/**", "src/google/protobuf/**")
}

tasks.processResources {
Expand All @@ -62,4 +70,23 @@ subprojects {
)
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}

repositories {
maven {
name = "simplecloud"
url = uri("https://repo.simplecloud.app/snapshots")
credentials {
username = System.getenv("SIMPLECLOUD_USERNAME")
password = System.getenv("SIMPLECLOUD_PASSWORD")
}
}
}
}

}
2 changes: 1 addition & 1 deletion custom-names
Submodule custom-names updated 37 files
+24 −21 README.md
+2 −2 build.gradle.kts
+14 −4 custom-names-api/build.gradle.kts
+8 −10 custom-names-api/src/main/kotlin/space/chunks/customname/api/CustomName.kt
+4 −6 custom-names-api/src/main/kotlin/space/chunks/customname/api/CustomNameManager.kt
+58 −0 custom-names-minestom/build.gradle.kts
+183 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/CustomNameImpl.kt
+23 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/CustomNameManagerImpl.kt
+35 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/CustomNameStorage.kt
+66 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/CustomNamesMinestom.kt
+30 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/listener/EntityPassengerListener.kt
+20 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/listener/EntityRemoveListener.kt
+29 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/listener/PlayerInputListener.kt
+24 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/listener/PlayerQuitListener.kt
+17 −0 custom-names-minestom/src/main/kotlin/space/chunks/customname/minestom/listener/PlayerTrackerListener.kt
+2 −2 custom-names-paper/build.gradle.kts
+63 −35 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/CustomNameImpl.kt
+47 −0 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/CustomNameManagerImpl.kt
+44 −0 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/CustomNameStorage.kt
+5 −1 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/CustomNamesPlugin.kt
+9 −15 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/listener/EntityPassengerListener.kt
+15 −0 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/listener/EntityRemoveListener.kt
+24 −0 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/listener/PlayerQuitListener.kt
+3 −3 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/listener/PlayerSneakListener.kt
+28 −0 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/listener/PlayerTrackerListener.kt
+25 −5 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/util/DataAccessors.kt
+113 −0 custom-names-paper/src/main/kotlin/space/chunks/customname/paper/util/SkeletonInteraction.kt
+6 −0 custom-names-paper/src/main/resources/paper-plugin.yml
+0 −41 custom-names-plugin/src/main/kotlin/space/chunks/customname/plugin/CustomNameManagerImpl.kt
+0 −25 custom-names-plugin/src/main/kotlin/space/chunks/customname/plugin/CustomNameStorage.kt
+0 −23 custom-names-plugin/src/main/kotlin/space/chunks/customname/plugin/listener/PlayerQuitListener.kt
+0 −39 custom-names-plugin/src/main/kotlin/space/chunks/customname/plugin/listener/PlayerTrackerListener.kt
+0 −121 custom-names-plugin/src/main/kotlin/space/chunks/customname/plugin/util/SkeletonInteraction.kt
+0 −5 custom-names-plugin/src/main/resources/paper-plugin.yml
+11 −4 gradle/libs.versions.toml
+1 −1 gradle/wrapper/gradle-wrapper.properties
+2 −1 settings.gradle.kts
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
kotlin.code.style=official
org.gradle.configuration-cache=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.tooling.parallel=true
29 changes: 17 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,51 @@
[versions]
kotlin = "2.4.10"
kotlin = "2.4.21"
kotlinx-coroutines = "1.11.0"

shadow = "9.5.1"
shadow = "9.6.1"
minotaur = "2.9.0"
paperweight = "2.0.0-beta.21"
paperweight = "2.0.0-beta.24"
protobuf = "0.10.0"

simplecloud-api = "0.1.0-platform.40"
simplecloud-plugin-api = "0.0.1-platform.1778966459069-b1e45e2"

paper = "26.3.build.+"
minestom = "26_3-SNAPSHOT"

adventure = "5.2.0"
luckperms = "5.5"
reflection-remapper = "0.1.3"

cloud-command = "2.0.0"
cloud-command-platform = "2.0.0"
cloud-command = "2.1.0"
cloud-command-platform = "2.0.1"
cloud-command-minestom = "2.2.0-SNAPSHOT"

configurate = "4.2.0"

protoc = "4.35.1"
protobuf-kotlin = "4.35.1"
protoc = "4.36.2"
protobuf-kotlin = "4.36.2"

jnats = "2.26.0"
jnats = "2.26.3"
slf4j = "2.0.20"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }

simplecloud-api = { module = "app.simplecloud.api:api", version.ref = "simplecloud-api" }
simplecloud-plugin-api = { module = "app.simplecloud.plugin:plugin-shared", version.ref = "simplecloud-plugin-api" }

adventure-api = { module = "net.kyori:adventure-api", version.ref = "adventure" }
adventure-text-minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure" }
adventure-text-serializer-gson = { module = "net.kyori:adventure-text-serializer-gson", version.ref = "adventure" }
adventure-text-serializer-legacy = { module = "net.kyori:adventure-text-serializer-legacy", version.ref = "adventure" }

cloud-command-core = { module = "org.incendo:cloud-core", version.ref = "cloud-command" }
cloud-command-coroutines = { module = "org.incendo:cloud-kotlin-coroutines", version.ref = "cloud-command" }
cloud-command-paper = { module = "org.incendo:cloud-paper", version.ref = "cloud-command-platform" }
cloud-command-minestom = { module = "org.incendo:cloud-minestom", version.ref = "cloud-command-minestom" }

paper-api = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
minestom = { module = "net.minestom:minestom", version.ref = "minestom" }

luckperms-api = { module = "net.luckperms:api", version.ref = "luckperms" }
reflection-remapper = { module = "xyz.jpenilla:reflection-remapper", version.ref = "reflection-remapper" }
Expand All @@ -50,13 +54,14 @@ configurate-yaml = { module = "org.spongepowered:configurate-yaml", version.ref
configurate-kotlin = { module = "org.spongepowered:configurate-extra-kotlin", version.ref = "configurate" }

protoc = { module = "com.google.protobuf:protoc", version.ref = "protoc" }
protobuf-kotlin = { module = "com.google.protobuf:protobuf-kotlin", version.ref = "protobuf-kotlin" }
protobuf-kotlin-lite = { module = "com.google.protobuf:protobuf-kotlin-lite", version.ref = "protobuf-kotlin" }

jnats = { module = "io.nats:jnats", version.ref = "jnats" }
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

[bundles]
configurate = ["configurate-kotlin", "configurate-yaml"]
adventure = ["adventure-api", "adventure-text-minimessage", "adventure-text-serializer-gson"]
adventure = ["adventure-api", "adventure-text-minimessage", "adventure-text-serializer-gson", "adventure-text-serializer-legacy"]
cloud-command = ["cloud-command-core", "cloud-command-coroutines"]

[plugins]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading