From 4914153cf370c42dc9210e6d591b5731f9b30b3a Mon Sep 17 00:00:00 2001 From: ZhangYuheng Date: Tue, 8 Oct 2024 18:13:18 +0800 Subject: [PATCH] prepare basic --- .idea/encodings.xml | 4 +- .idea/misc.xml | 2 +- .idea/remote-targets.xml | 21 ++ build.gradle.kts | 63 +++++ core/build.gradle.kts | 17 ++ .../minecraftpluginutils/AutoTimer.java | 0 .../minecraftpluginutils/ColorParser.java | 0 .../lunadeer/minecraftpluginutils/Common.java | 0 .../GiteaReleaseCheck.java | 0 .../minecraftpluginutils/JsonFile.java | 0 .../minecraftpluginutils/LocationUtils.java | 0 .../minecraftpluginutils/Notification.java | 0 .../minecraftpluginutils/ParticleRender.java | 0 .../minecraftpluginutils/Scheduler.java | 0 .../SendMessageAbstract.java | 0 .../minecraftpluginutils/Teleport.java | 0 .../VaultConnect/Vault.java | 0 .../VaultConnect/Vault2.java | 0 .../VaultConnect/VaultConnect.java | 0 .../VaultConnect/VaultInterface.java | 0 .../minecraftpluginutils/XLogger.java | 0 .../minecraftpluginutils/bStatsMetrics.java | 0 .../minecraftpluginutils/databse/Common.java | 0 .../databse/DatabaseManager.java | 0 .../databse/DatabaseType.java | 0 .../minecraftpluginutils/databse/Field.java | 0 .../databse/FieldType.java | 0 .../databse/SqlSyntax.java | 0 .../databse/TableColumn.java | 0 .../databse/syntax/AddColumn.java | 0 .../databse/syntax/CreateTable.java | 0 .../databse/syntax/DeleteRow.java | 0 .../databse/syntax/InsertRow.java | 0 .../databse/syntax/RemoveColumn.java | 0 .../databse/syntax/UpdateRow.java | 0 .../i18n/Localization.java | 0 .../minecraftpluginutils/i18n/i18n.java | 0 .../minecraftpluginutils/i18n/i18nField.java | 0 .../minecraftpluginutils/scui/CuiManager.java | 0 .../scui/CuiTextInput.java | 0 .../minecraftpluginutils/scui/CuiView.java | 0 .../scui/ItemStackButton.java | 0 .../scui/task/ClickTask.java | 0 .../minecraftpluginutils/stui/ListView.java | 0 .../minecraftpluginutils/stui/TuiHandler.java | 0 .../minecraftpluginutils/stui/TuiManager.java | 0 .../minecraftpluginutils/stui/View.java | 0 .../minecraftpluginutils/stui/ViewStyles.java | 0 .../stui/components/Button.java | 0 .../stui/components/Line.java | 0 .../stui/components/NumChanger.java | 0 .../stui/components/Pagination.java | 0 gradle.properties | 0 gradlew | 234 ++++++++++++++++++ gradlew.bat | 89 +++++++ pom_back.xml | 133 ++++++++++ settings.gradle.kts | 7 + v1_20_1/build.gradle.kts | 18 ++ v1_21/build.gradle.kts | 18 ++ 59 files changed, 603 insertions(+), 3 deletions(-) create mode 100644 .idea/remote-targets.xml create mode 100644 build.gradle.kts create mode 100644 core/build.gradle.kts rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/AutoTimer.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/ColorParser.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/Common.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/GiteaReleaseCheck.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/JsonFile.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/LocationUtils.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/Notification.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/ParticleRender.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/Scheduler.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/SendMessageAbstract.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/Teleport.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault2.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultConnect.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultInterface.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/XLogger.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/bStatsMetrics.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/Common.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseManager.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseType.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/Field.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/FieldType.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/SqlSyntax.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/TableColumn.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/AddColumn.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/CreateTable.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/DeleteRow.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/InsertRow.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/RemoveColumn.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/UpdateRow.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/i18n/Localization.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18n.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18nField.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiManager.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiView.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/scui/ItemStackButton.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/scui/task/ClickTask.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/ListView.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiHandler.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiManager.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/View.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/ViewStyles.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Button.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Line.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/components/NumChanger.java (100%) rename {src => core/src}/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Pagination.java (100%) create mode 100644 gradle.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 pom_back.xml create mode 100644 settings.gradle.kts create mode 100644 v1_20_1/build.gradle.kts create mode 100644 v1_21/build.gradle.kts diff --git a/.idea/encodings.xml b/.idea/encodings.xml index aa00ffa..8dcf5b9 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,7 +1,7 @@ - - + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ba66b1a..3394e6a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/.idea/remote-targets.xml b/.idea/remote-targets.xml new file mode 100644 index 0000000..c66f0e8 --- /dev/null +++ b/.idea/remote-targets.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..3e9be3d --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,63 @@ +import io.papermc.hangarpublishplugin.model.Platforms + +plugins { + id("java") + id("com.github.johnrengelman.shadow") version "8.1.1" + id("io.papermc.hangar-publish-plugin") version "0.1.2" +} + +group = "cn.lunadeer" +version = "1.3.10" + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) +} + +// utf-8 +tasks.withType { + options.encoding = "UTF-8" +} + +allprojects { + apply(plugin = "java") + apply(plugin = "com.github.johnrengelman.shadow") + + repositories { + mavenLocal() + mavenCentral() + maven("https://oss.sonatype.org/content/groups/public") + maven("https://repo.papermc.io/repository/maven-public/") + maven("https://jitpack.io") + maven("https://repo.codemc.org/repository/maven-public") + } + + dependencies { + implementation("org.postgresql:postgresql:42.7.2") + implementation("mysql:mysql-connector-java:8.0.33") + implementation("com.alibaba:fastjson:2.0.31") + implementation("net.kyor:adventure-platform-bukkit:4.3.3") + compileOnly("com.github.MilkBowl:VaultAPI:1.7") + compileOnly("net.milkbowl.vault:VaultUnlockedAPI:2.2") + } + + tasks.shadowJar { + archiveClassifier.set("") + archiveVersion.set(project.version.toString()) + } +} + +dependencies { + implementation(project(":core")) + implementation(project(":v1_20_1")) + implementation(project(":v1_21")) +} + +tasks.shadowJar { + archiveClassifier.set("") + archiveVersion.set(project.version.toString()) +} + +tasks.register("Clean&Build") { // <<<< RUN THIS TASK TO BUILD PLUGIN + dependsOn(tasks.clean) + dependsOn(tasks.shadowJar) +} \ No newline at end of file diff --git a/core/build.gradle.kts b/core/build.gradle.kts new file mode 100644 index 0000000..b00e2f2 --- /dev/null +++ b/core/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + id("java") +} + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of(21)) +} + +// utf-8 +tasks.withType { + options.encoding = "UTF-8" +} + +dependencies { + implementation(project(":api")) + compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT") +} diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/AutoTimer.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/AutoTimer.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/AutoTimer.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/AutoTimer.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/ColorParser.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/ColorParser.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/ColorParser.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/ColorParser.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/Common.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/Common.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/Common.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/Common.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/GiteaReleaseCheck.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/GiteaReleaseCheck.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/GiteaReleaseCheck.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/GiteaReleaseCheck.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/JsonFile.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/JsonFile.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/JsonFile.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/JsonFile.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/LocationUtils.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/LocationUtils.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/LocationUtils.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/LocationUtils.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/Notification.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/Notification.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/Notification.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/Notification.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/ParticleRender.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/ParticleRender.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/ParticleRender.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/ParticleRender.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/Scheduler.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/Scheduler.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/Scheduler.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/Scheduler.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/SendMessageAbstract.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/SendMessageAbstract.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/SendMessageAbstract.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/SendMessageAbstract.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/Teleport.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/Teleport.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/Teleport.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/Teleport.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault2.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault2.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault2.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/Vault2.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultConnect.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultConnect.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultConnect.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultConnect.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultInterface.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultInterface.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultInterface.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/VaultConnect/VaultInterface.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/XLogger.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/XLogger.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/XLogger.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/XLogger.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/bStatsMetrics.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/bStatsMetrics.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/bStatsMetrics.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/bStatsMetrics.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/Common.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/Common.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/Common.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/Common.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseManager.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseManager.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseManager.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseManager.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseType.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseType.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseType.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/DatabaseType.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/Field.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/Field.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/Field.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/Field.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/FieldType.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/FieldType.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/FieldType.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/FieldType.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/SqlSyntax.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/SqlSyntax.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/SqlSyntax.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/SqlSyntax.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/TableColumn.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/TableColumn.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/TableColumn.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/TableColumn.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/AddColumn.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/AddColumn.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/AddColumn.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/AddColumn.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/CreateTable.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/CreateTable.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/CreateTable.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/CreateTable.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/DeleteRow.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/DeleteRow.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/DeleteRow.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/DeleteRow.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/InsertRow.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/InsertRow.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/InsertRow.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/InsertRow.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/RemoveColumn.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/RemoveColumn.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/RemoveColumn.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/RemoveColumn.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/UpdateRow.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/UpdateRow.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/UpdateRow.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/databse/syntax/UpdateRow.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/Localization.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/Localization.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/i18n/Localization.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/Localization.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18n.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18n.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18n.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18n.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18nField.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18nField.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18nField.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/i18n/i18nField.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiManager.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiManager.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiManager.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiManager.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiView.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiView.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiView.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiView.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/scui/ItemStackButton.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/ItemStackButton.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/scui/ItemStackButton.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/ItemStackButton.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/scui/task/ClickTask.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/task/ClickTask.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/scui/task/ClickTask.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/scui/task/ClickTask.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/ListView.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/ListView.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/ListView.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/ListView.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiHandler.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiHandler.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiHandler.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiHandler.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiManager.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiManager.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiManager.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/TuiManager.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/View.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/View.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/View.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/View.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/ViewStyles.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/ViewStyles.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/ViewStyles.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/ViewStyles.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Button.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Button.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Button.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Button.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Line.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Line.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Line.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Line.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/NumChanger.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/NumChanger.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/NumChanger.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/NumChanger.java diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Pagination.java b/core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Pagination.java similarity index 100% rename from src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Pagination.java rename to core/src/main/java/cn/lunadeer/minecraftpluginutils/stui/components/Pagination.java diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..e69de29 diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..1b6c787 --- /dev/null +++ b/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom_back.xml b/pom_back.xml new file mode 100644 index 0000000..490bd6d --- /dev/null +++ b/pom_back.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + + cn.lunadeer + MinecraftPluginUtils + 1.3.10 + lunadeer-minecraft-develop-utils + https://ssl.lunadeer.cn:14446/zhangyuheng/MinecraftPluginUtils + + + + MIT + https://opensource.org/license/mit + + + + + + zhangyuheng + zhangyuheng + zhangyuheng@lunadeer.cn + + Project Manager + Architect + + + + + + https://ssl.lunadeer.cn:14446/zhangyuheng/MinecraftPluginUtils.git + scm:git:ssh://git@ssl.lunadeer.cn:14446/zhangyuheng/MinecraftPluginUtils.git + https://ssl.lunadeer.cn:14446/zhangyuheng/MinecraftPluginUtils + + + + 17 + 17 + UTF-8 + + + + + sonatype + https://oss.sonatype.org/content/groups/public/ + + + papermc + https://repo.papermc.io/repository/maven-public/ + + + + + + dev.folia + folia-api + 1.20.1-R0.1-SNAPSHOT + provided + + + + + + + + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.4.0 + true + + central + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + gpg + zhangyuheng + + + + sign-artifacts + verify + + sign + + + + + + + + + + deer-cloud-release + https://ssl.lunadeer.cn:14454/repository/maven-snapshots/ + + + + \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..6f5ea9f --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,7 @@ +rootProject.name = "Dominion" + +include( + "core", + "v1_20_1", + "v1_21" +) \ No newline at end of file diff --git a/v1_20_1/build.gradle.kts b/v1_20_1/build.gradle.kts new file mode 100644 index 0000000..afb274e --- /dev/null +++ b/v1_20_1/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("java") +} + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of(21)) +} + +// utf-8 +tasks.withType { + options.encoding = "UTF-8" +} + +dependencies { + compileOnly(project(":api")) + compileOnly(project(":core")) + compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT") +} \ No newline at end of file diff --git a/v1_21/build.gradle.kts b/v1_21/build.gradle.kts new file mode 100644 index 0000000..aaa4fdb --- /dev/null +++ b/v1_21/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("java") +} + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of(21)) +} + +// utf-8 +tasks.withType { + options.encoding = "UTF-8" +} + +dependencies { + compileOnly(project(":api")) + compileOnly(project(":core")) + compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") +} \ No newline at end of file