diff --git a/.gitignore b/.gitignore index 6850f28..cf61736 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,22 @@ build .gradle .idea - -buildSrc/.gradle -buildSrc/build - -common/.gradle -common/build - jars +common/build paper/build +api/build + +common/.gradle +api/.gradle paper/.gradle paper/run + !paper/run/config !paper/run/spigot.yml !paper/run/bukkit.yml !paper/run/eula.txt !paper/run/server.properties -!paper/run/plugins \ No newline at end of file +!paper/run/plugins +!paper/run/ops.json \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 8998c42..67a93d5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@
-[![crazyauctions](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/webp/CrazyAuctionsBanner.webp)](https://modrinth.com/plugin/crazyauctions) -
+[![CrazyAuctions](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/webp/CrazyAuctionsBanner.webp)](https://modrinth.com/plugin/crazyauctions) + [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] @@ -16,14 +16,14 @@ ![Purpur](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/supported/purpur_vector.svg)

- Auction off your items in style! + A crates plugin that offers quality crates with ease!
- Explore the docs » + Explore the docs »

- Report Bug + Report Bug · - Request Feature + Request Feature · Get Support

@@ -47,54 +47,45 @@ -## Resource Page - -### Beta Builds -All beta builds will be on Modrinth marked as beta.
- -![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/available/modrinth_64h.png) +### Resource Page +[![Hangar](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/compact/available/hangar_46h.png)](https://hangar.papermc.io/CrazyCrew/CrazyAuctions) +[![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/compact/available/modrinth_46h.png)](https://modrinth.com/user/plugin/CrazyAuctions) ## Getting Started - How to get started with contributing / maintaining your own version of CrazyAuctions! ### Prerequisites - A list of things necessary to make sure you can build CrazyAuctions properly. * Intellij IDEA * > https://www.jetbrains.com/idea/download/ * Gradle ### Installation - 1. Clone the repo ```sh git clone https://github.com/Crazy-Crew/CrazyAuctions.git ``` 2. Open the repository using Intellij IDEA & wait until it finishes downloading/indexing. -3. Run the assemble task. +3. Run the clean assemble task. ```gradle - ./gradlew assemble + ./gradlew clean assemble ``` ## Roadmap - -Check our public [trello board](https://trello.com/b/CcPYmsBt) for our current plans, any bugs and general tracking of the project progress. +Check our public [trello board](https://trello.com/b/bzQ5TwXo) for our current plans, any bugs and general tracking of the project progress. ## Contributing - 1. Fork the Project 2. Create your Feature Branch (`git checkout -b feature/yourfeature`) 3. Commit your Changes (`git commit -m 'your amazing feature.'`) 4. Push to the Branch (`git push`) -5. Open a Pull Request to the dev branch to add your feature/fix. +5. Open a Pull Request to the `main` branch to add your feature/fix. ## License - Distributed under the MIT License. See [`LICENSE`](/LICENSE) for more information. [discord-shield]: https://img.shields.io/discord/182615261403283459.svg?style=flat&logo=appveyor -[discord-url]: https://discord.gg/crazycrew +[discord-url]: https://discord.gg/badbones-s-live-chat-182615261403283459 [contributors-shield]: https://img.shields.io/github/contributors/Crazy-Crew/CrazyAuctions.svg?style=flat&logo=appveyor [contributors-url]: https://github.com/Crazy-Crew/CrazyAuctions/graphs/contributors diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 7d3a251..0000000 --- a/build.gradle +++ /dev/null @@ -1,59 +0,0 @@ -plugins { - id 'java-library' -} - -defaultTasks 'build' - -assemble { - subprojects.forEach { project -> dependsOn ":${project.name}:build" } - - doLast { - File dir = new File(rootDir, "jars") - - if (dir.exists()) dir.delete() - - dir.mkdirs() - - copy { - from(project("paper").layout.buildDirectory.file("libs/${rootProject.name}-${rootProject.version}.jar").get()) - into(dir) - } - } -} - -subprojects { - apply plugin: 'java-library' - - repositories { - maven { url = 'https://repo.crazycrew.us/releases' } - - maven { url = 'https://jitpack.io' } - - mavenCentral() - } - - if (name == "paper") { - repositories { - maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' } - } - } - - compileJava { - options.encoding = 'UTF-8' - options.release.set(17) - } - - java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } - } - - javadoc { - options.encoding = 'UTF-8' - } - - processResources { - filteringCharset = 'UTF-8' - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..67c43e1 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,40 @@ +import org.gradle.kotlin.dsl.support.uppercaseFirstChar + +plugins { + id("root-plugin") +} + +tasks { + assemble { + val jarsDir = File("$rootDir/jars") + + doFirst { + delete(jarsDir) + + jarsDir.mkdirs() + } + + subprojects.filter { it.name == "paper" || it.name == "fabric" }.forEach { project -> + dependsOn(":${project.name}:build") + + doLast { + runCatching { + val file = File("$jarsDir/${project.name.uppercaseFirstChar().lowercase()}") + + file.mkdirs() + + copy { + from(project.layout.buildDirectory.file("libs/${rootProject.name}-${project.version}.jar")) + into(file) + } + }.onSuccess { + // Delete to save space on jenkins. + delete(project.layout.buildDirectory.get()) + delete(rootProject.layout.buildDirectory.get()) + }.onFailure { + println("Failed to copy file out of build folder into jars directory: Likely does not exist.") + } + } + } + } +} \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000..63f0610 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + `kotlin-dsl` +} + +dependencies { + implementation(libs.paperweight) + + implementation(libs.shadowjar) + + implementation(libs.runpaper) + + implementation(libs.modrinth) + + implementation(libs.hangar) +} \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 0000000..4720f82 --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,14 @@ +dependencyResolutionManagement { + repositories { + maven("https://repo.papermc.io/repository/maven-public/") + + gradlePluginPortal() + mavenCentral() + } + + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/fabric-plugin.gradle.kts b/buildSrc/src/main/kotlin/fabric-plugin.gradle.kts new file mode 100644 index 0000000..36e9675 --- /dev/null +++ b/buildSrc/src/main/kotlin/fabric-plugin.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("root-plugin") +} + +base { + archivesName.set(rootProject.name) +} + +val mcVersion = providers.gradleProperty("mcVersion").get() +val fabricVersion = providers.gradleProperty("version").get() + +project.version = if (System.getenv("BUILD_NUMBER") != null) "$fabricVersion-${System.getenv("BUILD_NUMBER")}" else fabricVersion + +tasks { + modrinth { + loaders.addAll("fabric") + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/paper-plugin.gradle.kts b/buildSrc/src/main/kotlin/paper-plugin.gradle.kts new file mode 100644 index 0000000..bf49857 --- /dev/null +++ b/buildSrc/src/main/kotlin/paper-plugin.gradle.kts @@ -0,0 +1,51 @@ +plugins { + id("io.papermc.paperweight.userdev") + + id("xyz.jpenilla.run-paper") + + id("root-plugin") +} + +base { + archivesName.set(rootProject.name) +} + +repositories { + maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") + + maven("https://repo.papermc.io/repository/maven-public/") + + maven("https://repo.codemc.io/repository/maven-public/") + + maven("https://repo.triumphteam.dev/snapshots/") + + maven("https://repo.oraxen.com/releases/") + + flatDir { dirs("libs") } +} + +val mcVersion = providers.gradleProperty("mcVersion").get() + +project.version = if (System.getenv("BUILD_NUMBER") != null) "${rootProject.version}-${System.getenv("BUILD_NUMBER")}" else rootProject.version + +dependencies { + paperweight.paperDevBundle("$mcVersion-R0.1-SNAPSHOT") +} + +tasks { + assemble { + dependsOn(reobfJar) + } + + runServer { + jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor") + + defaultCharacterEncoding = Charsets.UTF_8.name() + + minecraftVersion(mcVersion) + } + + modrinth { + loaders.addAll("paper", "purpur") + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/root-plugin.gradle.kts b/buildSrc/src/main/kotlin/root-plugin.gradle.kts new file mode 100644 index 0000000..0546e5d --- /dev/null +++ b/buildSrc/src/main/kotlin/root-plugin.gradle.kts @@ -0,0 +1,147 @@ +import gradle.kotlin.dsl.accessors._8291d1211fdf2e346e0abe66afb65704.idea +import io.papermc.hangarpublishplugin.model.Platforms +import org.gradle.kotlin.dsl.support.uppercaseFirstChar +import java.io.ByteArrayOutputStream + +plugins { + id("io.papermc.hangar-publish-plugin") + + id("com.github.johnrengelman.shadow") + + id("com.modrinth.minotaur") + + `java-library` + + `maven-publish` + + idea +} + +idea { + module { + isDownloadJavadoc = true + isDownloadSources = true + } +} + +repositories { + maven("https://repo.crazycrew.us/snapshots/") + + maven("https://repo.crazycrew.us/releases/") + + maven("https://jitpack.io/") + + mavenCentral() +} + +// The commit id for the "main" branch prior to merging a pull request. +/*val start = "e888a19" + +// The commit id BEFORE merging the pull request so before "Merge pull request #30" +val end = "f78f454" + +val commitLog = getGitHistory().joinToString(separator = "") { formatGitLog(it) } + +fun getGitHistory(): List { + val output: String = ByteArrayOutputStream().use { outputStream -> + project.exec { + executable("git") + args("log", "$start..$end", "--format=format:%h %s") + standardOutput = outputStream + } + + outputStream.toString() + } + + return output.split("\n") +} + +fun formatGitLog(commitLog: String): String { + val hash = commitLog.take(7) + val message = commitLog.substring(8) // Get message after commit hash + space between + return "[$hash](https://github.com/Crazy-Crew/${rootProject.name}/commit/$hash) $message
" +}*/ + +val changes = """ +${rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)} +## Commits +
+Other + +commitLog +
+""".trimIndent() + +tasks { + compileJava { + options.encoding = Charsets.UTF_8.name() + options.release.set(17) + } + + javadoc { + options.encoding = Charsets.UTF_8.name() + } + + processResources { + filteringCharset = Charsets.UTF_8.name() + } + + shadowJar { + archiveClassifier.set("") + + exclude("META-INF/**") + } + + val directory = File("$rootDir/jars/${project.name.lowercase()}") + val mcVersion = providers.gradleProperty("mcVersion").get() + + val isBeta: Boolean = providers.gradleProperty("isBeta").get().toBoolean() + val type = if (isBeta) "Beta" else "Release" + + // Publish to hangar.papermc.io. + hangarPublish { + publications.register("plugin") { + version.set("${project.version}") + + id.set(rootProject.name) + + channel.set(type) + + changelog.set(changes) + + apiKey.set(System.getenv("hangar_key")) + + platforms { + register(Platforms.PAPER) { + jar.set(file("$directory/${rootProject.name}-${project.version}.jar")) + + platformVersions.set(listOf(mcVersion)) + } + } + } + } + + modrinth { + versionType.set(type.lowercase()) + + autoAddDependsOn.set(false) + + token.set(System.getenv("modrinth_token")) + + projectId.set(rootProject.name.lowercase()) + + changelog.set(changes) + + versionName.set("${rootProject.name} ${project.version}") + + versionNumber.set("${project.version}") + + uploadFile.set("$directory/${rootProject.name}-${project.version}.jar") + + gameVersions.add(mcVersion) + } +} + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of("17")) +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2f0056a..001ddc1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,6 @@ org.gradle.jvmargs = '-Xmx3G' -org.gradle.parallel = false +org.gradle.caching = true +org.gradle.parallel = true org.gradle.warning.mode = all authors = ["Ryderbelserion, Badbones69"] @@ -9,8 +10,8 @@ issues = https://github.com/Crazy-Crew/CrazyAuctions/issues group = com.badbones69.crazyauctions description = Auction off items in style. -version = 1.3.2 +version = 1.3.3 apiVersion = 1.20 -minecraftVersion = 1.20.2 +mcVersion = 1.20.4 isBeta = true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 700f14e..0de57d8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,35 +1,28 @@ [versions] kyori_version = "4.14.0" -cluster_version = "3.1" +shadow_version = "8.1.1" +paperweight_version = "1.5.9" +runpaper_version = "2.2.3" + +modrinth_version = "2.8.7" +hangar_version = "0.1.2" [plugins] -hangar = { id = "io.papermc.hangar-publish-plugin", version = "0.1.0" } -modrinth = { id = "com.modrinth.minotaur", version = "2.8.4" } +hangar = { id = "io.papermc.hangar-publish-plugin", version.ref = "hangar_version" } +modrinth = { id = "com.modrinth.minotaur", version.ref = "modrinth_version" } -paperweight = { id = "io.papermc.paperweight.userdev", version = "1.5.9" } -runpaper = { id = "xyz.jpenilla.run-paper", version = "2.2.2" } -shadowjar = { id = "com.github.johnrengelman.shadow", version = "8.1.1" } +paperweight = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight_version" } +runpaper = { id = "xyz.jpenilla.run-paper", version.ref = "runpaper_version" } +shadowjar = { id = "com.github.johnrengelman.shadow", version.ref = "shadow_version" } [libraries] adventure = { module = "net.kyori:adventure-api", version.ref = "kyori_version" } minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "kyori_version" } -cluster_paper = { module = "com.ryderbelserion.cluster.paper:cluster-paper", version.ref = "cluster_version" } -cluster_api = { module = "com.ryderbelserion.cluster.api:cluster-api", version.ref = "cluster_version" } +paperweight = { module = "io.papermc.paperweight:paperweight-userdev", version.ref = "paperweight_version" } +shadowjar = { module = "com.github.johnrengelman:shadow", version.ref = "shadow_version" } +runpaper = { module = "xyz.jpenilla:run-task", version.ref = "runpaper_version" } -vault = { module = "com.github.MilkBowl:VaultAPI", version = "1.7.1" } - -triumph_cmds = { module = "dev.triumphteam:triumph-cmd-bukkit", version = "2.0.0-SNAPSHOT" } - -config_me = { module = "ch.jalu:configme", version = "1.4.1" } - -metrics = { module = "org.bstats:bstats-bukkit", version = "3.0.2" } - -itemsadder = { module = "com.github.LoneDev6:api-itemsadder", version = "3.6.1" } -oraxen = { module = "io.th0rgal:oraxen", version = "1.164.0" } - -holographicdisplays = { module = "me.filoghost.holographicdisplays:holographicdisplays-api", version = "3.0.0" } -decentholograms = { module = "com.github.decentsoftware-eu:decentholograms", version = "2.8.4" } - -placeholderapi = { module = "me.clip:placeholderapi", version = "2.11.4" } \ No newline at end of file +hangar = { module = "io.papermc:hangar-publish-plugin", version.ref = "hangar_version" } +modrinth = { module = "com.modrinth.minotaur:Minotaur", version.ref = "modrinth_version" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..d64cd49 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 870dc35..92c1ac1 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.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/paper/build.gradle b/paper/build.gradle deleted file mode 100644 index 8c0034f..0000000 --- a/paper/build.gradle +++ /dev/null @@ -1,127 +0,0 @@ -import io.papermc.hangarpublishplugin.model.Platforms - -plugins { - alias(libs.plugins.paperweight) - alias(libs.plugins.shadowjar) - - alias(libs.plugins.modrinth) - - alias(libs.plugins.runpaper) - - alias(libs.plugins.hangar) -} - -base { - archivesName = "${rootProject.name}" -} - -dependencies { - implementation(libs.metrics) - - compileOnly(libs.vault) - - paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:$minecraftVersion-R0.1-SNAPSHOT") -} - -String type = isBeta ? "Beta" : "Release" - -String description = """ -## Fixes: - * Fix not being able to buy items - * Fix an issue where it would scream about tasks needing to be run sync - -## Other: - * [Feature Requests](https://github.com/Crazy-Crew/${rootProject.name}/issues) - * [Bug Reports](https://github.com/Crazy-Crew/${rootProject.name}/issues) -""" - -File file = project.layout.buildDirectory.file("libs/${rootProject.name}-${rootProject.version}.jar").get().asFile - -tasks { - runServer { - // Publish to hangar.papermc.io. - hangarPublish { - publications.register("plugin") { - version.set("$rootProject.version") - - id.set(rootProject.name) - - channel.set(type) - - changelog.set(description) - - apiKey.set(System.getenv("hangar_key")) - - platforms { - register(Platforms.PAPER) { - jar.set(file) - - platformVersions.set(["$minecraftVersion"]) - } - } - } - } - - // Publish to modrinth. - modrinth { - setAutoAddDependsOn(false) - - token.set(System.getenv("modrinth_token")) - - projectId.set(rootProject.name.toLowerCase()) - - versionName.set("${rootProject.name} ${rootProject.version}") - - versionNumber.set("${rootProject.version}") - - versionType.set(type.toLowerCase()) - - uploadFile.set(file) - - gameVersions.add(minecraftVersion) - - changelog.set(description) - - loaders.addAll("paper", "purpur") - } - - jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor") - - minecraftVersion(minecraftVersion) - } - - assemble { - dependsOn(reobfJar) - } - - shadowJar { - mergeServiceFiles() - - exclude("META-INF/**") - - List.of( - "org.bstats" - ).forEach { - relocate(it, "libs.$it") - } - } - - processResources { - Map props = new HashMap<>() - - props.put("name", rootProject.name) - props.put("version", "$rootProject.version") - props.put("group", "$project.group") - props.put("description", rootProject.description) - - props.put("apiVersion", apiVersion) - props.put("authors", authors) - props.put("website", website) - - inputs.properties(props) - - filesMatching("plugin.yml") { - expand(props) - } - } -} \ No newline at end of file diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts new file mode 100644 index 0000000..bc55659 --- /dev/null +++ b/paper/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + id("paper-plugin") +} + +dependencies { + implementation(libs.metrics) + + compileOnly(libs.vault) { + exclude("org.bukkit", "bukkit") + } + + compileOnly(fileTree("libs").include("*.jar")) +} + +tasks { + shadowJar { + listOf( + "org.bstats" + ).forEach { + relocate(it, "libs.$it") + } + } + + processResources { + val properties = hashMapOf( + "name" to rootProject.name, + "version" to project.version, + "group" to rootProject.group, + "description" to rootProject.description, + "apiVersion" to providers.gradleProperty("apiVersion").get(), + "authors" to providers.gradleProperty("authors").get(), + "website" to providers.gradleProperty("website").get() + ) + + inputs.properties(properties) + + filesMatching("plugin.yml") { + expand(properties) + } + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e94a571..0000000 --- a/settings.gradle +++ /dev/null @@ -1,13 +0,0 @@ -pluginManagement { - repositories { - - maven { url = 'https://repo.papermc.io/repository/maven-public/' } - - gradlePluginPortal() - mavenCentral() - } -} - -rootProject.name = 'CrazyAuctions' - -include 'paper' \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..1208c8f --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,53 @@ +pluginManagement { + repositories { + maven("https://repo.papermc.io/repository/maven-public/") + + gradlePluginPortal() + mavenCentral() + } +} + +dependencyResolutionManagement { + repositories { + maven("https://repo.papermc.io/repository/maven-public/") + + gradlePluginPortal() + mavenCentral() + } + + versionCatalogs { + create("libs") { + version("cluster", "6.3") + + library("holographicdisplays", "me.filoghost.holographicdisplays", "holographicdisplays-api").version("3.0.0") + + library("decentholograms", "com.github.decentsoftware-eu", "decentholograms").version("2.8.6") + + library("triumphcmds", "dev.triumphteam", "triumph-cmd-bukkit").version("2.0.0-SNAPSHOT") + + library("cluster_paper", "com.ryderbelserion.cluster", "paper").versionRef("cluster") + library("cluster_api", "com.ryderbelserion.cluster", "paper").versionRef("cluster") + + library("itemsadder", "com.github.LoneDev6", "api-itemsadder").version("3.6.1") + + library("placeholderapi", "me.clip", "placeholderapi").version("2.11.5") + + library("triumphgui", "dev.triumphteam", "triumph-gui").version("3.1.7") + + library("metrics", "org.bstats", "bstats-bukkit").version("3.0.2") + + library("nbtapi", "de.tr7zw", "item-nbt-api").version("2.12.2") + + library("vault", "com.github.MilkBowl", "VaultAPI").version("1.7.1") + + library("oraxen", "io.th0rgal", "oraxen").version("1.164.0") + + library("configme", "ch.jalu", "configme").version("1.4.1") + } + } +} + +rootProject.name = "CrazyAuctions" + +include("paper") +//include("fabric") \ No newline at end of file