diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index f91f646..0000000 --- a/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -# -# https://help.github.com/articles/dealing-with-line-endings/ -# -# Linux start script should use lf -/gradlew text eol=lf - -# These are Windows script files and should use crlf -*.bat text eol=crlf - -# Binary files should be left untouched -*.jar binary - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8501168 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,102 @@ +name: Publish to Maven & Create GitHub Release + +on: + push: + branches: + - 'version/*' + workflow_dispatch: + +env: + SLNE_SNAPSHOTS_REPO_USERNAME: ${{ secrets.SLNE_SNAPSHOTS_REPO_USERNAME }} + SLNE_SNAPSHOTS_REPO_PASSWORD: ${{ secrets.SLNE_SNAPSHOTS_REPO_PASSWORD }} + SLNE_RELEASES_REPO_USERNAME: ${{ secrets.SLNE_RELEASES_REPO_USERNAME }} + SLNE_RELEASES_REPO_PASSWORD: ${{ secrets.SLNE_RELEASES_REPO_PASSWORD }} + MODULE_REGEX: "surf-maintenance-velocity.*-all\\.jar$" + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + +jobs: + build: + runs-on: ubuntu-latest + environment: production + steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: gradle-${{ runner.os }}- + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: 'graalvm' + java-version: '24' + + - name: Build all modules with Gradle + run: ./gradlew build shadowJar --parallel --no-scan + + - name: Publish all modules to Maven + run: ./gradlew publish --parallel --no-scan + + - name: Extract Project Version and Snapshot Flag from Gradle + id: get_version + run: | + VERSION=$(./gradlew properties --no-daemon \ + | grep '^version:' \ + | awk '{print $2}') + SNAPSHOT_FLAG=$(./gradlew properties --no-daemon \ + | grep '^snapshot:' \ + | awk '{print $2}') + if [ "$SNAPSHOT_FLAG" = "true" ]; then + VERSION="${VERSION}-SNAPSHOT" + fi + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "SNAPSHOT_FLAG=$SNAPSHOT_FLAG" >> $GITHUB_ENV + + - name: Determine release flags + run: | + CURRENT_BRANCH=${GITHUB_REF#refs/heads/} + # prerelease only for snapshots + if [ "${SNAPSHOT_FLAG}" = "true" ]; then + echo "PRERELEASE=true" >> $GITHUB_ENV + else + echo "PRERELEASE=false" >> $GITHUB_ENV + fi + # make_latest false for snapshots or non-default branches + if [ "${SNAPSHOT_FLAG}" = "true" ] || [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then + echo "MAKE_LATEST=false" >> $GITHUB_ENV + else + echo "MAKE_LATEST=true" >> $GITHUB_ENV + fi + + - name: Find and filter JAR files + id: find_jars + run: | + echo "JAR_FILES<> $GITHUB_ENV + find . -path "**/build/libs/*.jar" \ + | grep -E "${{ env.MODULE_REGEX }}" \ + >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ env.VERSION }} + name: Release ${{ env.VERSION }} + draft: false + prerelease: ${{ env.PRERELEASE }} + make_latest: ${{ env.MAKE_LATEST }} + files: ${{ env.JAR_FILES }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9cbe271..3b800d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,131 +1,50 @@ -### Intellij template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. - .idea/artifacts - .idea/compiler.xml - .idea/jarRepositories.xml - .idea/modules.xml - .idea/*.iml - .idea/modules - *.iml - *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +.idea/workspace.xml +.idea/misc.xml +.idea/discord.xml +.idea/material_theme_project_new.xml *.iws - -# IntelliJ +*.iml +*.ipr out/ +!**/src/main/**/out/ +!**/src/test/**/out/ -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### Gradle template -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Avoid ignore Gradle wrappper properties -!gradle-wrapper.properties - -# Cache of project -.gradletasknamecache - -# Eclipse Gradle plugin generated files -# Eclipse Core -.project -# JDT-specific (Eclipse Java Development Tools) +### Eclipse ### +.apt_generated .classpath - -### Kotlin template -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# 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* -replay_pid* - - -# Ignore Gradle build output directory -build +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store + +### Other ### +run/ +.kotlin/ \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..2356dc9 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..739bc36 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..7ddfc9e --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index d747b29..f305009 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# surf-cloud-plugin-template -Template for surf-cloud applications +# surf-maintenance +Maintenance plugin for surf-cloud applications diff --git a/build.gradle.kts b/build.gradle.kts index 22a3acb..478c903 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,11 +4,11 @@ buildscript { maven("https://repo.slne.dev/repository/maven-public/") { name = "maven-public" } } dependencies { - classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.7+") + classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.11+") } } allprojects { - group = "dev.slne.surf.template" + group = "dev.slne.surf.maintenance" version = findProperty("version") as String } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 804a362..2214ed7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,4 @@ -org.gradle.configuration-cache=true org.gradle.parallel=true -org.gradle.caching=true kotlin.code.style=official kotlin.stdlib.default.dependency=false -version=1.21.7-1.0.0 \ No newline at end of file +version=1.21.10-1.0.1-SNAPSHOT \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cea7a79..d4081da 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/settings.gradle.kts b/settings.gradle.kts index 2c0bd8e..ade7134 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,13 +1,3 @@ -rootProject.name = "surf-cloud-plugin-template" +rootProject.name = "surf-maintenance" -include("surf-cloud-plugin-template-api:surf-cloud-plugin-template-common-api") -include("surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-common-api") -include("surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-paper-api") -include("surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-velocity-api") -include("surf-cloud-plugin-template-api:surf-cloud-plugin-template-server-api") - -include("surf-cloud-plugin-template-core:surf-cloud-plugin-template-core-common") -include("surf-cloud-plugin-template-core:surf-cloud-plugin-template-core-client") -include("surf-cloud-plugin-template-paper") -include("surf-cloud-plugin-template-velocity") -include("surf-cloud-plugin-template-server") \ No newline at end of file +include("surf-maintenance-velocity") \ No newline at end of file diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-common-api/build.gradle.kts b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-common-api/build.gradle.kts deleted file mode 100644 index c5d6dab..0000000 --- a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-common-api/build.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.core") -} - -surfCoreApi { - withCloudClientCommon() -} - -dependencies { - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-common-api")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-common-api/src/main/kotlin/dev/slne/surf/template/api/client/.gitkeep b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-common-api/src/main/kotlin/dev/slne/surf/template/api/client/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-paper-api/build.gradle.kts b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-paper-api/build.gradle.kts deleted file mode 100644 index 72388b1..0000000 --- a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-paper-api/build.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.paper-raw") -} - -surfRawPaperApi { - withCloudClientPaper() -} - -dependencies { - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-common-api")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-paper-api/src/main/kotlin/dev/slne/surf/template/api/client/paper/.gitkeep b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-paper-api/src/main/kotlin/dev/slne/surf/template/api/client/paper/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-velocity-api/build.gradle.kts b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-velocity-api/build.gradle.kts deleted file mode 100644 index 982fd35..0000000 --- a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-velocity-api/build.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.velocity") -} - -surfVelocityApi { - withCloudClientVelocity() -} - -dependencies { - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-common-api")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-velocity-api/src/main/kotlin/dev/slne/surf/template/api/client/velocity/.gitkeep b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-client-api/surf-cloud-plugin-template-client-velocity-api/src/main/kotlin/dev/slne/surf/template/api/client/velocity/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/build.gradle.kts b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/build.gradle.kts deleted file mode 100644 index 7516627..0000000 --- a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/build.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.core") -} - -surfCoreApi { - withCloudCommon() -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/InternalContextHolder.kt b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/InternalContextHolder.kt deleted file mode 100644 index 5e84c1e..0000000 --- a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/InternalContextHolder.kt +++ /dev/null @@ -1,14 +0,0 @@ -package dev.slne.surf.template.api.common - -import dev.slne.surf.surfapi.core.api.util.requiredService -import dev.slne.surf.template.api.common.util.InternalApi -import org.springframework.context.ApplicationContext - -@InternalApi -interface InternalContextHolder { - val context: ApplicationContext - - companion object { - val instance = requiredService() - } -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/player/.gitkeep b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/player/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/util/InternalApi.kt b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/util/InternalApi.kt deleted file mode 100644 index 9fb6f13..0000000 --- a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-common-api/src/main/kotlin/dev/slne/surf/template/api/common/util/InternalApi.kt +++ /dev/null @@ -1,17 +0,0 @@ -package dev.slne.surf.template.api.common.util - -@RequiresOptIn( - level = RequiresOptIn.Level.ERROR, - message = "This API is intended for internal use only. Do not use it in your code unless you are sure you know what you are doing. " + - "Using this API may lead to unexpected behavior or compatibility issues in future versions." -) -@Retention(AnnotationRetention.BINARY) -@Target( - AnnotationTarget.CLASS, - AnnotationTarget.FUNCTION, - AnnotationTarget.PROPERTY, - AnnotationTarget.TYPEALIAS, - AnnotationTarget.VALUE_PARAMETER, - AnnotationTarget.FIELD -) -annotation class InternalApi \ No newline at end of file diff --git a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-server-api/build.gradle.kts b/surf-cloud-plugin-template-api/surf-cloud-plugin-template-server-api/build.gradle.kts deleted file mode 100644 index 0c45c34..0000000 --- a/surf-cloud-plugin-template-api/surf-cloud-plugin-template-server-api/build.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.core") -} - -surfCoreApi { - withCloudServer() -} - -dependencies { - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-common-api")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-client/build.gradle.kts b/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-client/build.gradle.kts deleted file mode 100644 index af70e24..0000000 --- a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-client/build.gradle.kts +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.core") -} - -surfCoreApi { - withCloudClientCommon() -} - -dependencies { - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-common-api")) - api(project(":surf-cloud-plugin-template-core:surf-cloud-plugin-template-core-common")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-client/src/main/kotlin/dev/slne/surf/template/core/client/.gitkeep b/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-client/src/main/kotlin/dev/slne/surf/template/core/client/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/build.gradle.kts b/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/build.gradle.kts deleted file mode 100644 index 92be4ae..0000000 --- a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/build.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.core") -} - -surfCoreApi { - withCloudCommon() -} - -dependencies { - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-common-api")) -} diff --git a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/SurfCloudPluginTemplateApplication.kt b/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/SurfCloudPluginTemplateApplication.kt deleted file mode 100644 index 03d8480..0000000 --- a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/SurfCloudPluginTemplateApplication.kt +++ /dev/null @@ -1,7 +0,0 @@ -package dev.slne.surf.template - -import dev.slne.surf.cloud.api.common.SurfCloudApplication - -@SurfCloudApplication -class SurfCloudPluginTemplateApplication { -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/core/ContextHolderImpl.kt b/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/core/ContextHolderImpl.kt deleted file mode 100644 index 024c3da..0000000 --- a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/core/ContextHolderImpl.kt +++ /dev/null @@ -1,16 +0,0 @@ -package dev.slne.surf.template.core - -import com.google.auto.service.AutoService -import dev.slne.surf.template.api.common.InternalContextHolder -import dev.slne.surf.template.api.common.util.InternalApi -import org.springframework.context.ApplicationContext - -@OptIn(InternalApi::class) -@AutoService(InternalContextHolder::class) -class ContextHolderImpl : InternalContextHolder { - override lateinit var context: ApplicationContext - - companion object { - val instance = InternalContextHolder.instance as ContextHolderImpl - } -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/core/netty/protocol/.gitkeep b/surf-cloud-plugin-template-core/surf-cloud-plugin-template-core-common/src/main/kotlin/dev/slne/surf/template/core/netty/protocol/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/surf-cloud-plugin-template-paper/build.gradle.kts b/surf-cloud-plugin-template-paper/build.gradle.kts deleted file mode 100644 index f4ff0bc..0000000 --- a/surf-cloud-plugin-template-paper/build.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.paper-plugin") -} - -surfPaperPluginApi { - withCloudClientPaper() - mainClass("dev.slne.surf.template.paper.PaperMain") - bootstrapper("dev.slne.surf.template.paper.PaperBootstrap") -} - -dependencies { - api(project(":surf-cloud-plugin-template-core:surf-cloud-plugin-template-core-client")) - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-paper-api")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-paper/src/main/kotlin/dev/slne/surf/template/paper/PaperBootstrap.kt b/surf-cloud-plugin-template-paper/src/main/kotlin/dev/slne/surf/template/paper/PaperBootstrap.kt deleted file mode 100644 index 3049b7b..0000000 --- a/surf-cloud-plugin-template-paper/src/main/kotlin/dev/slne/surf/template/paper/PaperBootstrap.kt +++ /dev/null @@ -1,16 +0,0 @@ -package dev.slne.surf.template.paper - -import dev.slne.surf.cloud.api.common.CloudInstance -import dev.slne.surf.cloud.api.common.startSpringApplication -import dev.slne.surf.template.SurfCloudPluginTemplateApplication -import dev.slne.surf.template.core.ContextHolderImpl -import io.papermc.paper.plugin.bootstrap.BootstrapContext -import io.papermc.paper.plugin.bootstrap.PluginBootstrap - -@Suppress("UnstableApiUsage") -class PaperBootstrap : PluginBootstrap { - override fun bootstrap(context: BootstrapContext) { - ContextHolderImpl.instance.context = - CloudInstance.startSpringApplication(SurfCloudPluginTemplateApplication::class) - } -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-paper/src/main/kotlin/dev/slne/surf/template/paper/PaperMain.kt b/surf-cloud-plugin-template-paper/src/main/kotlin/dev/slne/surf/template/paper/PaperMain.kt deleted file mode 100644 index c04dea2..0000000 --- a/surf-cloud-plugin-template-paper/src/main/kotlin/dev/slne/surf/template/paper/PaperMain.kt +++ /dev/null @@ -1,9 +0,0 @@ -package dev.slne.surf.template.paper - -import com.github.shynixn.mccoroutine.folia.SuspendingJavaPlugin -import org.bukkit.plugin.java.JavaPlugin - -class PaperMain : SuspendingJavaPlugin() { -} - -val plugin get() = JavaPlugin.getPlugin(PaperMain::class.java) \ No newline at end of file diff --git a/surf-cloud-plugin-template-server/build.gradle.kts b/surf-cloud-plugin-template-server/build.gradle.kts deleted file mode 100644 index 89257bb..0000000 --- a/surf-cloud-plugin-template-server/build.gradle.kts +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.core") -} - -surfCoreApi { - withCloudServer() -} - -dependencies { - api(project(":surf-cloud-plugin-template-core:surf-cloud-plugin-template-core-common")) - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-server-api")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-server/src/main/kotlin/dev/slne/surf/template/server/PluginBootstrap.kt b/surf-cloud-plugin-template-server/src/main/kotlin/dev/slne/surf/template/server/PluginBootstrap.kt deleted file mode 100644 index 0a8464f..0000000 --- a/surf-cloud-plugin-template-server/src/main/kotlin/dev/slne/surf/template/server/PluginBootstrap.kt +++ /dev/null @@ -1,15 +0,0 @@ -package dev.slne.surf.template.server - -import dev.slne.surf.cloud.api.common.CloudInstance -import dev.slne.surf.cloud.api.common.startSpringApplication -import dev.slne.surf.cloud.api.server.plugin.bootstrap.BootstrapContext -import dev.slne.surf.cloud.api.server.plugin.bootstrap.StandalonePluginBootstrap -import dev.slne.surf.template.SurfCloudPluginTemplateApplication -import dev.slne.surf.template.core.ContextHolderImpl - -class PluginBootstrap : StandalonePluginBootstrap { - override suspend fun bootstrap(context: BootstrapContext) { - ContextHolderImpl.instance.context = - CloudInstance.startSpringApplication(SurfCloudPluginTemplateApplication::class) - } -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-server/src/main/kotlin/dev/slne/surf/template/server/PluginMain.kt b/surf-cloud-plugin-template-server/src/main/kotlin/dev/slne/surf/template/server/PluginMain.kt deleted file mode 100644 index 8700720..0000000 --- a/surf-cloud-plugin-template-server/src/main/kotlin/dev/slne/surf/template/server/PluginMain.kt +++ /dev/null @@ -1,14 +0,0 @@ -package dev.slne.surf.template.server - -import dev.slne.surf.cloud.api.server.plugin.StandalonePlugin - -class PluginMain : StandalonePlugin() { - override suspend fun load() { - } - - override suspend fun enable() { - } - - override suspend fun disable() { - } -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-server/src/main/resources/db/migration/.gitkeep b/surf-cloud-plugin-template-server/src/main/resources/db/migration/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/surf-cloud-plugin-template-server/src/main/resources/standalone-plugin.yml b/surf-cloud-plugin-template-server/src/main/resources/standalone-plugin.yml deleted file mode 100644 index 7a7248e..0000000 --- a/surf-cloud-plugin-template-server/src/main/resources/standalone-plugin.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: surf-cloud-plugin-template-server -main: 'dev.slne.surf.template.server.PluginMain' -bootstrapper: 'dev.slne.surf.template.server.PluginBootstrap' -#loader: 'dev.slne.surf.template.server.PluginLoader' -version: 1.21.7-1.0.0 -description: 'Template plugin' -#authors: -# - 'slne' -#contributors: -# - 'slne2' \ No newline at end of file diff --git a/surf-cloud-plugin-template-velocity/build.gradle.kts b/surf-cloud-plugin-template-velocity/build.gradle.kts deleted file mode 100644 index 5edaa0a..0000000 --- a/surf-cloud-plugin-template-velocity/build.gradle.kts +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id("dev.slne.surf.surfapi.gradle.velocity") -} - -surfVelocityApi { - withCloudClientVelocity() -} - -dependencies { - api(project(":surf-cloud-plugin-template-core:surf-cloud-plugin-template-core-client")) - api(project(":surf-cloud-plugin-template-api:surf-cloud-plugin-template-client-api:surf-cloud-plugin-template-client-velocity-api")) -} \ No newline at end of file diff --git a/surf-cloud-plugin-template-velocity/src/main/kotlin/dev/slne/surf/template/velocity/VelocityMain.kt b/surf-cloud-plugin-template-velocity/src/main/kotlin/dev/slne/surf/template/velocity/VelocityMain.kt deleted file mode 100644 index 6f4b8cb..0000000 --- a/surf-cloud-plugin-template-velocity/src/main/kotlin/dev/slne/surf/template/velocity/VelocityMain.kt +++ /dev/null @@ -1,33 +0,0 @@ -package dev.slne.surf.template.velocity - -import com.google.inject.Inject -import com.velocitypowered.api.event.EventManager -import com.velocitypowered.api.plugin.PluginManager -import com.velocitypowered.api.plugin.annotation.DataDirectory -import com.velocitypowered.api.proxy.ProxyServer -import dev.slne.surf.cloud.api.common.CloudInstance -import dev.slne.surf.cloud.api.common.startSpringApplication -import dev.slne.surf.template.SurfCloudPluginTemplateApplication -import dev.slne.surf.template.core.ContextHolderImpl -import java.nio.file.Path - -class VelocityMain @Inject constructor( - val proxy: ProxyServer, - @param:DataDirectory val dataPath: Path, - val pluginManager: PluginManager, - val eventManager: EventManager, -) { - - init { - instance = this - ContextHolderImpl.instance.context = - CloudInstance.startSpringApplication(SurfCloudPluginTemplateApplication::class) - } - - companion object { - lateinit var instance: VelocityMain - } -} - -val plugin get() = VelocityMain.instance -val proxy get() = plugin.proxy \ No newline at end of file diff --git a/surf-maintenance-velocity/build.gradle.kts b/surf-maintenance-velocity/build.gradle.kts new file mode 100644 index 0000000..5713f01 --- /dev/null +++ b/surf-maintenance-velocity/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("dev.slne.surf.surfapi.gradle.velocity") +} + +surfVelocityApi { + withSurfRedis() +} + +velocityPluginFile { + main = "dev.slne.surf.maintenance.velocity.VelocityMain" + authors = listOf("red") +} \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/VelocityMain.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/VelocityMain.kt new file mode 100644 index 0000000..19780ec --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/VelocityMain.kt @@ -0,0 +1,65 @@ +package dev.slne.surf.maintenance.velocity + +import com.github.shynixn.mccoroutine.velocity.SuspendingPluginContainer +import com.google.inject.Inject +import com.velocitypowered.api.event.EventManager +import com.velocitypowered.api.event.Subscribe +import com.velocitypowered.api.event.proxy.ProxyInitializeEvent +import com.velocitypowered.api.event.proxy.ProxyShutdownEvent +import com.velocitypowered.api.plugin.annotation.DataDirectory +import com.velocitypowered.api.proxy.ProxyServer +import dev.slne.surf.maintenance.velocity.command.maintenanceCommand +import dev.slne.surf.maintenance.velocity.config.MaintenanceConfiguration +import dev.slne.surf.maintenance.velocity.listener.ProxyConnectionsListener +import dev.slne.surf.maintenance.velocity.listener.ProxyPingListener +import java.nio.file.Path + +class VelocityMain @Inject constructor( + val proxy: ProxyServer, + @param:DataDirectory val dataPath: Path, + val eventManager: EventManager, + suspendingPluginContainer: SuspendingPluginContainer +) { + var enabled: Boolean = true + + init { + instance = this + suspendingPluginContainer.initialize(this) + } + + @Subscribe + fun onProxyInitialize(event: ProxyInitializeEvent) { + maintenanceCommand() + eventManager.register(this, ProxyPingListener) + eventManager.register(this, ProxyConnectionsListener) + + redisLoader.connect() + + loadFromConfig() + } + + @Subscribe + fun onProxyShutdown(event: ProxyShutdownEvent) { + saveToConfig() + + redisLoader.disconnect() + } + + companion object { + lateinit var instance: VelocityMain + } + + private fun loadFromConfig() { + enabled = configuration.config.enabled + } + + private fun saveToConfig() { + configuration.edit { + this.enabled = this@VelocityMain.enabled + } + } +} + +val plugin get() = VelocityMain.instance +val proxy get() = plugin.proxy +val configuration = MaintenanceConfiguration() \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/VelocityRedisLoader.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/VelocityRedisLoader.kt new file mode 100644 index 0000000..1227f40 --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/VelocityRedisLoader.kt @@ -0,0 +1,21 @@ +package dev.slne.surf.maintenance.velocity + +import dev.slne.surf.maintenance.velocity.redis.listener.event.MaintenanceRedisListener +import dev.slne.surf.redis.RedisApi + +val redisLoader = VelocityRedisLoader() +val redisApi get() = redisLoader.redisApi + +class VelocityRedisLoader { + lateinit var redisApi: RedisApi + + fun connect() { + redisApi = RedisApi.create() + redisApi.subscribeToEvents(MaintenanceRedisListener) + redisApi.freezeAndConnect() + } + + fun disconnect() { + redisApi.disconnect() + } +} \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/command/MaintenanceCommand.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/command/MaintenanceCommand.kt new file mode 100644 index 0000000..0119187 --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/command/MaintenanceCommand.kt @@ -0,0 +1,132 @@ +package dev.slne.surf.maintenance.velocity.command + +import dev.jorel.commandapi.kotlindsl.anyExecutor +import dev.jorel.commandapi.kotlindsl.commandTree +import dev.jorel.commandapi.kotlindsl.literalArgument +import dev.slne.surf.maintenance.velocity.configuration +import dev.slne.surf.maintenance.velocity.plugin +import dev.slne.surf.maintenance.velocity.redis.event.MaintenanceStatusChangeRedisEvent +import dev.slne.surf.maintenance.velocity.redisApi +import dev.slne.surf.maintenance.velocity.util.MaintenancePermissions +import dev.slne.surf.surfapi.core.api.messages.CommonComponents +import dev.slne.surf.surfapi.core.api.messages.adventure.buildText +import dev.slne.surf.surfapi.core.api.messages.adventure.sendText +import java.util.* + +fun maintenanceCommand() = commandTree("maintenance") { + withPermission(MaintenancePermissions.MAINTENANCE_COMMAND) + literalArgument("enable") { + anyExecutor { executor, _ -> + if (plugin.enabled) { + executor.sendText { + appendPrefix() + error("Der Wartungsmodus ist bereits aktiviert.") + } + return@anyExecutor + } + + redisApi.publishEvent( + MaintenanceStatusChangeRedisEvent( + enabled = true + ) + ) + + plugin.enabled = true + + executor.sendText { + appendPrefix() + success("Der Wartungsmodus wurde aktiviert.") + } + } + } + + literalArgument("disable") { + anyExecutor { executor, _ -> + if (!plugin.enabled) { + executor.sendText { + appendPrefix() + error("Der Wartungsmodus ist nicht aktiviert.") + } + return@anyExecutor + } + + redisApi.publishEvent( + MaintenanceStatusChangeRedisEvent( + enabled = false + ) + ) + + plugin.enabled = false + + executor.sendText { + appendPrefix() + success("Der Wartungsmodus wurde deaktiviert.") + } + } + } + + literalArgument("status") { + anyExecutor { executor, _ -> + executor.sendText { + appendPrefix() + info("Der Wartungsmodus ist aktuell ") + if (plugin.enabled) { + error("aktiviert.") + } else { + success("deaktiviert.") + } + } + } + } + + + literalArgument("kick") { + anyExecutor { executor, _ -> + if (!plugin.enabled) { + executor.sendText { + appendPrefix() + error("Der Wartungsmodus ist nicht aktiviert.") + } + return@anyExecutor + } + + executor.sendText { + appendPrefix() + success("Es wurden ") + variableValue(kickPlayers().size) + success(" Spieler gekickt.") + } + } + } + + literalArgument("reload") { + anyExecutor { executor, _ -> + configuration.reload() + + executor.sendText { + appendPrefix() + success("Die Wartungskonfiguration wurde neu geladen.") + } + } + } +} + +private fun kickPlayers(): List { + val list = mutableListOf() + + plugin.proxy.allPlayers.forEach { + if (!it.hasPermission(MaintenancePermissions.MAINTENANCE_BYPASS)) { + it.disconnect(buildText { + appendDisconnectMessage("DER SERVER BEFINDET SICH IM WARTUNGSMODUS", { + variableValue("Es werden nun Wartungen am Server durchgeführt.") + appendNewline() + spacer("Weitere Informationen findest du in unserem Discord.") + }, { + append(CommonComponents.RETRY_LATER_FOOTER) + }) + }) + list.add(it.uniqueId) + } + } + return list +} \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/config/MaintenanceConfig.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/config/MaintenanceConfig.kt new file mode 100644 index 0000000..4769986 --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/config/MaintenanceConfig.kt @@ -0,0 +1,11 @@ +package dev.slne.surf.maintenance.velocity.config + +import org.spongepowered.configurate.objectmapping.ConfigSerializable + +@ConfigSerializable +data class MaintenanceConfig( + var enabled: Boolean = false, + var maintenanceMotd: String = "<#6fa8dc> CASTCRAFTER.DE - WARTUNGSARBEITEN - [1.21.10]\n" + + "<#5ACFF5> Weitere Informationen findest du im Discord.", + var versionMessage: String = "ᴡᴀʀᴛᴜɴɢѕᴀʀʙᴇɪᴛᴇɴ" +) diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/config/MaintenanceConfiguration.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/config/MaintenanceConfiguration.kt new file mode 100644 index 0000000..8602e29 --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/config/MaintenanceConfiguration.kt @@ -0,0 +1,32 @@ +package dev.slne.surf.maintenance.velocity.config + +import dev.slne.surf.maintenance.velocity.plugin +import dev.slne.surf.surfapi.core.api.config.manager.SpongeConfigManager +import dev.slne.surf.surfapi.core.api.config.surfConfigApi + +class MaintenanceConfiguration { + private val configManager: SpongeConfigManager + + init { + surfConfigApi.createSpongeYmlConfig( + MaintenanceConfig::class.java, + plugin.dataPath, + "config.yml" + ) + configManager = surfConfigApi.getSpongeConfigManagerForConfig( + MaintenanceConfig::class.java + ) + reload() + } + + fun edit(block: MaintenanceConfig.() -> Unit) { + configManager.config = configManager.config.apply(block) + configManager.save() + } + + fun reload() { + configManager.reloadFromFile() + } + + val config get() = configManager.config +} \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/listener/ProxyConnectionsListener.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/listener/ProxyConnectionsListener.kt new file mode 100644 index 0000000..bad520d --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/listener/ProxyConnectionsListener.kt @@ -0,0 +1,34 @@ +package dev.slne.surf.maintenance.velocity.listener + +import com.velocitypowered.api.event.ResultedEvent +import com.velocitypowered.api.event.Subscribe +import com.velocitypowered.api.event.connection.LoginEvent +import dev.slne.surf.maintenance.velocity.plugin +import dev.slne.surf.maintenance.velocity.util.MaintenancePermissions +import dev.slne.surf.surfapi.core.api.messages.CommonComponents +import dev.slne.surf.surfapi.core.api.messages.adventure.buildText + +object ProxyConnectionsListener { + @Subscribe + fun onPreConnect(event: LoginEvent) { + val player = event.player + + if (!plugin.enabled) { + return + } + + if (player.hasPermission(MaintenancePermissions.MAINTENANCE_BYPASS)) { + return + } + + event.result = ResultedEvent.ComponentResult.denied(buildText { + appendDisconnectMessage("DER SERVER BEFINDET SICH IM WARTUNGSMODUS", { + variableValue("Zurzeit werden Wartungen am Server durchgeführt.") + appendNewline() + spacer("Weitere Informationen findest du in unserem Discord.") + }, { + append(CommonComponents.RETRY_LATER_FOOTER) + }) + }) + } +} \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/listener/ProxyPingListener.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/listener/ProxyPingListener.kt new file mode 100644 index 0000000..3aa73af --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/listener/ProxyPingListener.kt @@ -0,0 +1,34 @@ +package dev.slne.surf.maintenance.velocity.listener + +import com.velocitypowered.api.event.Subscribe +import com.velocitypowered.api.event.proxy.ProxyPingEvent +import com.velocitypowered.api.proxy.server.ServerPing +import dev.slne.surf.maintenance.velocity.configuration +import dev.slne.surf.maintenance.velocity.plugin +import net.kyori.adventure.text.minimessage.MiniMessage +import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer + +object ProxyPingListener { + @Subscribe(priority = Short.MAX_VALUE) + fun onProxyPing(event: ProxyPingEvent) { + if (!plugin.enabled) { + return + } + + event.ping = event.ping.asBuilder().apply { + description( + MiniMessage.miniMessage().deserialize(configuration.config.maintenanceMotd) + ) + + version( + ServerPing.Version( + 1, + LegacyComponentSerializer.legacySection().serialize( + MiniMessage.miniMessage() + .deserialize(configuration.config.versionMessage) + ) + ) + ) + }.build() + } +} \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/redis/event/MaintenanceStatusChangeRedisEvent.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/redis/event/MaintenanceStatusChangeRedisEvent.kt new file mode 100644 index 0000000..1e78b1f --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/redis/event/MaintenanceStatusChangeRedisEvent.kt @@ -0,0 +1,7 @@ +package dev.slne.surf.maintenance.velocity.redis.event + +import dev.slne.surf.redis.event.RedisEvent +import kotlinx.serialization.Serializable + +@Serializable +data class MaintenanceStatusChangeRedisEvent(val enabled: Boolean) : RedisEvent() \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/redis/listener/event/MaintenanceRedisListener.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/redis/listener/event/MaintenanceRedisListener.kt new file mode 100644 index 0000000..11de27a --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/redis/listener/event/MaintenanceRedisListener.kt @@ -0,0 +1,12 @@ +package dev.slne.surf.maintenance.velocity.redis.listener.event + +import dev.slne.surf.maintenance.velocity.plugin +import dev.slne.surf.maintenance.velocity.redis.event.MaintenanceStatusChangeRedisEvent +import dev.slne.surf.redis.event.OnRedisEvent + +object MaintenanceRedisListener { + @OnRedisEvent + fun onMaintenanceStatusChange(event: MaintenanceStatusChangeRedisEvent) { + plugin.enabled = event.enabled + } +} \ No newline at end of file diff --git a/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/util/MaintenancePermissions.kt b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/util/MaintenancePermissions.kt new file mode 100644 index 0000000..1ea401e --- /dev/null +++ b/surf-maintenance-velocity/src/main/kotlin/dev/slne/surf/maintenance/velocity/util/MaintenancePermissions.kt @@ -0,0 +1,6 @@ +package dev.slne.surf.maintenance.velocity.util + +object MaintenancePermissions { + const val MAINTENANCE_COMMAND = "surf.maintenance.command" + const val MAINTENANCE_BYPASS = "surf.maintenance.bypass" +} \ No newline at end of file