diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 74dce85b8..c5a002573 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -1,14 +1,22 @@ plugins { - `paper-plugin` + id("com.github.johnrengelman.shadow") + + `root-plugin` } project.group = "us.crazycrew.crazycrates" project.version = "1.0-snapshot" +repositories { + maven("https://repo.papermc.io/repository/maven-public/") +} + dependencies { - compileOnly(libs.vital) + compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT") compileOnly(libs.config.me) + + compileOnly(libs.vital) } java { diff --git a/build.gradle.kts b/build.gradle.kts index d99c618b2..d39c762c4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,17 +1,21 @@ -plugins { - `root-plugin` +import git.formatLog +import git.latestCommitHash +import git.latestCommitMessage +plugins { id("io.papermc.hangar-publish-plugin") version "0.1.2" id("com.modrinth.minotaur") version "2.+" -} -rootProject.version = if (System.getenv("NEXT_BUILD_NUMBER") != null) "2.1-${System.getenv("NEXT_BUILD_NUMBER")}" else "2.1" + id("com.github.johnrengelman.shadow") -dependencies { - api(project(":paper", configuration = "shadow")) + `root-plugin` } -val isSnapshot = rootProject.version.toString().contains("-") +val buildNumber: String? = System.getenv("NEXT_RUN_NUMBER") + +rootProject.version = if (buildNumber != null) "2.1-$buildNumber" else "2.1" + +val isSnapshot = true val content: String = if (isSnapshot) { if (System.getenv("COMMIT_MESSAGE") != null) { @@ -23,6 +27,10 @@ val content: String = if (isSnapshot) { rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8) } +subprojects.filter { it.name != "api" }.forEach { + it.project.version = rootProject.version +} + modrinth { token.set(System.getenv("MODRINTH_TOKEN")) @@ -35,9 +43,12 @@ modrinth { changelog.set(content) - uploadFile.set(file("$rootDir/jars/${rootProject.name}-${rootProject.version}.jar")) + uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar")) - gameVersions.set(listOf(libs.versions.bundle.get())) + gameVersions.set(listOf( + "1.20.4" + //"1.20.5" + )) loaders.add("paper") loaders.add("purpur") @@ -61,9 +72,12 @@ hangarPublish { platforms { paper { - jar.set(file("$rootDir/jars/${rootProject.name}-${rootProject.version}.jar")) + jar.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar")) - platformVersions.set(listOf(libs.versions.bundle.get())) + platformVersions.set(listOf( + "1.20.4" + //"1.20.5" + )) dependencies { hangar("PlaceholderAPI") { @@ -90,7 +104,7 @@ hangarPublish { tasks { assemble { doFirst { - delete("$rootDir/jars") + delete(rootProject.projectDir.resolve("jars")) } } } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/tools.kt b/buildSrc/src/main/kotlin/git/tools.kt similarity index 98% rename from buildSrc/src/main/kotlin/tools.kt rename to buildSrc/src/main/kotlin/git/tools.kt index 5378a7d72..f19eea233 100644 --- a/buildSrc/src/main/kotlin/tools.kt +++ b/buildSrc/src/main/kotlin/git/tools.kt @@ -1,3 +1,5 @@ +package git + import org.gradle.api.Project import java.io.ByteArrayOutputStream diff --git a/buildSrc/src/main/kotlin/root-plugin.gradle.kts b/buildSrc/src/main/kotlin/root-plugin.gradle.kts index 6372773e1..314fcea5f 100644 --- a/buildSrc/src/main/kotlin/root-plugin.gradle.kts +++ b/buildSrc/src/main/kotlin/root-plugin.gradle.kts @@ -1,6 +1,4 @@ plugins { - id("com.github.johnrengelman.shadow") - `java-library` `maven-publish` @@ -19,8 +17,6 @@ repositories { maven("https://repo.triumphteam.dev/snapshots/") - maven("https://repo.crazycrew.us/snapshots/") - maven("https://repo.crazycrew.us/releases/") maven("https://repo.oraxen.com/releases/") diff --git a/gradle.properties b/gradle.properties index 95ea118d7..76dd8b148 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,8 @@ -name = CrazyCrates -group = com.badbones69.crazycrates -description = Create unlimited crates with multiple crate types to choose from! +org.gradle.jvmargs=-Xmx3G +org.gradle.daemon=false +org.gradle.parallel=false -org.gradle.parallel = true -org.gradle.caching = true -org.gradle.jvmargs = '-Xmx3G' \ No newline at end of file +group=com.badbones69.crazycrates +authors=["ryderbelserion", "BadBones69"] +description=Create unlimited crates with multiple crate types to choose from! +website=https://modrinth.com/plugin/crazycrates \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 97ef948d2..ee61004e2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,8 @@ [plugins] -bukkit-convention = { id = "xyz.jpenilla.resource-factory-bukkit-convention", version = "1.0.0" } run-paper = { id = "xyz.jpenilla.run-paper", version = "2.2.3" } [versions] -bundle = "1.20.4" +minecraftVersion = "1.20.4" [libraries] itemsadder-api = { group = "com.github.LoneDev6", name = "api-itemsadder", version = "3.6.1" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd4917..e6441136f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts index f8b06dc75..5cb4497e3 100644 --- a/paper/build.gradle.kts +++ b/paper/build.gradle.kts @@ -1,17 +1,17 @@ plugins { + id("com.github.johnrengelman.shadow") + alias(libs.plugins.run.paper) `paper-plugin` } -val mcVersion = libs.versions.bundle - dependencies { compileOnly(fileTree("$rootDir/libs/compile").include("*.jar")) implementation(project(":api")) - implementation(libs.bundles.triumph) + implementation(libs.triumph.cmds) implementation(libs.config.me) @@ -51,35 +51,23 @@ tasks { } shadowJar { - archiveClassifier.set("") - - //archiveFileName.set("${rootProject.name}-${rootProject.version}.jar") - //destinationDirectory.set(rootProject.projectDir.resolve("jars")) - listOf( "dev.triumphteam", "org.bstats", "ch.jalu" - ).forEach { - relocate(it, "libs.$it") - } + ).forEach { relocate(it, "libs.$it") } } processResources { - val properties = hashMapOf( - "name" to rootProject.name, - "version" to rootProject.version, - "group" to rootProject.group, - "description" to rootProject.description, - "apiVersion" to "1.20", - "authors" to listOf("RyderBelserion", "BadBones69"), - "website" to "https://modrinth.com/plugin/crazycrates" - ) - - inputs.properties(properties) - - filesMatching("plugin.yml") { - expand(properties) + inputs.properties("name" to rootProject.name) + inputs.properties("version" to project.version) + inputs.properties("group" to project.group) + //inputs.properties("authors" to project.properties["authors"]) + inputs.properties("description" to project.properties["description"]) + inputs.properties("website" to project.properties["website"]) + + filesMatching("paper-plugin.yml") { + expand(inputs.properties) } } -} +} \ No newline at end of file diff --git a/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java b/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java index 41a4478c7..4419896d2 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java +++ b/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java @@ -132,9 +132,10 @@ public void onEnable() { @Override public void onDisable() { - // CancelTask + // Cancel the tasks getServer().getGlobalRegionScheduler().cancelTasks(this); getServer().getAsyncScheduler().cancelTasks(this); + // Cancel the timer task. this.timer.cancel(); diff --git a/paper/src/main/resources/paper-plugin.yml b/paper/src/main/resources/paper-plugin.yml new file mode 100644 index 000000000..bea56e374 --- /dev/null +++ b/paper/src/main/resources/paper-plugin.yml @@ -0,0 +1,32 @@ +name: '${name}' +main: '${group}.CrazyCrates' + +version: '${version}' +api-version: '1.20' +description: '${description}' +website: '${website}' + +folia-supported: true + +dependencies: + server: + DecentHolograms: + load: BEFORE + required: false + join-classpath: true + PlaceholderAPI: + load: BEFORE + required: false + join-classpath: true + ItemsAdder: + load: BEFORE + required: false + join-classpath: true + Oraxen: + load: BEFORE + required: false + join-classpath: true + CMI: + load: BEFORE + required: false + join-classpath: true \ No newline at end of file diff --git a/paper/src/main/resources/plugin.yml b/paper/src/main/resources/plugin.yml deleted file mode 100644 index 656758cfa..000000000 --- a/paper/src/main/resources/plugin.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: '${name}' -main: '${group}.${name}' - -authors: ${authors} - -version: '${version}' -api-version: '${apiVersion}' -description: '${description}' -website: '${website}' -folia-supported: true - -softdepend: [CMI, DecentHolograms, PlaceholderAPI, ItemsAdder, Oraxen] \ No newline at end of file