diff --git a/build.gradle b/build.gradle index 72ad28aba..0ace2dc77 100644 --- a/build.gradle +++ b/build.gradle @@ -1,86 +1,44 @@ plugins { - id "dev.architectury.loom" version "1.3-SNAPSHOT" + id "idea" id "maven-publish" - id "com.diffplug.spotless" version "7.0.2" + id 'net.minecraftforge.gradle' version '[6.0,6.2)' + id 'org.parchmentmc.librarian.forgegradle' version '1.+' + id 'org.spongepowered.mixin' version '0.7.+' + id 'com.diffplug.spotless' version '7.0.2' } -base { - archivesName = project.archives_base_name -} -configurations.all { - // Check for snapshots more frequently than Gradle's default of 1 day. 0 = every build. - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -} -version = project.mod_version -group = project.maven_group - -java { - sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 -} - -loom { - // use this if you are using the official mojang mappings - // and want loom to stop warning you about their license - silentMojangMappingsLicense() +def generatedResources = file("src/generated") - // since loom 0.10, you are **required** to use the - // "forge" block to configure forge-specific features, - // such as the mixinConfigs array or datagen - forge { - // specify the mixin configs used in this mod - // this will be added to the jar manifest as well! - mixinConfigs = [ - "cosmiccore.mixins.json" - ] - - // missing access transformers? - // don't worry, you can still use them! - // note that your AT *MUST* be located at - // src/main/resources/META-INF/accesstransformer.cfg - // to work as there is currently no config option to change this. - // also, any names used in your access transformer will need to be - // in SRG mapped ("func_" / "field_" with MCP class names) to work! - // (both of these things may be subject to change in the future) - - dataGen{ - mod(mod_id) - } - } - - runConfigs.named("data").configure { - programArg("--existing=" + file("src/main/resources").absolutePath) - programArg("--existing-mod gtceu") - programArgs("--client", "--server") +sourceSets { + main { + resources.srcDir generatedResources } } repositories { + mavenLocal() mavenCentral() - flatDir { - dirs 'lib' - } maven { - url "https://cursemaven.com/" + name = 'GTCEu Maven' + url = 'https://maven.gtceu.com' content { - includeGroup "curse.maven" + includeGroup 'com.gregtechceu.gtceu' } - } // Curse Forge File - // Ad Astra - maven { - url "https://maven.teamresourceful.com/repository/maven-public/" } - maven { - name "Modmaven" - url "https://modmaven.dev/" + maven { // Curse Forge File + url = "https://cursemaven.com/" content { - includeGroup 'appeng' + includeGroup "curse.maven" } } + maven { // Ad Astra + url = "https://maven.teamresourceful.com/repository/maven-public/" + } maven { - name = 'GTCEu Maven' - url = 'https://maven.gtceu.com' + name = "Modmaven" + url = "https://modmaven.dev/" content { - includeGroup 'com.gregtechceu.gtceu' + includeGroup 'appeng' } } maven { @@ -88,18 +46,10 @@ repositories { url = "https://maven.terraformersmc.com/releases/" } maven { - name 'FirstDarkDev' - url "https://maven.firstdarkdev.xyz/snapshots/" + name = 'FirstDarkDev' + url = 'https://maven.firstdarkdev.xyz/snapshots/' } - maven { - name 'Quilt' - url 'https://maven.quiltmc.org/repository/release/' - } - maven { - name = 'ParchmentMC' - url = 'https://maven.parchmentmc.org' - } - maven { + maven { // saps.dev Maven (KubeJS and Rhino) url "https://maven.saps.dev/releases/" content { includeGroup "dev.latvian.mods" @@ -114,12 +64,11 @@ repositories { includeGroup("com.simibubi.create") } } - maven { - // Patchouli, JEI + maven { // Patchouli, JEI name = "BlameJared" url = "https://maven.blamejared.com/" } - maven { + maven { // Curios url = "https://maven.theillusivec4.top/" } maven { @@ -127,145 +76,151 @@ repositories { } maven { name = 'GeckoLib' - url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' + url = 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' + } + maven { + name = "tterrag maven" + url = "https://maven.tterrag.com/" } maven { - name "tterrag maven" - url "https://maven.tterrag.com/" + url = "https://api.modrinth.com/maven" } - maven { url = "https://api.modrinth.com/maven" } + maven { + url = "https://maven.architectury.dev" + } + maven { + url = "https://thedarkcolour.github.io/KotlinForForge/" + } +} +version = mod_version +group = maven_group + +base { archivesName = archives_base_name } +java { sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 } +sourceSets.main.resources { srcDir 'src/generated/resources' } + +minecraft { + mappings channel: mapping_channel, version: mapping_version + copyIdeResources = true + runs { + configureEach { + workingDirectory project.file('run') + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + mods { "${mod_id}" { source sourceSets.main } } + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg" + } + client { property 'forge.enabledGameTestNamespaces', mod_id } + server { property 'forge.enabledGameTestNamespaces', mod_id; args '--nogui' } + data { + workingDirectory project.file('run-data') + args '--mod', mod_id, '--all', '--output', file('src/generated/resource'), '--existing', file('src/main/resources/'), '--existing-mod', 'gtceu', '--client', '--server' + } + } +} + +mixin { + // MixinGradle Settings + add sourceSets.main, 'com.ghostipedia.cosmiccore.mixin' + config 'cosmiccore.mixins.json' } apply from: "$rootDir/gradle/scripts/spotless.gradle" dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - forge "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}" - // layered mappings - Mojmap names, parchment and QM docs and parameters - mappings loom.layered { - it.mappings("org.quiltmc:quilt-mappings:${project.minecraft_version}+build.${project.quilt_mappings}:intermediary-v2") - it.parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.parchment_mappings}@zip") - it.officialMojangMappings { nameSyntheticMembers = false } - } + minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" + + annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' // Apply Mixin AP + + // JEI, EMI, Jade + compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}") + compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}") + runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}") + runtimeOnly fg.deobf("dev.emi:emi-forge:${emi_version}+${minecraft_version}") + runtimeOnly fg.deobf("maven.modrinth:jade:${jade_version}+forge") + + + // GregTech and dependencies + implementation fg.deobf("com.gregtechceu.gtceu:gtceu-${minecraft_version}:${gtceu_version}:slim") { transitive = false } + implementation fg.deobf("com.lowdragmc.ldlib:ldlib-forge-${minecraft_version}:${ldlib_version}") { transitive = false } + implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}") + implementation fg.deobf("dev.latvian.mods:kubejs-forge:${kubejs_version}") + implementation fg.deobf("dev.latvian.mods:rhino-forge:${rhino_version}") + runtimeOnly fg.deobf("dev.toma.configuration:configuration-forge-${minecraft_version}:${configuration_version}") + runtimeOnly fg.deobf("dev.architectury:architectury-forge:${architectury_version}") - modCompileOnly("mezz.jei:jei-${project.minecraft_version}-common-api:${project.jei_version}") { transitive = false } - modCompileOnly("mezz.jei:jei-${project.minecraft_version}-forge-api:${project.jei_version}") { transitive = false } - modCompileOnly("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}") { transitive = false } + implementation fg.deobf("appeng:appliedenergistics2-forge:15.2.13") + implementation fg.deobf("curse.maven:modern-ae2-additions-1028068:5826205") { transitive = false } + implementation fg.deobf("curse.maven:legendary-survival-overhaul-840254:5921074") { transitive = false } - modImplementation("com.gregtechceu.gtceu:gtceu-${project.minecraft_version}:${project.gtceu_version}:slim") { transitive = false } - modImplementation("com.lowdragmc.ldlib:ldlib-forge-${project.minecraft_version}:${project.ldlib_version}") { transitive = false } - modImplementation("com.tterrag.registrate:Registrate:${project.registrate_version}") - modImplementation("dev.latvian.mods:kubejs-forge:${project.kubejs_version}") - modImplementation("appeng:appliedenergistics2-forge:15.2.13") - modImplementation("curse.maven:modern-ae2-additions-1028068:5826205") { transitive = false } - modImplementation("curse.maven:legendary-survival-overhaul-840254:5921074") { transitive = false } // Ad Astra - forgeRuntimeLibrary("com.teamresourceful:yabn:1.0.3") // Cause architectury is kinda dumb with some java libs - forgeRuntimeLibrary("com.teamresourceful:bytecodecs:1.0.2") // Cause architectury is kinda dumb with some java libs - modImplementation("com.teamresourceful.resourcefullib:resourcefullib-forge-${project.minecraft_version}:${project.resourcefullib_version}") - modImplementation("com.teamresourceful.resourcefulconfig:resourcefulconfig-forge-${project.minecraft_version}:${project.resourcefulconfig_version}") - modImplementation("earth.terrarium.botarium:botarium-forge-${project.minecraft_version}:${project.botarium_version}") - modImplementation("earth.terrarium.adastra:ad_astra-forge-${project.minecraft_version}:${ad_astra_version}") {transitive false} // issue with create mod so not transitive - modImplementation ("dev.emi:emi-forge:${emi_version}") - // Blood Magic //TODO: Find real repo url - //modImplementation("com.wayoftime.bloodmagic:BloodMagic:${project.minecraft_version}-${project.blood_magic_version}") - // modCompileOnly("curse.maven:blood-magic-224791:4779713") // API - // modRuntimeOnly("curse.maven:blood-magic-224791:4779711") // Runtime to test in game - modImplementation("curse.maven:blood-magic-224791:4779711") + runtimeOnly fg.deobf("com.teamresourceful:yabn:1.0.3") // Cause architectury is kinda dumb with some java libs + runtimeOnly fg.deobf("com.teamresourceful:bytecodecs:1.0.2") // Cause architectury is kinda dumb with some java libs + implementation fg.deobf("com.teamresourceful.resourcefullib:resourcefullib-forge-${project.minecraft_version}:${project.resourcefullib_version}") + implementation fg.deobf("com.teamresourceful.resourcefulconfig:resourcefulconfig-forge-${project.minecraft_version}:${project.resourcefulconfig_version}") + implementation fg.deobf("earth.terrarium.botarium:botarium-forge-${project.minecraft_version}:${project.botarium_version}") + implementation fg.deobf("earth.terrarium.adastra:ad_astra-forge-${project.minecraft_version}:${ad_astra_version}") {transitive false} // issue with create mod so not transitive - //modImplementation("curse.maven:cold-sweat-506194:4805548") - modImplementation('software.bernie.geckolib:geckolib-forge-1.20.1:4.2.2') - modCompileOnly("com.jozufozu.flywheel:flywheel-forge-1.20.1:0.6.10-7") - modCompileOnly("curse.maven:create-328085:4762216") - modCompileOnly("curse.maven:new-thin-air-878379:4848005") - modImplementation("curse.maven:puzzles-lib-495476:4924184") + implementation fg.deobf("maven.modrinth:blood-magic:${minecraft_version}-${blood_magic_version}") - modImplementation("dev.shadowsoffire:Apotheosis:${project.minecraft_version}-7.4.2") - modImplementation("dev.shadowsoffire:Placebo:${project.minecraft_version}-8.6.2") - modImplementation("dev.shadowsoffire:ApothicAttributes:${project.minecraft_version}-1.3.5") + implementation fg.deobf('software.bernie.geckolib:geckolib-forge-1.20.1:4.2.2') + compileOnly fg.deobf("com.jozufozu.flywheel:flywheel-forge-1.20.1:0.6.10-7") + compileOnly fg.deobf("curse.maven:create-328085:4762216") + compileOnly fg.deobf("curse.maven:new-thin-air-878379:4848005") + implementation fg.deobf("curse.maven:puzzles-lib-495476:4924184") + implementation fg.deobf("dev.shadowsoffire:Apotheosis:${project.minecraft_version}-7.4.2") + implementation fg.deobf("dev.shadowsoffire:Placebo:${project.minecraft_version}-8.6.2") + implementation fg.deobf("dev.shadowsoffire:ApothicAttributes:${project.minecraft_version}-1.3.5") - modRuntimeOnly("curse.maven:jade-324717:4973483") - modRuntimeOnly("vazkii.patchouli:Patchouli:${project.minecraft_version}-${project.patchouli_version}-FORGE") - modImplementation("top.theillusivec4.curios:curios-forge:${project.curios_version}+${project.minecraft_version}") - modRuntimeOnly("dev.toma.configuration:configuration-forge-${project.minecraft_version}:${project.configuration_version}") - modRuntimeOnly("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}") { transitive = false } + runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${project.minecraft_version}-${project.patchouli_version}-FORGE") + implementation fg.deobf("top.theillusivec4.curios:curios-forge:${project.curios_version}+${project.minecraft_version}") - modImplementation("maven.modrinth:embeddium:0.3.31+mc1.20.1") - modImplementation("maven.modrinth:oculus:1.20.1-1.7.0") - // oculus needs this apparently??? idk - forgeRuntimeLibrary(runtimeOnly("org.anarres:jcpp:1.4.14")) + implementation fg.deobf("maven.modrinth:embeddium:0.3.31+mc1.20.1") + implementation fg.deobf("maven.modrinth:oculus:1.20.1-1.7.0") + runtimeOnly fg.deobf("org.anarres:jcpp:1.4.14") // oculus needs this apparently??? idk + + // FTB + implementation fg.deobf("curse.maven:ftb-teams-forge-404468:${project.ftb_team}") + implementation fg.deobf("curse.maven:ftb-teams-forge-404465:${project.ftb_lib}") // Mixin Extras implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${project.mixinextras_version}")) - implementation(include("io.github.llamalad7:mixinextras-forge:${project.mixinextras_version}")) + implementation(jarJar("io.github.llamalad7:mixinextras-forge:${project.mixinextras_version}")) { jarJar.ranged(it, "[${project.mixinextras_version},)") } annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' - // FTB - modImplementation("curse.maven:ftb-teams-forge-404468:${project.ftb_team}") - modImplementation("curse.maven:ftb-teams-forge-404465:${project.ftb_lib}") - // lombok - compileOnly 'org.projectlombok:lombok:1.18.34' - annotationProcessor 'org.projectlombok:lombok:1.18.34' + compileOnly 'org.projectlombok:lombok:1.18.24' + annotationProcessor 'org.projectlombok:lombok:1.18.24' } -processResources { - // define properties that can be used during resource processing - inputs.property "version", project.version +tasks.named('processResources', ProcessResources).configure { + var properties = [ + "mod_license": mod_license, + "mod_id": mod_id, + "version": version, + "mod_name": mod_name, + "mod_url": mod_url, + "mod_author": mod_author, + "forge_version": forge_version.split("\\.")[0], // only specify major version of forge + "minecraft_version": minecraft_version, + "gtceu_version": gtceu_version, + ] + inputs.properties(properties) - // this will replace the property "${version}" in your mods.toml - // with the version you've defined in your gradle.properties filesMatching("META-INF/mods.toml") { - expand "version": project.version + expand properties + [project: project] } } -tasks.withType(JavaCompile) { +tasks.named('jar', Jar).configure { finalizedBy 'reobfJar' } +tasks.withType(JavaCompile).configureEach { // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // If Javadoc is generated, this must be specified in that task too. options.encoding = "UTF-8" - options.release = 17 -} - -java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. - withSourcesJar() -} - -jar { - // add some additional metadata to the jar manifest - manifest { - attributes([ - "Specification-Title" : project.mod_id, - "Specification-Vendor" : project.mod_author, - "Specification-Version" : "1", - "Implementation-Title" : project.name, - "Implementation-Version" : version, - "Implementation-Vendor" : project.mod_author, - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") - ]) - } -} - -// configure the maven publication -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - // Notice: This block does NOT have the same function as the block in the top level. - // The repositories here will be used for publishing your artifact, not for - // retrieving dependencies. - } -} + options.release.set(17) +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 7777bd122..a7183c154 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,39 +1,39 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx4G -# tell architectury loom that this project is a forge project. -# this will enable us to use the "forge" dependency. -# using archloom without this is possible and will give you a -# "standard" loom installation with some extra features. -loom.platform=forge - # Base properties # minecraft version minecraft_version=1.20.1 # forge version, latest version can be found on https://files.minecraftforge.net/ -forge_version=47.2.17 -# yarn, latest version can be found on https://fabricmc.net/develop/ -parchment_mappings=2023.09.03 -quilt_mappings=23 +forge_version=47.3.0 +mapping_channel=parchment +mapping_version=2023.09.03-1.20.1 # Mod Properties mod_version=0.6.0 maven_group=com.ghostipedia.frontiers archives_base_name=cosmic-core mod_id=cosmiccore +mod_name=Cosmic Core +mod_url= mod_author=Ghostipedia +mod_license=All rights reserved # Dependencies +architectury_version=9.2.14 gtceu_version=1.6.4 ldlib_version=1.0.34 -registrate_version=MC1.20-1.3.3 -kubejs_version=2001.6.4-build.120 -patchouli_version=81 -curios_version=5.9.0 +registrate_version=MC1.20-1.3.11 +rhino_version=2001.2.3-build.6 +kubejs_version=2001.6.5-build.14 configuration_version=2.2.0 jei_version=15.20.0.105 -emi_version=1.1.13+1.20.1 +emi_version=1.1.13 +jade_version=11.12.3 +patchouli_version=81 +curios_version=5.9.0 mixinextras_version=0.2.0 +blood_magic_version=3.3.3-45 # Ad Astra ad_astra_version=1.15.18 diff --git a/settings.gradle b/settings.gradle index 532f14ebc..9ca57b8c0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,9 +2,8 @@ pluginManagement { // when using additional gradle plugins like shadow, // add their repositories to this list! repositories { - maven { url "https://maven.fabricmc.net/" } - maven { url "https://maven.architectury.dev/" } - maven { url "https://files.minecraftforge.net/maven/" } - gradlePluginPortal() + gradlePluginPortal() // Needed for spotless + maven { url = 'https://maven.minecraftforge.net/' } + maven { url = 'https://maven.parchmentmc.org' } } } \ No newline at end of file diff --git a/src/main/java/com/ghostipedia/cosmiccore/mixin/GTRecipeModifiersMixin.java b/src/main/java/com/ghostipedia/cosmiccore/mixin/GTRecipeModifiersMixin.java index f27ac00df..c800a71bd 100644 --- a/src/main/java/com/ghostipedia/cosmiccore/mixin/GTRecipeModifiersMixin.java +++ b/src/main/java/com/ghostipedia/cosmiccore/mixin/GTRecipeModifiersMixin.java @@ -8,8 +8,8 @@ import com.gregtechceu.gtceu.api.recipe.GTRecipe; import com.gregtechceu.gtceu.common.data.GTRecipeModifiers; -import dev.architectury.patchedmixin.staticmixin.spongepowered.asm.mixin.injection.At; -import dev.architectury.patchedmixin.staticmixin.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.jetbrains.annotations.NotNull; import org.spongepowered.asm.mixin.Debug; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/main/java/com/ghostipedia/cosmiccore/mixin/accessor/LootTableAccessor.java b/src/main/java/com/ghostipedia/cosmiccore/mixin/accessor/LootTableAccessor.java index 6cd893d32..39982373e 100644 --- a/src/main/java/com/ghostipedia/cosmiccore/mixin/accessor/LootTableAccessor.java +++ b/src/main/java/com/ghostipedia/cosmiccore/mixin/accessor/LootTableAccessor.java @@ -11,6 +11,6 @@ @Mixin(LootTable.class) public interface LootTableAccessor { - @Accessor(value = "f_79109_", remap = false) + @Accessor(value = "pools", remap = false) List getPools(); } diff --git a/src/main/java/com/ghostipedia/cosmiccore/mixin/client/SoundManagerMixin.java b/src/main/java/com/ghostipedia/cosmiccore/mixin/client/SoundManagerMixin.java index d9d6c6f93..3651930be 100644 --- a/src/main/java/com/ghostipedia/cosmiccore/mixin/client/SoundManagerMixin.java +++ b/src/main/java/com/ghostipedia/cosmiccore/mixin/client/SoundManagerMixin.java @@ -27,10 +27,7 @@ public abstract class SoundManagerMixin { @Final private SoundEngine soundEngine; - @Inject( - method = "play", - at = @At("HEAD"), - cancellable = true) + @Inject(method = "play", at = @At("HEAD"), cancellable = true) private void onPlay(SoundInstance sound, CallbackInfo callbackInfo) { if (cosmicCore$checkForSpaceRadio()) { callbackInfo.cancel(); // Early exits Ad Astra's mixin from being called. Hopefully @@ -49,10 +46,7 @@ private void onPlay(SoundInstance sound, CallbackInfo callbackInfo) { } } - @Inject( - method = "playDelayed", - at = @At("HEAD"), - cancellable = true) + @Inject(method = "playDelayed", at = @At("HEAD"), cancellable = true) private void onPlayDelayed(SoundInstance sound, int delay, CallbackInfo callbackInfo) { if (cosmicCore$checkForSpaceRadio()) { callbackInfo.cancel(); diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 191e1d1c4..56a11cd0e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -2,7 +2,7 @@ # Any fields that aren't annotated with #optional are *required*! modLoader = "javafml" loaderVersion = "[47,)" -license = "All rights reserved" # Want to make your mod open source? Check out https://choosealicense.com/! +license = "${mod_license}" # Want to make your mod open source? Check out https://choosealicense.com/! # This is a URL to e.g. your GitHub or CurseForge issues page. # It will appear in any crash reports this mod is directly involved in. @@ -10,11 +10,11 @@ license = "All rights reserved" # Want to make your mod open source? Check out h # A list of mods - how many allowed here is determined by the individual mod loader [[mods]] -modId = "cosmiccore" +modId = "${mod_id}" # The version number of the mod - unlike in the Forge MDK, # we'll use the processResources task to replace this for us version = "${version}" -displayName = "Cosmic Core" +displayName = "${mod_name}" # This URL will be queried by the Forge update checker in order to find the latest version of your mod. # If an update is found, you'll see a little blinking "emerald" symbol on your Mods button! # updateJSONURL="https://changeme.dev/updates.json" #optional @@ -25,7 +25,7 @@ displayName = "Cosmic Core" # Some more fluff displayed in the Mods panel. Feel free to issue your special thanks here! # credits="Thanks to Mojang for making this great game" #optional # Some more fluff displayed in the Mods panel. Plug your stuff here! -# authors="Me!" #optional +authors = "${mod_author}" # A multi-line description for your mod. This has no minimum length, but it *is* required! description = ''' This is a very cool mod that does... things. @@ -38,34 +38,32 @@ Have I reached 280 characters yet? # An (optional) dependency for your mod. Though technically not required, # it's always helpful to add these to stop your mod from loading when something is missing # rather than erroring out later -[[dependencies.cosmiccore]] -modId = "forge" -mandatory = true # do you **need** this mod to be able to launch? -# A version range using interval notation. -# Brackets mean "inclusive" bounds, while parentheses mean "exclusive". -versionRange = "[47,)" # This essentially means any forge >= 47 -ordering = "NONE" # Use this if you want your mod to be loaded specifically BEFORE or AFTER another mod -side = "BOTH" # Specify where this mod is required: can be BOTH, CLIENT or SERVER +[[dependencies.${mod_id}]] + modId = "forge" + mandatory = true # do you **need** this mod to be able to launch? + versionRange = "[${forge_version},)" # This essentially means any forge >= 47 + ordering = "NONE" # Use this if you want your mod to be loaded specifically BEFORE or AFTER another mod + side = "BOTH" # Specify where this mod is required: can be BOTH, CLIENT or SERVER # And another dependency, use this if you want to require a certain Minecraft version. -[[dependencies.cosmiccore]] +[[dependencies.${mod_id}]] modId = "minecraft" mandatory = true # See above for how to read this notation, this essentially means any # version of Minecraft from 1.20.1 (inclusive). -versionRange = "[1.20.1]" +versionRange = "[${minecraft_version}]" ordering = "NONE" side = "BOTH" -[[dependencies.cosmiccore]] +[[dependencies.${mod_id}]] modId="gtceu" mandatory=true -versionRange="[1.5.0,)" +versionRange="[${gtceu_version},)" ordering="AFTER" side="BOTH" -[[dependencies.cosmiccore]] +[[dependencies.${mod_id}]] modId="legendarysurvivaloverhaul" mandatory=true versionRange="[1.20.1-1.20.1-2.0.15,)" diff --git a/src/old.build.gradle b/src/old.build.gradle new file mode 100644 index 000000000..3f9978649 --- /dev/null +++ b/src/old.build.gradle @@ -0,0 +1,271 @@ +plugins { + id "dev.architectury.loom" version "1.3-SNAPSHOT" + id "maven-publish" + id "com.diffplug.spotless" version "7.0.2" +} + +base { + archivesName = project.archives_base_name +} +configurations.all { + // Check for snapshots more frequently than Gradle's default of 1 day. 0 = every build. + resolutionStrategy.cacheChangingModulesFor 0, 'seconds' +} +version = project.mod_version +group = project.maven_group + +java { + sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 +} + +loom { + // use this if you are using the official mojang mappings + // and want loom to stop warning you about their license + silentMojangMappingsLicense() + + // since loom 0.10, you are **required** to use the + // "forge" block to configure forge-specific features, + // such as the mixinConfigs array or datagen + forge { + // specify the mixin configs used in this mod + // this will be added to the jar manifest as well! + mixinConfigs = [ + "cosmiccore.mixins.json" + ] + + // missing access transformers? + // don't worry, you can still use them! + // note that your AT *MUST* be located at + // src/main/resources/META-INF/accesstransformer.cfg + // to work as there is currently no config option to change this. + // also, any names used in your access transformer will need to be + // in SRG mapped ("func_" / "field_" with MCP class names) to work! + // (both of these things may be subject to change in the future) + + dataGen{ + mod(mod_id) + } + } + + runConfigs.named("data").configure { + programArg("--existing=" + file("src/main/resources").absolutePath) + programArg("--existing-mod gtceu") + programArgs("--client", "--server") + } +} + +repositories { + mavenCentral() + flatDir { + dirs 'lib' + } +// maven { +// url "https://cursemaven.com/" +// content { +// includeGroup "curse.maven" +// } +// } // Curse Forge File + // Ad Astra +// maven { +// url "https://maven.teamresourceful.com/repository/maven-public/" +// } +// maven { +// name "Modmaven" +// url "https://modmaven.dev/" +// content { +// includeGroup 'appeng' +// } +// } +// maven { +// name = 'GTCEu Maven' +// url = 'https://maven.gtceu.com' +// content { +// includeGroup 'com.gregtechceu.gtceu' +// } +// } +// maven { +// name = "TerraformersMC" +// url = "https://maven.terraformersmc.com/releases/" +// } +// maven { +// name 'FirstDarkDev' +// url "https://maven.firstdarkdev.xyz/snapshots/" +// } + maven { + name 'Quilt' + url 'https://maven.quiltmc.org/repository/release/' + } + maven { + name = 'ParchmentMC' + url = 'https://maven.parchmentmc.org' + } +// maven { +// url "https://maven.saps.dev/releases/" +// content { +// includeGroup "dev.latvian.mods" +// } +// } +// maven { // Registrate +// url = "https://maven.tterrag.com/" +// content { +// // need to be specific here due to version overlaps +// includeGroup("com.jozufozu.flywheel") +// includeGroup("com.tterrag.registrate") +// includeGroup("com.simibubi.create") +// } +// } +// maven { +// // Patchouli, JEI +// name = "BlameJared" +// url = "https://maven.blamejared.com/" +// } +// maven { +// url = "https://maven.theillusivec4.top/" +// } +// maven { +// url = "https://maven.shadowsoffire.dev/releases" +// } +// maven { +// name = 'GeckoLib' +// url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' +// } +// maven { +// name "tterrag maven" +// url "https://maven.tterrag.com/" +// } +// maven { url = "https://api.modrinth.com/maven" } + +} + +apply from: "$rootDir/gradle/scripts/spotless.gradle" + +dependencies { +// minecraft "com.mojang:minecraft:${project.minecraft_version}" +// forge "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}" +// // layered mappings - Mojmap names, parchment and QM docs and parameters +// mappings loom.layered { +// it.mappings("org.quiltmc:quilt-mappings:${project.minecraft_version}+build.${project.quilt_mappings}:intermediary-v2") +// it.parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.parchment_mappings}@zip") +// it.officialMojangMappings { nameSyntheticMembers = false } +// } + +// modCompileOnly("mezz.jei:jei-${project.minecraft_version}-common-api:${project.jei_version}") { transitive = false } +// modCompileOnly("mezz.jei:jei-${project.minecraft_version}-forge-api:${project.jei_version}") { transitive = false } +// modCompileOnly("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}") { transitive = false } + + modImplementation("com.gregtechceu.gtceu:gtceu-${project.minecraft_version}:${project.gtceu_version}:slim") { transitive = false } + modImplementation("com.lowdragmc.ldlib:ldlib-forge-${project.minecraft_version}:${project.ldlib_version}") { transitive = false } + modImplementation("com.tterrag.registrate:Registrate:${project.registrate_version}") + modImplementation("dev.latvian.mods:kubejs-forge:${project.kubejs_version}") + modImplementation("appeng:appliedenergistics2-forge:15.2.13") + modImplementation("curse.maven:modern-ae2-additions-1028068:5826205") { transitive = false } + modImplementation("curse.maven:legendary-survival-overhaul-840254:5921074") { transitive = false } + // Ad Astra +// forgeRuntimeLibrary("com.teamresourceful:yabn:1.0.3") // Cause architectury is kinda dumb with some java libs +// forgeRuntimeLibrary("com.teamresourceful:bytecodecs:1.0.2") // Cause architectury is kinda dumb with some java libs +// modImplementation("com.teamresourceful.resourcefullib:resourcefullib-forge-${project.minecraft_version}:${project.resourcefullib_version}") +// modImplementation("com.teamresourceful.resourcefulconfig:resourcefulconfig-forge-${project.minecraft_version}:${project.resourcefulconfig_version}") +// modImplementation("earth.terrarium.botarium:botarium-forge-${project.minecraft_version}:${project.botarium_version}") +// modImplementation("earth.terrarium.adastra:ad_astra-forge-${project.minecraft_version}:${ad_astra_version}") {transitive false} // issue with create mod so not transitive +// modImplementation ("dev.emi:emi-forge:${emi_version}") + // Blood Magic //TODO: Find real repo url + //modImplementation("com.wayoftime.bloodmagic:BloodMagic:${project.minecraft_version}-${project.blood_magic_version}") + // modCompileOnly("curse.maven:blood-magic-224791:4779713") // API + // modRuntimeOnly("curse.maven:blood-magic-224791:4779711") // Runtime to test in game +// modImplementation("curse.maven:blood-magic-224791:4779711") + + //modImplementation("curse.maven:cold-sweat-506194:4805548") +// modImplementation('software.bernie.geckolib:geckolib-forge-1.20.1:4.2.2') +// modCompileOnly("com.jozufozu.flywheel:flywheel-forge-1.20.1:0.6.10-7") +// modCompileOnly("curse.maven:create-328085:4762216") +// modCompileOnly("curse.maven:new-thin-air-878379:4848005") +// modImplementation("curse.maven:puzzles-lib-495476:4924184") + +// modImplementation("dev.shadowsoffire:Apotheosis:${project.minecraft_version}-7.4.2") +// modImplementation("dev.shadowsoffire:Placebo:${project.minecraft_version}-8.6.2") +// modImplementation("dev.shadowsoffire:ApothicAttributes:${project.minecraft_version}-1.3.5") + + +// modRuntimeOnly("curse.maven:jade-324717:4973483") +// modRuntimeOnly("vazkii.patchouli:Patchouli:${project.minecraft_version}-${project.patchouli_version}-FORGE") +// modImplementation("top.theillusivec4.curios:curios-forge:${project.curios_version}+${project.minecraft_version}") +// modRuntimeOnly("dev.toma.configuration:configuration-forge-${project.minecraft_version}:${project.configuration_version}") +// modRuntimeOnly("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}") { transitive = false } + +// modImplementation("maven.modrinth:embeddium:0.3.31+mc1.20.1") +// modImplementation("maven.modrinth:oculus:1.20.1-1.7.0") +// // oculus needs this apparently??? idk +// forgeRuntimeLibrary(runtimeOnly("org.anarres:jcpp:1.4.14")) + + // Mixin Extras +// implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${project.mixinextras_version}")) +// implementation(include("io.github.llamalad7:mixinextras-forge:${project.mixinextras_version}")) +// annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' + + // FTB +// modImplementation("curse.maven:ftb-teams-forge-404468:${project.ftb_team}") +// modImplementation("curse.maven:ftb-teams-forge-404465:${project.ftb_lib}") + + // lombok +// compileOnly 'org.projectlombok:lombok:1.18.34' +// annotationProcessor 'org.projectlombok:lombok:1.18.34' +} + +processResources { + // define properties that can be used during resource processing + inputs.property "version", project.version + + // this will replace the property "${version}" in your mods.toml + // with the version you've defined in your gradle.properties + filesMatching("META-INF/mods.toml") { + expand "version": project.version + } +} + +tasks.withType(JavaCompile) { + // ensure that the encoding is set to UTF-8, no matter what the system default is + // this fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + // If Javadoc is generated, this must be specified in that task too. + options.encoding = "UTF-8" + options.release = 17 +} + +java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() +} + +jar { + // add some additional metadata to the jar manifest + manifest { + attributes([ + "Specification-Title" : project.mod_id, + "Specification-Vendor" : project.mod_author, + "Specification-Version" : "1", + "Implementation-Title" : project.name, + "Implementation-Version" : version, + "Implementation-Vendor" : project.mod_author, + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } +} + +// configure the maven publication +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. + } +}