From 6bd52881a9f638e0f4a7f5ad2ee03267ba63382d Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Tue, 21 Mar 2023 00:51:45 -0400 Subject: [PATCH 01/17] Fix ping role Signed-off-by: Ryder Belserion --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 439dc7cb..f6f3ff6f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ webhook { this.username("Ryder Belserion") - this.content("New version of ${rootProject.name} is ready! <@&1029922295210311681>") + this.content("New version of ${rootProject.name} is ready! <@&929463450214735912>") this.embeds { this.embed { @@ -44,4 +44,4 @@ webhook { ) } } -} \ No newline at end of file +} From 78537b5c485620052d3aad23b6e5e725ae2ea545 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 22 Mar 2023 14:40:43 -0400 Subject: [PATCH 02/17] Update comments --- platforms/paper/src/main/resources/tiers/Basic.yml | 2 +- platforms/paper/src/main/resources/tiers/Lucky.yml | 2 +- platforms/paper/src/main/resources/tiers/Titan.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platforms/paper/src/main/resources/tiers/Basic.yml b/platforms/paper/src/main/resources/tiers/Basic.yml index 32d0d089..7b5d7d81 100644 --- a/platforms/paper/src/main/resources/tiers/Basic.yml +++ b/platforms/paper/src/main/resources/tiers/Basic.yml @@ -12,7 +12,7 @@ Settings: Max-Bulk: 3 #The max amount of prizes. Hologram-Toggle: true #Toggle on and off holograms. Hologram-Height: 1.5 #How high the hologram will be from the crate. - Hologram: #Holograms only show if Holographic Displays is on the server. + Hologram: #Requires 3rd party plugins such as DecentHolograms to function. https://github.com/Crazy-Crew/CrazyEnvoys/blob/main/platforms/paper/src/main/java/com/badbones69/crazyenvoys/support/libraries/PluginSupport.java # Available placeholders: # %crazyenvoys_crates_time% shows the grace period of the envoy if the option in config.yml called Crate-Countdown.Toggle is enabled. - '&7&l(&6&l!&7&l) Basic Crate' diff --git a/platforms/paper/src/main/resources/tiers/Lucky.yml b/platforms/paper/src/main/resources/tiers/Lucky.yml index c41e4c3d..258bd583 100644 --- a/platforms/paper/src/main/resources/tiers/Lucky.yml +++ b/platforms/paper/src/main/resources/tiers/Lucky.yml @@ -12,7 +12,7 @@ Settings: Max-Bulk: 3 Hologram-Toggle: true Hologram-Height: 1.5 - Hologram: + Hologram: #Requires 3rd party plugins such as DecentHolograms to function. https://github.com/Crazy-Crew/CrazyEnvoys/blob/main/platforms/paper/src/main/java/com/badbones69/crazyenvoys/support/libraries/PluginSupport.java # %crazyenvoys_crates_time% shows the grace period of the envoy if the option in config.yml called Crate-Countdown.Toggle is enabled. - '&7&l(&e&l!&7&l) &e&lLucky Crate' - '%crazyenvoys_crates_time%' diff --git a/platforms/paper/src/main/resources/tiers/Titan.yml b/platforms/paper/src/main/resources/tiers/Titan.yml index 204c9e6a..4a59dc42 100644 --- a/platforms/paper/src/main/resources/tiers/Titan.yml +++ b/platforms/paper/src/main/resources/tiers/Titan.yml @@ -12,7 +12,7 @@ Settings: Max-Bulk: 3 Hologram-Toggle: true Hologram-Height: 1.5 - Hologram: + Hologram: #Requires 3rd party plugins such as DecentHolograms to function. https://github.com/Crazy-Crew/CrazyEnvoys/blob/main/platforms/paper/src/main/java/com/badbones69/crazyenvoys/support/libraries/PluginSupport.java # %crazyenvoys_crates_time% shows the grace period of the envoy if the option in config.yml called Crate-Countdown.Toggle is enabled. - '&7&l(&4&l!&7&l) &4&lTitan Crate' - '%crazyenvoys_crates_time%' From e5263c7e8c8fbca0dff16f5f7fa884581cee2f15 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 29 Mar 2023 20:19:03 -0400 Subject: [PATCH 03/17] Set root project name --- .github/workflows/build_release.yml | 1 - settings.gradle.kts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 111f3226..614fb348 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -3,7 +3,6 @@ on: push: branches: - main - #- dev workflow_dispatch: inputs: logLevel: diff --git a/settings.gradle.kts b/settings.gradle.kts index 5f10cd11..c81dd3ba 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,8 @@ pluginManagement { } } +rootProject.name = "CrazyEnvoys" + val lowerCase = rootProject.name.lowercase() listOf("paper").forEach(::includePlatform) From 8131335cd5ef96c3d205f9bcc306b446dc6114db Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Thu, 30 Mar 2023 02:24:37 -0400 Subject: [PATCH 04/17] Update webhook garbage --- build.gradle.kts | 14 +++++++++----- gradle/settings.versions.toml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f6f3ff6f..f902bb3f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,12 +14,16 @@ val extension = settings.versions.extension.get() val color = if (beta) betaUpdate else releaseUpdate val repo = if (beta) "beta" else "releases" +val url = if (beta) "https://ci.crazycrew.us/job/${rootProject.name}/" else "https://modrinth.com/$extension/${rootProject.name.lowercase()}/versions" +val download = if (beta) "https://ci.crazycrew.us/job/${rootProject.name}/" else "https://modrinth.com/$extension/${rootProject.name.lowercase()}/version/${rootProject.version}" +val msg = if (beta) "New version of ${rootProject.name} is ready!" else "New version of ${rootProject.name} is ready! <@&929463450214735912>" + webhook { this.avatar("https://en.gravatar.com/avatar/${WebhookExtension.Gravatar().md5Hex("no-reply@ryderbelserion.com")}.jpeg") this.username("Ryder Belserion") - this.content("New version of ${rootProject.name} is ready! <@&929463450214735912>") + this.content(msg) this.embeds { this.embed { @@ -28,7 +32,7 @@ webhook { this.fields { this.field( "Version ${rootProject.version}", - "Download Link: https://modrinth.com/$extension/${rootProject.name.lowercase()}/version/${rootProject.version}" + "Download Link: $url" ) this.field( @@ -39,9 +43,9 @@ webhook { this.author( rootProject.name, - "https://modrinth.com/$extension/${rootProject.name.lowercase()}/versions", - "https://cdn-raw.modrinth.com/data/EMORKQjj/1cf7fffa9bf92d1bc292983dc320984cc764b51e.png" + url, + "https://git.crazycrew.us/ryderbelserion/assets/raw/branch/main/crazycrew/png/${rootProject.name}Website.png" ) } } -} +} \ No newline at end of file diff --git a/gradle/settings.versions.toml b/gradle/settings.versions.toml index 9bd5af06..4dceeacc 100644 --- a/gradle/settings.versions.toml +++ b/gradle/settings.versions.toml @@ -1,7 +1,7 @@ [versions] github = "https://github.com/Crazy-Crew/CrazyEnvoys" -beta = "false" +beta = "true" extension = "plugin" [plugins] From 283111c4c343cadf998d268a86faed572f485d65 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Thu, 30 Mar 2023 02:54:03 -0400 Subject: [PATCH 05/17] Use github hash for beta builds --- build.gradle.kts | 5 +++++ buildSrc/build.gradle.kts | 2 ++ buildSrc/src/main/kotlin/task/WebhookExtension.kt | 6 +++--- gradle.properties | 1 - 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f902bb3f..462fea68 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import com.lordcodes.turtle.shellRun import task.WebhookExtension import java.awt.Color @@ -18,6 +19,10 @@ val url = if (beta) "https://ci.crazycrew.us/job/${rootProject.name}/" else "htt val download = if (beta) "https://ci.crazycrew.us/job/${rootProject.name}/" else "https://modrinth.com/$extension/${rootProject.name.lowercase()}/version/${rootProject.version}" val msg = if (beta) "New version of ${rootProject.name} is ready!" else "New version of ${rootProject.name} is ready! <@&929463450214735912>" +val hash = shellRun("git", listOf("rev-parse", "--short", "HEAD")) + +rootProject.version = if (beta) hash else "1.4.20.4" + webhook { this.avatar("https://en.gravatar.com/avatar/${WebhookExtension.Gravatar().md5Hex("no-reply@ryderbelserion.com")}.jpeg") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 86c425a9..20fb3666 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -20,4 +20,6 @@ dependencies { implementation("io.ktor:ktor-serialization-gson:$ktor") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") + + implementation("com.lordcodes.turtle:turtle:0.8.0") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/task/WebhookExtension.kt b/buildSrc/src/main/kotlin/task/WebhookExtension.kt index 0ece16c7..76fbfb6b 100644 --- a/buildSrc/src/main/kotlin/task/WebhookExtension.kt +++ b/buildSrc/src/main/kotlin/task/WebhookExtension.kt @@ -17,15 +17,15 @@ abstract class WebhookExtension { private val embeds: MutableList = mutableListOf() fun content(content: String) { - this.content = content; + this.content = content } fun username(username: String) { - this.username = username; + this.username = username } fun avatar(avatar: String) { - this.avatar = avatar; + this.avatar = avatar } fun embeds(builder: EmbedsBuilder.() -> Unit) { diff --git a/gradle.properties b/gradle.properties index 44bb1e07..07e6b99b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,5 @@ org.gradle.parallel = false org.gradle.warning.mode = all name = CrazyEnvoys -version = 1.4.20.4 group = com.badbones69.crazyenvoys description = Drop custom envoys with any prize you want all over spawn for players to fight over. \ No newline at end of file From a03f5d31d559862a5230ecd9ffc507b514bad994 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Thu, 30 Mar 2023 02:58:47 -0400 Subject: [PATCH 06/17] Uncomment credentials --- platforms/paper/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/paper/build.gradle.kts b/platforms/paper/build.gradle.kts index c6442397..1eacc019 100644 --- a/platforms/paper/build.gradle.kts +++ b/platforms/paper/build.gradle.kts @@ -119,8 +119,8 @@ publishing { val repo = if (beta) "beta" else "releases" maven("https://repo.crazycrew.us/$repo") { name = "crazycrew" - // Used for locally publishing. - // credentials(PasswordCredentials::class) + + credentials(PasswordCredentials::class) credentials { username = System.getenv("REPOSITORY_USERNAME") From babcfbb215f9a1c4427b38522bc39974a40fd644 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Thu, 30 Mar 2023 03:01:12 -0400 Subject: [PATCH 07/17] [ci-skip] Make version bold --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 462fea68..662e952c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,7 +42,7 @@ webhook { this.field( "API Update", - "Version ${rootProject.version} has been pushed to https://repo.crazycrew.us/#/$repo" + "Version **${rootProject.version}** has been pushed to https://repo.crazycrew.us/#/$repo" ) } From 61bb93bd8ada93939601eeee6d062cc4ff2ee4d4 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Thu, 30 Mar 2023 13:37:02 -0400 Subject: [PATCH 08/17] [ci-skip] Update README.md Signed-off-by: Ryder Belserion --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00cf96e7..e92faccb 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@
-[![CrazyEnvoys](https://git.crazycrew.us/ryderbelserion/Assets/raw/branch/main/crazycrew/webp/CrazyEnvoysBanner.webp)](https://modrinth.com/plugin/crazyenvoys) -
+[![CrazyEnvoys](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/webp/CrazyEnvoysBanner.webp)](https://modrinth.com/plugin/crazyenvoys) + [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] From 1c0c0bcd52728b541165c3a7293e8b49ca053840 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Thu, 30 Mar 2023 16:47:17 -0400 Subject: [PATCH 09/17] [ci-skip] Add change-log snuff --- build.gradle.kts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 662e952c..a8a8d23b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,7 @@ plugins { val releaseUpdate = Color(27, 217, 106) val betaUpdate = Color(255, 163, 71) +val changeLogs = Color(37, 137, 204) val beta = settings.versions.beta.get().toBoolean() val extension = settings.versions.extension.get() @@ -52,5 +53,16 @@ webhook { "https://git.crazycrew.us/ryderbelserion/assets/raw/branch/main/crazycrew/png/${rootProject.name}Website.png" ) } + + this.embed { + this.color(changeLogs) + + this.title("What changed?") + + this.description(""" + Changes: + ยป N/A + """.trimIndent()) + } } } \ No newline at end of file From ab8e59cad32146e98c02e9d85a64eb7f7d7afed0 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Fri, 31 Mar 2023 03:11:34 -0400 Subject: [PATCH 10/17] Use paperweight --- .gitignore | 8 +++----- buildSrc/build.gradle.kts | 20 +++++++++---------- buildSrc/settings.gradle.kts | 6 ++++++ .../crazyenvoys.paper-plugin.gradle.kts | 20 +++++++++++++++++++ .../kotlin/crazyenvoys.root-plugin.gradle.kts | 20 +++++++------------ gradle/libs.versions.toml | 20 ++++++++++++++++++- platforms/paper/build.gradle.kts | 10 +--------- settings.gradle.kts | 2 -- 8 files changed, 65 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index f56b7ad4..9ec7824e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,7 @@ platforms/paper/build platforms/paper/run/* !platforms/paper/run/eula.txt -!platforms/paper/run/bukkit.yml -!platforms/paper/run/spigot.yml -!platforms/paper/run/server.properties -!platforms/paper/run/config -build \ No newline at end of file +build + +jars \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 20fb3666..7876b319 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -7,19 +7,17 @@ repositories { } dependencies { - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10") - implementation("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1") - implementation("com.github.johnrengelman:shadow:8.1.0") + implementation(libs.kotlin) + implementation(libs.shadow) - // For the webhook tasks, this applies to the buildSrc only - val ktor = "2.2.4" + implementation(libs.paperweight) - implementation("io.ktor:ktor-client-core-jvm:$ktor") - implementation("io.ktor:ktor-client-cio-jvm:$ktor") - implementation("io.ktor:ktor-client-content-negotiation:$ktor") - implementation("io.ktor:ktor-serialization-gson:$ktor") + implementation(libs.ktor.core) + implementation(libs.ktor.cio) + implementation(libs.ktor.content) + implementation(libs.ktor.gson) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") + implementation(libs.kotlin.coroutines) - implementation("com.lordcodes.turtle:turtle:0.8.0") + implementation(libs.turtle) } \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index 1bdf3a88..3b3e0b7b 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -1,3 +1,9 @@ dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } + repositories.gradlePluginPortal() } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/crazyenvoys.paper-plugin.gradle.kts b/buildSrc/src/main/kotlin/crazyenvoys.paper-plugin.gradle.kts index 07b00122..c0ec081e 100644 --- a/buildSrc/src/main/kotlin/crazyenvoys.paper-plugin.gradle.kts +++ b/buildSrc/src/main/kotlin/crazyenvoys.paper-plugin.gradle.kts @@ -1,5 +1,7 @@ plugins { id("crazyenvoys.root-plugin") + + id("io.papermc.paperweight.userdev") } repositories { @@ -12,4 +14,22 @@ repositories { * NBT API */ maven("https://repo.codemc.io/repository/maven-public/") +} + +dependencies { + paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT") +} + +tasks { + assemble { + dependsOn(reobfJar) + } + + reobfJar { + val file = File("$rootDir/jars") + + if (!file.exists()) file.mkdirs() + + outputJar.set(layout.buildDirectory.file("$file/${rootProject.name}-Paper-${rootProject.version}.jar")) + } } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts b/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts index 843cf4bd..a4d62635 100644 --- a/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts +++ b/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts @@ -3,25 +3,19 @@ import task.WebhookExtension plugins { `java-library` - `maven-publish` - id("com.github.hierynomus.license") - id("com.github.johnrengelman.shadow") } repositories { maven("https://repo.triumphteam.dev/snapshots") - maven("https://libraries.minecraft.net") - maven("https://repo.crazycrew.us/api") maven("https://jitpack.io") mavenCentral() - mavenLocal() } java { @@ -38,15 +32,15 @@ tasks { } compileJava { + options.encoding = Charsets.UTF_8.name() options.release.set(17) } -} -license { - header = rootProject.file("LICENSE") - encoding = "UTF-8" - - mapping("java", "JAVADOC_STYLE") + javadoc { + options.encoding = Charsets.UTF_8.name() + } - include("**/*.java") + processResources { + filteringCharset = Charsets.UTF_8.name() + } } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 39f057a8..dfbd5022 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,11 +6,15 @@ paper = "1.19.4-R0.1-SNAPSHOT" # Adventure kyori = "4.13.0" +ktor = "2.2.4" +kotlin = "1.8.20-RC" + [libraries] # Minecraft papermc = { module = "io.papermc.paper:paper-api", version.ref = "paper" } paperlib = { module = "io.papermc:paperlib", version = "1.0.8-SNAPSHOT" } +paperweight = { module = "io.papermc.paperweight:paperweight-userdev", version = "1.5.3" } # Gson gson = { module = "com.google.code.gson:gson", version = "2.10.1" } @@ -41,4 +45,18 @@ placeholder_api = { module = "me.clip:placeholderapi", version = "2.11.3" } itemsadder_api = { module = "dev.lone:api-itemsadder", version = "3.2.5" } # World Guard -worldguard_api = { module = "com.sk89q.worldguard:worldguard-bukkit", version = "7.1.0-SNAPSHOT" } \ No newline at end of file +worldguard_api = { module = "com.sk89q.worldguard:worldguard-bukkit", version = "7.1.0-SNAPSHOT" } + +# Kotlin +ktor-core = { module = "io.ktor:ktor-client-core-jvm", version.ref = "ktor" } +ktor-cio = { module = "io.ktor:ktor-client-cio-jvm", version.ref = "ktor" } +ktor-content = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } +ktor-gson = { module = "io.ktor:ktor-serialization-gson", version.ref = "ktor" } + +kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin"} +kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.6.4" } + +shadow = { module = "com.github.johnrengelman:shadow", version = "8.1.0" } + +turtle = { module = "com.lordcodes.turtle:turtle", version = "0.8.0" } \ No newline at end of file diff --git a/platforms/paper/build.gradle.kts b/platforms/paper/build.gradle.kts index 1eacc019..200cc620 100644 --- a/platforms/paper/build.gradle.kts +++ b/platforms/paper/build.gradle.kts @@ -49,12 +49,10 @@ val type = if (beta) "beta" else "release" tasks { shadowJar { - archiveFileName.set("${rootProject.name}+Paper+${rootProject.version}.jar") - listOf( "de.tr7zw.changeme.nbtapi", "org.bstats" - ).forEach { relocate(it, "${rootProject.group}.library.$it") } + ).forEach { pack -> relocate(pack, "${rootProject.group}.$pack") } } runServer { @@ -119,13 +117,7 @@ publishing { val repo = if (beta) "beta" else "releases" maven("https://repo.crazycrew.us/$repo") { name = "crazycrew" - credentials(PasswordCredentials::class) - - credentials { - username = System.getenv("REPOSITORY_USERNAME") - password = System.getenv("REPOSITORY_PASSWORD") - } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index c81dd3ba..62ca75bf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,3 @@ -@file:Suppress("UnstableApiUsage") - dependencyResolutionManagement { versionCatalogs { create("settings") { From a371474c835e9d57e0dd1f11aa074b58c3d6a83d Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Fri, 31 Mar 2023 11:26:06 -0400 Subject: [PATCH 11/17] Stop trying to register papi twice --- .../src/main/java/com/badbones69/crazyenvoys/CrazyEnvoys.java | 2 -- .../crazyenvoys/support/placeholders/PlaceholderAPISupport.java | 1 - 2 files changed, 3 deletions(-) diff --git a/platforms/paper/src/main/java/com/badbones69/crazyenvoys/CrazyEnvoys.java b/platforms/paper/src/main/java/com/badbones69/crazyenvoys/CrazyEnvoys.java index 8c5107c1..74378d81 100644 --- a/platforms/paper/src/main/java/com/badbones69/crazyenvoys/CrazyEnvoys.java +++ b/platforms/paper/src/main/java/com/badbones69/crazyenvoys/CrazyEnvoys.java @@ -147,8 +147,6 @@ public void onEnable() { checkUpdate(); - if (PluginSupport.PLACEHOLDER_API.isPluginEnabled()) new PlaceholderAPISupport().register(); - enable(); } diff --git a/platforms/paper/src/main/java/com/badbones69/crazyenvoys/support/placeholders/PlaceholderAPISupport.java b/platforms/paper/src/main/java/com/badbones69/crazyenvoys/support/placeholders/PlaceholderAPISupport.java index 19067f63..37d83244 100644 --- a/platforms/paper/src/main/java/com/badbones69/crazyenvoys/support/placeholders/PlaceholderAPISupport.java +++ b/platforms/paper/src/main/java/com/badbones69/crazyenvoys/support/placeholders/PlaceholderAPISupport.java @@ -21,7 +21,6 @@ public String onPlaceholderRequest(Player player, String identifier) { boolean isEnabled = FileManager.Files.CONFIG.getFile().getBoolean("Settings.Crate-Countdown.Toggle", false); - if (lower.equals("crates_time")) { if (isEnabled) { if (crazyManager.getCountdownTimer() != null) { From 44b2b047e386845348e2a1c600ae1e4bca8a2b7b Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Fri, 31 Mar 2023 11:40:14 -0400 Subject: [PATCH 12/17] [ci-skip] Update webhook task --- build.gradle.kts | 10 +++++----- buildSrc/src/main/kotlin/task/ReleaseWebhook.kt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a8a8d23b..af0e6b4e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,18 +37,18 @@ webhook { this.fields { this.field( - "Version ${rootProject.version}", - "Download Link: $url" + "Download: ", + url ) this.field( - "API Update", - "Version **${rootProject.version}** has been pushed to https://repo.crazycrew.us/#/$repo" + "API: ", + "https://repo.crazycrew.us/#/$repo/${rootProject.group.toString().replace(".", "/")}/${rootProject.name.lowercase()}-api/${rootProject.version}" ) } this.author( - rootProject.name, + "${rootProject.name} | Version ${rootProject.version}", url, "https://git.crazycrew.us/ryderbelserion/assets/raw/branch/main/crazycrew/png/${rootProject.name}Website.png" ) diff --git a/buildSrc/src/main/kotlin/task/ReleaseWebhook.kt b/buildSrc/src/main/kotlin/task/ReleaseWebhook.kt index ea7f5684..a9ece795 100644 --- a/buildSrc/src/main/kotlin/task/ReleaseWebhook.kt +++ b/buildSrc/src/main/kotlin/task/ReleaseWebhook.kt @@ -34,7 +34,7 @@ abstract class ReleaseWebhook : DefaultTask() { @TaskAction fun webhook() { // The webhook url configured in the gradle.properties - val url = System.getenv("DISCORD_WEBHOOK") + val url = "https://discord.com/api/webhooks/1091062086714540132/KvxrMmGVtWXFSTc7tydwOvGMm4QlJspIR6wSueYnUCzR7GzfQ60ZuBX14TJKC-IPMvoa" runBlocking(Dispatchers.IO) { val response = client.post(url) { From 15423df34be77a70c49bf7956862e225606c9f9e Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Mon, 3 Apr 2023 12:49:23 -0400 Subject: [PATCH 13/17] [ci-skip] Update icon url --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index af0e6b4e..a509a4e4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -50,7 +50,7 @@ webhook { this.author( "${rootProject.name} | Version ${rootProject.version}", url, - "https://git.crazycrew.us/ryderbelserion/assets/raw/branch/main/crazycrew/png/${rootProject.name}Website.png" + "https://raw.githubusercontent.com/RyderBelserion/assets/main/crazycrew/png/${rootProject.name}Website.png" ) } From b0f9ec7de46b0ab1ac05801d1cfd071a422757f8 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Mon, 3 Apr 2023 14:22:31 -0400 Subject: [PATCH 14/17] [ci-skip] Update README --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e92faccb..b3851f31 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,13 @@ -## Resource Page +### Resource Page +![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/compact/available/modrinth_46h.png) ### Beta Builds -All beta builds will be on Modrinth marked as beta.
+

Get the latest changes before marked as release.

-![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/available/modrinth_64h.png) +> https://ci.crazycrew.us/job/CrazyEnvoys/ ## Getting Started From 3a0fca07a68cbf2c294643958c6d2ef1354bd458 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Tue, 4 Apr 2023 02:08:07 -0400 Subject: [PATCH 15/17] [ci-skip] Update webhook task --- build.gradle.kts | 4 + .../kotlin/crazyenvoys.root-plugin.gradle.kts | 11 - .../src/main/kotlin/task/ReleaseWebhook.kt | 52 ----- .../src/main/kotlin/task/WebhookExtension.kt | 213 ------------------ settings.gradle.kts | 3 + 5 files changed, 7 insertions(+), 276 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/task/ReleaseWebhook.kt delete mode 100644 buildSrc/src/main/kotlin/task/WebhookExtension.kt diff --git a/build.gradle.kts b/build.gradle.kts index a509a4e4..353297bf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,8 @@ import java.awt.Color plugins { id("crazyenvoys.root-plugin") + + id("featherpatcher") version "8ef64e4" } val releaseUpdate = Color(27, 217, 106) @@ -65,4 +67,6 @@ webhook { """.trimIndent()) } } + + this.url("DISCORD_WEBHOOK") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts b/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts index a4d62635..712fc0e3 100644 --- a/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts +++ b/buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts @@ -1,6 +1,3 @@ -import task.ReleaseWebhook -import task.WebhookExtension - plugins { `java-library` `maven-publish` @@ -23,14 +20,6 @@ java { } tasks { - // Creating the extension to be available on the root gradle - val webhookExtension = extensions.create("webhook", WebhookExtension::class) - - // Register the task - register("webhook") { - extension = webhookExtension - } - compileJava { options.encoding = Charsets.UTF_8.name() options.release.set(17) diff --git a/buildSrc/src/main/kotlin/task/ReleaseWebhook.kt b/buildSrc/src/main/kotlin/task/ReleaseWebhook.kt deleted file mode 100644 index a9ece795..00000000 --- a/buildSrc/src/main/kotlin/task/ReleaseWebhook.kt +++ /dev/null @@ -1,52 +0,0 @@ -package task - -import io.ktor.client.HttpClient -import io.ktor.client.call.body -import io.ktor.client.engine.cio.CIO -import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.client.request.headers -import io.ktor.client.request.post -import io.ktor.client.request.setBody -import io.ktor.http.ContentType -import io.ktor.http.HttpHeaders -import io.ktor.http.append -import io.ktor.serialization.gson.gson -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.runBlocking -import org.gradle.api.DefaultTask -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.TaskAction - -/** Task to send webhooks to discord. */ -abstract class ReleaseWebhook : DefaultTask() { - - /** Configured extension. */ - @get:Input - lateinit var extension: WebhookExtension - - /** Ktor client for easy requests. */ - private val client = HttpClient(CIO) { - install(ContentNegotiation) { - gson() - } - } - - @TaskAction - fun webhook() { - // The webhook url configured in the gradle.properties - val url = "https://discord.com/api/webhooks/1091062086714540132/KvxrMmGVtWXFSTc7tydwOvGMm4QlJspIR6wSueYnUCzR7GzfQ60ZuBX14TJKC-IPMvoa" - - runBlocking(Dispatchers.IO) { - val response = client.post(url) { - headers { - append(HttpHeaders.ContentType, ContentType.Application.Json) - } - - setBody(extension.build()) - } - - // Should be using logger, but eh - println("Webhook result: ${response.status}") - } - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/task/WebhookExtension.kt b/buildSrc/src/main/kotlin/task/WebhookExtension.kt deleted file mode 100644 index 76fbfb6b..00000000 --- a/buildSrc/src/main/kotlin/task/WebhookExtension.kt +++ /dev/null @@ -1,213 +0,0 @@ -package task - -import com.google.gson.annotations.SerializedName -import java.awt.Color -import java.io.UnsupportedEncodingException -import java.security.MessageDigest -import java.security.NoSuchAlgorithmException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -/** Extension to simplify customizing the webhook. */ -abstract class WebhookExtension { - - private var content: String = "" - private var username: String = "" - private var avatar: String = "" - private val embeds: MutableList = mutableListOf() - - fun content(content: String) { - this.content = content - } - - fun username(username: String) { - this.username = username - } - - fun avatar(avatar: String) { - this.avatar = avatar - } - - fun embeds(builder: EmbedsBuilder.() -> Unit) { - embeds.addAll(EmbedsBuilder().apply(builder).build()) - } - - internal fun build(): Webhook { - return Webhook( - content, - username, - avatar, - false, - embeds.toList() - ) - } - - class Gravatar { - - private fun hexCode(array: ByteArray): String { - val sb = StringBuffer() - for (i in array.indices) { - sb.append(Integer.toHexString((array[i].toInt() and 0xFF) or 0x100).substring(1, 3)) - } - - return sb.toString() - } - - fun md5Hex(message: String): String? { - try { - val md = MessageDigest.getInstance("MD5") - return hexCode(md.digest(message.toByteArray(charset("CP1252")))) - } catch (_: NoSuchAlgorithmException) {} catch (_: UnsupportedEncodingException) { } - return null - } - } - - class EmbedsBuilder { - private val embeds: MutableList = mutableListOf() - - fun embed(builder: EmbedBuilder.() -> Unit) { - embeds.add(EmbedBuilder().apply(builder).build()) - } - - internal fun build() = embeds.toList() - } - - class EmbedBuilder { - private var title: String? = null - private var description: String? = null - private var url: String? = null - private var timestamp: String = "" - private var color: Int? = null - private var footer: Footer? = null - private var image: Image? = null - private var thumbnail: Image? = null - private var provider: Provider? = null - private var author: Author? = null - private var fields: List? = null - - fun title(title: String) { - this.title = title - } - - fun description(description: String) { - this.description = description - } - - fun url(url: String) { - this.url = url - } - - fun timestamp(date: LocalDateTime) { - this.timestamp = date.format(DateTimeFormatter.ISO_DATE_TIME) - } - - fun color(color: Color) { - this.color = color.toInt() - } - - fun footer(text: String, icon: String? = null) { - this.footer = Footer(text, icon) - } - - fun image(url: String) { - this.image = Image(url) - } - - fun thumbnail(url: String) { - this.thumbnail = Image(url) - } - - fun provider(name: String? = null, url: String? = null) { - this.provider = Provider(name, url) - } - - fun author(name: String, url: String? = null, icon: String? = null) { - this.author = Author(name, url, icon) - } - - fun fields(builder: FieldsBuilder.() -> Unit) { - this.fields = FieldsBuilder().apply(builder).build() - } - - internal fun build() = Embed( - title, - description, - url, - timestamp, - color, - footer, - image, - thumbnail, - provider, - author, - fields, - ) - } - - class FieldsBuilder { - private val fields: MutableList = mutableListOf() - - fun field(name: String, value: String, inline: Boolean = false) { - fields.add(Field(name, value, inline)) - } - - internal fun build() = fields.toList() - } - - data class Webhook( - val content: String, - val username: String, - @SerializedName("avatar_url") val avatarUrl: String, - val tts: Boolean, - val embeds: List, - ) - - data class Embed( - val title: String?, - val description: String?, - val url: String?, - val timestamp: String, - val color: Int?, - val footer: Footer?, - val image: Image?, - val thumbnail: Image?, - val provider: Provider?, - val author: Author?, - val fields: List?, - ) - - data class Image( - val url: String, - ) - - data class Author( - val name: String, - val url: String?, - @SerializedName("icon_url") val iconUrl: String?, - ) - - data class Provider( - val name: String?, - val url: String?, - ) - - data class Footer( - val text: String, - @SerializedName("icon_url") val iconUrl: String?, - ) - - data class Field( - val name: String, - val value: String, - val inline: Boolean?, - ) -} - -/** Turns color into integer for webhook, using this because [Color]'s rgb method returns negatives. */ -private fun Color.toInt(): Int { - val red = red shl 16 and 0xFF0000 - val green = green shl 8 and 0x00FF00 - val blue = blue and 0x0000FF - - return red or green or blue -} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 62ca75bf..77a45dc7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,6 +12,9 @@ pluginManagement { repositories { gradlePluginPortal() mavenCentral() + + maven("https://repo.papermc.io/repository/maven-public/") + maven("https://repo.crazycrew.us/api/") } } From fb8d3390a48e476eb11a1b4e325d8272265e1e39 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Tue, 4 Apr 2023 15:57:52 -0400 Subject: [PATCH 16/17] [ci-skip] Bump dependencies --- gradle/libs.versions.toml | 2 +- gradle/settings.versions.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dfbd5022..7629fe98 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ kotlin = "1.8.20-RC" # Minecraft papermc = { module = "io.papermc.paper:paper-api", version.ref = "paper" } paperlib = { module = "io.papermc:paperlib", version = "1.0.8-SNAPSHOT" } -paperweight = { module = "io.papermc.paperweight:paperweight-userdev", version = "1.5.3" } +paperweight = { module = "io.papermc.paperweight:paperweight-userdev", version = "1.5.4" } # Gson gson = { module = "com.google.code.gson:gson", version = "2.10.1" } diff --git a/gradle/settings.versions.toml b/gradle/settings.versions.toml index 4dceeacc..8442f843 100644 --- a/gradle/settings.versions.toml +++ b/gradle/settings.versions.toml @@ -6,5 +6,5 @@ extension = "plugin" [plugins] -minotaur = { id = "com.modrinth.minotaur", version = "2.7.2" } +minotaur = { id = "com.modrinth.minotaur", version = "2.7.5" } run-paper = { id = "xyz.jpenilla.run-paper", version = "2.0.1" } \ No newline at end of file From 2716cfa269c3d67ad4346617846ee1870b0dbb3f Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Thu, 6 Apr 2023 19:33:45 -0400 Subject: [PATCH 17/17] [ci-skip] Version bumps --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7629fe98..33621808 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ paper = "1.19.4-R0.1-SNAPSHOT" kyori = "4.13.0" ktor = "2.2.4" -kotlin = "1.8.20-RC" +kotlin = "1.8.20" [libraries] @@ -57,6 +57,6 @@ kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = " kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin"} kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.6.4" } -shadow = { module = "com.github.johnrengelman:shadow", version = "8.1.0" } +shadow = { module = "com.github.johnrengelman:shadow", version = "8.1.1" } turtle = { module = "com.lordcodes.turtle:turtle", version = "0.8.0" } \ No newline at end of file