diff --git a/build.gradle b/build.gradle index 2578bfa8..dadaa7f6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,187 +1,79 @@ -buildscript { - repositories { - // These repositories are only for Gradle plugins, put any other repositories in the repository block further below - maven { url = 'https://maven.minecraftforge.net' } - mavenCentral() - jcenter() - maven { url = 'https://maven.parchmentmc.org' } - maven { url = 'https://repo.spongepowered.org/repository/maven-public' } - - } - dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - classpath "org.parchmentmc:librarian:${librarian_version}" - classpath "org.spongepowered:mixingradle:0.7-SNAPSHOT" - - } -} -// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. plugins { - id 'eclipse' + id 'fabric-loom' version "1.5.+" id 'maven-publish' - id 'com.matthewprenger.cursegradle' version '1.4.0' } -apply plugin: 'net.minecraftforge.gradle' -apply plugin: 'org.parchmentmc.librarian.forgegradle' -apply plugin: 'org.spongepowered.mixin' -//mixin { -// add sourceSets.main, "createindustry.refmap.json" -//} - -version = '0.9.0c-1.19.2' +version = '0.9.0c-1.19.2-fabric' group = 'com.drmangotea.createindustry' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'createindustry' // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. -java.toolchain.languageVersion = JavaLanguageVersion.of(17) - -println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" -minecraft { - mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}" - - - // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. - - runs { - client { - workingDirectory project.file('run') - arg '-mixin.config=createindustry.mixins.json' - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - property 'forge.enabledGameTestNamespaces', 'createindustry' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg" - mods { - createindustry { - source sourceSets.main - } - } - } - - server { - workingDirectory project.file('run') - arg '-mixin.config=createindustry.mixins.json' - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - property 'forge.enabledGameTestNamespaces', 'createindustry' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg" - mods { - createindustry { - source sourceSets.main - } - } - } - - gameTestServer { - workingDirectory project.file('run') - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - property 'forge.enabledGameTestNamespaces', 'createindustry' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg" - mods { - createindustry { - source sourceSets.main - } - } - } - - data { - workingDirectory project.file('run') - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - args '--mod', 'createindustry', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') - mods { - createindustry { - source sourceSets.main - } - } - } - } -} - - -// Include resources generated by data generators. -sourceSets.main.resources { srcDir 'src/generated/resources' } +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 repositories { - - maven { - url = 'https://www.cursemaven.com' - content { - includeGroup "curse.maven" - } - } - maven { - // location of the maven that hosts JEI files since January 2023 - // location of the maven for Vazkii's mods - name = "Jared's maven" - url = "https://maven.blamejared.com/" - } - - maven { - url "https://maven.tterrag.com/" - } - + maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI + maven { url = "https://maven.blamejared.com/" } // JEI + maven { url = "https://maven.parchmentmc.org" } // Parchment mappings + maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings + maven { url = "https://api.modrinth.com/maven" } // LazyDFU + maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu + maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate + maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port + maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes + maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM + maven { url = "https://maven.tterrag.com/" } // Flywheel } dependencies { + minecraft("com.mojang:minecraft:${minecraft_version}") + mappings(loom.layered { + it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${quilt_version}:intermediary-v2") + }) + modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}") + // dependencies + modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}") - minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" + // Create - dependencies are added transitively + modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}") - - compileOnly fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}") - implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}") - - implementation fg.deobf("com.simibubi.create:create-${minecraft_version}:${create_version}:all") { transitive = false } - - - implementation fg.deobf("curse.maven:createaddition-439890:5070245") - implementation fg.deobf("curse.maven:zinclib-968773:5110339") - - implementation fg.deobf("curse.maven:mekanism-268560:4644795") - - implementation fg.deobf("curse.maven:selene-499980:4983974") - - implementation fg.deobf("curse.maven:spark-361579:4505309") - - //implementation fg.deobf("curse.maven:create-steam-n-rails-688231:5246888") - - compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-common-api:${jei_version}") - compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge-api:${jei_version}") - runtimeOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge:${jei_version}") - - - - - annotationProcessor "org.spongepowered:mixin:0.8.5:processor" - testAnnotationProcessor "org.spongepowered:mixin:0.8.5:processor" + // Development QOL + modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}") + modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}") } -// Example for how to get properties into the manifest for reading at runtime. -jar { - manifest { - attributes([ - "Specification-Title" : "createindustry", - "Specification-Vendor" : "tfmgsareus", - "Specification-Version" : "1", // We are version 1 of ourselves - "Implementation-Title" : project.name, - "Implementation-Version" : project.jar.archiveVersion, - "Implementation-Vendor" : "tfmgsareus", - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), - "MixinConfigs": "createindustry.mixins.json" - ]) +processResources { + // require dependencies to be the version compiled against or newer + Map properties = Map.of( + "version", version, + "fabric_loader_version", fabric_loader_version, + "fabric_api_version", fabric_api_version, + "create_version", create_version, + "minecraft_version", minecraft_version + ) + + inputs.properties(properties) + + filesMatching("fabric.mod.json") { + expand properties } } +tasks.withType(JavaCompile).configureEach { + it.options.release = Integer.parseInt(sourceCompatibility) +} -jar.finalizedBy('reobfJar') - +java { + withSourcesJar() +} +jar { + from("LICENSE") { + rename { "${it}_${project.archivesBaseName}" } + } +} publishing { publications { mavenJava(MavenPublication) { @@ -195,6 +87,70 @@ publishing { } } -tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation -} + +//minecraft { +// +// +// // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. +// +// runs { +// client { +// workingDirectory project.file('run') +// arg '-mixin.config=createindustry.mixins.json' +// property 'forge.logging.markers', 'REGISTRIES' +// property 'forge.logging.console.level', 'debug' +// property 'forge.enabledGameTestNamespaces', 'createindustry' +// property 'mixin.env.remapRefMap', 'true' +// property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg" +// mods { +// createindustry { +// source sourceSets.main +// } +// } +// } +// +// server { +// workingDirectory project.file('run') +// arg '-mixin.config=createindustry.mixins.json' +// property 'forge.logging.markers', 'REGISTRIES' +// property 'forge.logging.console.level', 'debug' +// property 'forge.enabledGameTestNamespaces', 'createindustry' +// property 'mixin.env.remapRefMap', 'true' +// property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg" +// mods { +// createindustry { +// source sourceSets.main +// } +// } +// } +// +// gameTestServer { +// workingDirectory project.file('run') +// property 'forge.logging.markers', 'REGISTRIES' +// property 'forge.logging.console.level', 'debug' +// property 'forge.enabledGameTestNamespaces', 'createindustry' +// property 'mixin.env.remapRefMap', 'true' +// property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg" +// mods { +// createindustry { +// source sourceSets.main +// } +// } +// } +// +// data { +// workingDirectory project.file('run') +// property 'forge.logging.markers', 'REGISTRIES' +// property 'forge.logging.console.level', 'debug' +// args '--mod', 'createindustry', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') +// mods { +// createindustry { +// source sourceSets.main +// } +// } +// } +// } +//} +// +//// Include resources generated by data generators. +//sourceSets.main.resources { srcDir 'src/generated/resources' } diff --git a/gradle.properties b/gradle.properties index 16310e38..ccc23434 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,15 @@ org.gradle.daemon=false jei_minecraft_version = 1.19.2 jei_version = 11.4.0.274 -forge_version = 43.2.8 +fabric_loader_version = 0.15.7 +fabric_api_version = 0.92.0+1.20.1 minecraft_version = 1.19.2 -flywheel_version = 0.6.10-20 -create_version = 0.5.1.f-45 -librarian_version = 1.+ +create_version = 0.5.1-f-build.1334+mc1.19.2 +quilt_version = 22 parchment_version = 2022.11.27 -registrate_version = MC1.19-1.1.5 \ No newline at end of file +registrate_version = MC1.19-1.1.5 + +modmenu_version = 4.2.0-beta.2 +lazydfu_version = 0.1.3 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832..d64cd491 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 ae04661e..1af9e093 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6..1aa94a42 100644 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index f127cfd4..93e3f59f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/settings.gradle b/settings.gradle index 47f49eae..79c3ab9e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,8 @@ pluginManagement { repositories { gradlePluginPortal() - maven { url = 'https://maven.minecraftforge.net/' } - - + maven { url = "https://maven.fabricmc.net/" } + maven { url = "https://maven.quiltmc.org/repository/release" } } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml deleted file mode 100644 index aac2ef0c..00000000 --- a/src/main/resources/META-INF/mods.toml +++ /dev/null @@ -1,41 +0,0 @@ -modLoader="javafml" - -loaderVersion="[43,)" - -license="MIT" - -[[mods]] - -modId="createindustry" - -version="0.9.0c" - -displayName="Create: The Factory Must Grow" - -logoFile="logo.png" - -authors="DrMangoTea, Pepa, Milky, Luna" - -description=''' -Create is by default a steam/clockpunk mod and most addons aim to expand this part of Create and do that pretty well, we thought the next natural expansion would be moving on from steampunk to dieselpunk. We believe that create could be later used not just as a single steampunk tech mod, but due to its modularity and polishedness it is a perfect base for other tech mods aiming to Create (get it) something new with it, essentially using it as a library. We wanna be the first one to try and prove this concept. -''' - -[[dependencies.createindustry]] - - modId="forge" - - mandatory=true - - versionRange="[43,)" - - ordering="NONE" - - side="BOTH" - -[[dependencies.createindustry]] - modId="minecraft" - mandatory=true - - versionRange="[1.19.2,1.20)" - ordering="NONE" - side="BOTH" diff --git a/src/main/resources/createindustry.mixins.json b/src/main/resources/createindustry.mixins.json index 7b030096..e7bab038 100644 --- a/src/main/resources/createindustry.mixins.json +++ b/src/main/resources/createindustry.mixins.json @@ -1,16 +1,15 @@ { "required": true, - "minVersion": 0.8, + "minVersion": "0.8", "package": "com.drmangotea.createindustry.mixins", - "compatibilityLevel": "JAVA_8", - "refmap": "createindustry.refmap.json", + "compatibilityLevel": "JAVA_17", "mixins": [ "AllOreFeatureConfigEntriesMixin", "FluidPropagatorMixin", "FluidPipeBlockMixin", "PipeAttachmentModelMixin", - "BucketItemMixin", + "BucketItemMixin" // "ArrowMixin" //, // "ScreenEffectRendererMixin" diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 00000000..2ed27521 --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "createindustry", + "version": "0.9.0c", + "name": "Create: The Factory Must Grow", + "description": "Create is by default a steam/clockpunk mod and most addons aim to expand this part of Create and do that pretty well, we thought the next natural expansion would be moving on from steampunk to dieselpunk. We believe that create could be later used not just as a single steampunk tech mod, but due to its modularity and polishedness it is a perfect base for other tech mods aiming to Create (get it) something new with it, essentially using it as a library. We wanna be the first one to try and prove this concept.\n", + "authors": [ + "DrMangoTea, Pepa, Milky, Luna, but mostly DaCodia" + ], + "contact": { + "sources": "https://github.com/Fabricators-of-Create/create-fabric-addon-template" + }, + "license": "CC0", + "icon": "logo.png", + "environment": "*", + "entrypoints": { + "main": [ + "com.drmangotea.createindustry.CreateTFMG" + ] + }, + "mixins": [ + "createindustry.mixins.json" + ], + "depends": { + "fabricloader": ">=${fabric_loader_version}", + "fabric-api": ">=${fabric_api_version}", + "create": "${create_version}", + "minecraft": "${minecraft_version}" + } +} \ No newline at end of file diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta deleted file mode 100644 index b48cc422..00000000 --- a/src/main/resources/pack.mcmeta +++ /dev/null @@ -1,8 +0,0 @@ -{ - "pack": { - "description": "createindustry resources", - "pack_format": 9, - "forge:resource_pack_format": 9, - "forge:data_pack_format": 10 - } -}