Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.4.1-forge' into 1.4.2-forge
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	build.gradle
#	gradle.properties
#	lib/CodeChickenCore-0.6.6.2.jar
#	mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/ModsMixinPlugin.java
#	src/main/java/cpw/mods/fml/relauncher/IClassTransformer.java
#	src/main/java/fr/catcore/fabricatedforge/ForgeModRemapper.java
#	src/main/resources/fabric.mod.json
#	src/main/resources/fabricated-forge.mods.mixins.json
  • Loading branch information
thecatcore committed Aug 17, 2023
2 parents ea4c969 + dde75c4 commit 7b3d29b
Show file tree
Hide file tree
Showing 24 changed files with 349 additions and 207 deletions.
20 changes: 14 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
# gradle

.gradle/
build/
out/
classes/
./mods/

# eclipse

*.launch

# idea

.idea/
*.iml
*.ipr
*.iws

# vscode

.settings/
.vscode/
bin/
.classpath
.project

# macos

*.DS_Store

# fabric

run/

# macos
*.DS_Store
# java

./ModLoader*
jars/
remappedSrc/
hs_err_*.log
replay_*.log
*.hprof
*.jfr
153 changes: 94 additions & 59 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,98 +1,133 @@
import com.diffplug.gradle.spotless.JavaExtension

plugins {
id 'java-library'
id 'com.diffplug.spotless' version "6.12.0"
id 'fabric-loom' version "1.1-SNAPSHOT" // To use chocoloom, change the version to a commit hash
id 'legacy-looming' version "1.1-SNAPSHOT" // Version must be the same as fabric-loom's
id 'fabric-loom' version "1.3-SNAPSHOT" apply false // To use chocoloom, change the version to a commit hash
id 'legacy-looming' version "1.3-SNAPSHOT" apply false // Version must be the same as fabric-loom's
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

archivesBaseName = project.archives_base_name + "-" + project.minecraft_version
version = project.mod_version
def displayVersion = version + "+" + project.minecraft_version
group = project.maven_group
def displayVersion = project.mod_version + "+" + project.minecraft_version

def debug = true
def branch = System.getenv("GITHUB_REF_NAME") == null ? "-forge" : System.getenv("GITHUB_REF_NAME")
if (!branch.endsWith("-forge")) {
debug = false
}

repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
allprojects {
apply plugin: "maven-publish"
apply plugin: "java-library"
apply plugin: "fabric-loom"
apply plugin: "legacy-looming"

version = project.mod_version
group = project.maven_group

repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
flatDir {
dirs (rootProject.rootDir.toString() + "/lib", rootProject.rootDir.toString() + "/mods")
}

maven {
name = "Jitpack"
url 'https://jitpack.io/'
}
}
flatDir {
dirs ("./lib", "./mods")
}

maven {
name = "Jitpack"
url 'https://jitpack.io/'
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings legacy.yarn(project.minecraft_version, project.yarn_mappings)
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modApi("maven.modrinth:mod-remapping-api:${project.mod_remapping_api}")
// modApi(group: "local", name: "mod-remapping-api", version: "1.8.0")

modApi("maven.modrinth:spasm:${project.spasm_version}")
modApi(annotationProcessor("com.github.LlamaLad7.MixinExtras:mixinextras-fabric:${project.mixin_extras_version}"))

implementation(group: "local", name: "argo", version: "2.25")
implementation(group: "local", name: "guava", version: "12.0.1")

modImplementation(legacy.apiModule("legacy-fabric-logger-api-v1", "1.9.0+1.8.9"))

// modRuntimeOnly(files("./forge-${project.minecraft_version}-${project.forge_version}-universal-intermediary.jar"))
}
}

loom {
setIntermediaryUrl('https://repo.legacyfabric.net/repository/legacyfabric/net/legacyfabric/intermediary/%1$s/intermediary-%1$s-v2.jar');
base {
archivesName = project.archives_base_name + "-" + project.minecraft_version
}

accessWidenerPath = file("src/main/resources/fabricated-forge.accesswidener")
}
processResources {
inputs.property "version", project.version

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.legacyfabric:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

modApi("maven.modrinth:mod-remapping-api:${project.mod_remapping_api}")
// modApi(group: "local", name: "mod-remapping-api", version: "1.8.0")
// 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
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) it.options.release = 8

modImplementation(legacyFabricApi.module("legacy-fabric-logger-api-v1", "1.9.0+1.8.9"))
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

implementation(include(group: "local", name: "argo", version: "2.25"))
implementation(include(group: "local", name: "guava", version: "12.0.1"))
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()
}

modCompileOnly(group: "local", name: "CodeChickenCore", version: "0.6.6.2")
modCompileOnly(group: "local", name: "NotEnoughItems", version: "1.4.2.1")
jar {
from("LICENSE") {
rename { "${it}_${base.archivesName.get()}" }
}
}
}

modRuntimeOnly(files("./forge-${project.minecraft_version}-${project.forge_version}-universal-intermediary.jar"))
loom {
accessWidenerPath = file("src/main/resources/fabricated-forge.accesswidener")
}

processResources {
inputs.property "version", project.version
dependencies {
include(group: "local", name: "argo", version: "2.25")
include(group: "local", name: "guava", version: "12.0.1")

filesMatching("fabric.mod.json") {
expand "version": project.version
}
include("org.apache.commons:commons-lang3:3.12.0")
}

// 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
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) it.options.release = 8
subprojects {
dependencies {
api(project.dependencies.project(path: ":", configuration: 'namedElements'))
}
}

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()
remapJar {
afterEvaluate {
subprojects.each {
// Include the jar from the sub project.
nestedJars.from project("${it.path}").tasks.getByName("remapJar")
}
}
}

jar {
from("licensing.md")
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
from("LICENSE-fml.txt")
from("CREDITS-fml.txt")
from("MinecraftForge-Credits.txt")
Expand Down Expand Up @@ -130,14 +165,14 @@ modrinth {
token = System.getenv("MODRINTH_TOKEN") == null ? "dev" : System.getenv("MODRINTH_TOKEN") // This is the default. Remember to have the MODRINTH_TOKEN environment variable set or else this will fail, or set it to whatever you want - just make sure it stays private!
projectId = "JpHZ1Cyv" // This can be the project ID or the slug. Either will work!
versionName = displayVersion
changelog = "Update to Mod-Remapping-API 1.8.0.\nClassTransformers are now applied!!\nMeaning Coremods are more likely to work.\nImplement special fixes to get CodeChickenCore and NEI working."
changelog = "Update to MRAPI 1.14.2.\nFix more compatibility issues with CodeChickenCore and NEI.\nNEI plugins still do not work for now."
uploadFile = remapJar
gameVersions = [project.minecraft_version] // Must be an array, even with only one version
debugMode = debug
dependencies { // A special DSL for creating dependencies
// scope.type
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
// The type can either be `project` or `version`
required.version "eRGeQXjD", project.mod_remapping_api
required.version "mod-remapping-api", project.mod_remapping_api
}
}
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ org.gradle.jvmargs=-Xmx2G
# Fabric Properties
minecraft_version = 1.4.2
yarn_mappings = 451
loader_version = 0.14.17
loader_version = 0.14.22

# Legacy Fabric API
mod_remapping_api = 1.8.0
mod_remapping_api = 1.14.2
forge_version = 6.0.1.355
mixin_extras_version=0.2.0-beta.8
spasm_version=0.1.2

# Mod Properties
mod_version = 2.5.0
mod_version = 2.6.0
maven_group = fr.catcore
archives_base_name = fabricated-forge
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 16 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Expand All @@ -80,13 +80,10 @@ 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"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +130,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=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=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# 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, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%

Expand Down
Binary file removed lib/CodeChickenCore-0.6.6.2.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions mod-compat/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies {
// How to add a mod
// add the intermediary jar of the mod in rootfolder/lib with a dummy fabric.mod.json file in it
// if the file is named like "filename-fileversion.jar" then import it this way:
// modCompileOnly(group: "local", name: "filename", version: "fileversion")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package fr.catcore.fabricatedforge.compat;

import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;

public class Dummy implements PreLaunchEntrypoint {
@Override
public void onPreLaunch() {
}
}
Loading

0 comments on commit 7b3d29b

Please sign in to comment.