diff --git a/.gitignore b/.gitignore
index 429a832e08..b866fbae95 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,14 @@ changelog.txt
/patches_old_bak/
*.py
*.7z
+.project
+/mdk/.gradle/
+/mdk/.settings/
+/mdk/bin/
+/mdk/build/
+/mdk/crash-reports/
+/mdk/logs/
+/mdk/resourcepacks/
+/mdk/run/
+*.launch
+*.classpath
diff --git a/Jenkinsfile b/Jenkinsfile
index 18a3bf346c..75d0c553e8 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -73,7 +73,7 @@ pipeline {
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
}
steps {
- sh './gradlew ${GRADLE_ARGS} uploadArchives -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
+ sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/${MYGROUP}.${MYARTIFACT}/${MYVERSION}'
}
}
diff --git a/build.gradle b/build.gradle
index c9c79ef4ac..299decaf11 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,71 +1,57 @@
buildscript {
repositories {
mavenLocal()
+ maven { url = 'https://files.minecraftforge.net/maven' }
+ jcenter()
mavenCentral()
- maven {
- name = "forge"
- url = "https://files.minecraftforge.net/maven"
- }
- maven {
- name = "sonatype"
- url = "https://oss.sonatype.org/content/repositories/snapshots/"
- }
- maven {
- url "https://plugins.gradle.org/m2/"
- }
}
dependencies {
- classpath 'edu.sc.seis.launch4j:launch4j:2.4.6'
- classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
+ classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
+ classpath 'org.ow2.asm:asm:7.1'
+ classpath 'org.ow2.asm:asm-tree:7.1'
+ classpath 'com.github.jponge:lzma-java:1.3' //Needed to compress deobf data
}
}
+import groovy.json.JsonSlurper
+import groovy.json.JsonBuilder
+
+import java.nio.file.Files
+import java.text.SimpleDateFormat
+import java.util.Date
+import java.util.LinkedHashMap
+import java.util.TreeSet
+import java.util.stream.Collectors
+import java.util.zip.ZipEntry
+import java.util.zip.ZipInputStream
+import java.util.zip.ZipOutputStream
+import java.security.MessageDigest
+import java.net.URL
+import net.minecraftforge.gradle.common.task.ArchiveChecksum
+import net.minecraftforge.gradle.common.task.DownloadMavenArtifact
+import net.minecraftforge.gradle.common.task.ExtractInheritance
+import net.minecraftforge.gradle.common.task.SignJar
+import net.minecraftforge.gradle.common.util.HashStore
+import net.minecraftforge.gradle.mcp.function.MCPFunction
+import net.minecraftforge.gradle.mcp.util.MCPEnvironment
+import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
+import net.minecraftforge.gradle.patcher.task.GenerateBinPatches
+import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
+import net.minecraftforge.gradle.userdev.tasks.RenameJar
+import org.apache.tools.ant.filters.ReplaceTokens
+import de.undercouch.gradle.tasks.download.Download
+import org.gradle.plugins.ide.eclipse.model.SourceFolder
+import org.objectweb.asm.ClassReader
plugins {
id 'net.minecrell.licenser' version '0.4'
+ id 'org.ajoberstar.grgit' version '3.1.1'
+ id 'de.undercouch.download' version '3.3.0'
+ id 'com.github.ben-manes.versions' version '0.22.0'
}
-
-apply plugin: "maven"
-def patcher_plugin = plugins.apply('net.minecraftforge.gradle.patcher')
-apply plugin: 'edu.sc.seis.launch4j'
-
-minecraft.version = "1.12.2"
-
-minecraft {
- mappings = 'snapshot_nodoc_20171003'
- workspaceDir = "projects"
- versionJson = "jsons/${minecraft.version}-dev.json"
- buildUserdev = true
- buildInstaller = true
- installerVersion = "1.5"
-
- def common = {
- patchPrefixOriginal "../src-base/minecraft"
- patchPrefixChanged "../src-work/minecraft"
- mainClassClient "net.minecraft.launchwrapper.Launch"
- tweakClassClient "net.minecraftforge.fml.common.launcher.FMLTweaker"
- mainClassServer "net.minecraft.launchwrapper.Launch"
- tweakClassServer "net.minecraftforge.fml.common.launcher.FMLServerTweaker"
- }
-
- projects {
- forge {
- rootDir "."
- patchDir "patches/minecraft"
- patchAfter "clean"
- genPatchesFrom "clean"
- genMcpPatches = false
- applyMcpPatches = false
- s2sKeepImports = true
- with common
- }
- }
-}
+apply plugin: 'eclipse'
ext {
- //Dirty hack, but keeps our unique version system on new jenkins
- BUILD_NUMBER = 2838 + (System.getenv('BUILD_NUMBER') ?: project.ext.properties.buildNumber ?: 0).toInteger()
-
- JAR_SIGNER = [:]
+ JAR_SIGNER = null
if (project.hasProperty('keystore')) {
JAR_SIGNER = [
storepass: project.properties.keystoreStorePass,
@@ -73,416 +59,925 @@ ext {
keystore: project.properties.keystore
]
}
+ MAPPING_CHANNEL = 'snapshot'
+ MAPPING_VERSION = '20171003-1.12'
+ MC_VERSION = '1.12.2'
+ MCP_VERSION = '20200226.224830'
+ POST_PROCESSOR = [
+ tool: 'net.minecraftforge:mcpcleanup:2.3.2:fatjar',
+ repo: 'https://files.minecraftforge.net/maven/',
+ args: ['--input', '{input}', '--output', '{output}']
+ ]
}
-group = 'net.minecraftforge'
-version = getVersionFromJava(file("src/main/java/net/minecraftforge/common/ForgeVersion.java"))
-
-extractForgeSources { exclude "**/SideOnly.java", "**/Side.java" }
-extractForgeResources { exclude "**/log4j2.xml" }
-
-genGradleProjects {
- addTestCompileDep "junit:junit:4.12" // TODO update unit tests to junit 5 and remove this
- addTestCompileDep "org.junit.jupiter:junit-jupiter-api:5.0.0"
- addTestCompileDep "org.opentest4j:opentest4j:1.0.0" // needed for junit 5
- addTestCompileDep "org.hamcrest:hamcrest-core:1.3"
- filter { dep -> !dep.contains("scala") }
+project(':mcp') {
+ apply plugin: 'net.minecraftforge.gradle.mcp'
+ mcp {
+ config = MC_VERSION + '-' + MCP_VERSION
+ pipeline = 'joined'
+ }
}
-processJson {
- releaseJson = "jsons/${minecraft.version}-rel.json"
- addReplacements([
- "@minecraft_version@": project.minecraft.version,
- "@version@": project.version,
- "@project@": "forge",
- "@artifact@": "net.minecraftforge:forge:${project.version}",
- "@universal_jar@": { outputJar.archiveName },
- "@timestamp@": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
- ])
+project(':clean') {
+ evaluationDependsOn(':mcp')
+ apply plugin: 'eclipse'
+ apply plugin: 'net.minecraftforge.gradle.patcher'
+ compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
+
+ repositories {
+ mavenCentral()
+ }
+
+ dependencies {
+ implementation 'net.minecraftforge:mergetool:0.2.3.3:forge'
+ }
+
+ patcher {
+ parent = project(':mcp')
+ mcVersion = MC_VERSION
+ patchedSrc = file('src/main/java')
+
+ mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
+ processor = POST_PROCESSOR
+
+ runs {
+ clean_client {
+ taskName 'clean_client'
+
+ main 'net.minecraft.client.main.Main'
+ workingDirectory project.file('run')
+
+ args '--gameDir', '.'
+ args '--version', MC_VERSION
+ args '--assetsDir', downloadAssets.output
+ args '--assetIndex', '{asset_index}'
+ args '--accessToken', '0'
+ }
+
+ clean_server {
+ taskName 'clean_server'
+
+ main 'net.minecraft.server.MinecraftServer'
+ workingDirectory project.file('run')
+ }
+ }
+ }
}
+project(':forge') {
+ evaluationDependsOn(':clean')
+ apply plugin: 'java-library'
+ apply plugin: 'maven-publish'
+ apply plugin: 'eclipse'
+ apply plugin: 'net.minecraftforge.gradle.patcher'
+ apply plugin: 'net.minecrell.licenser'
+ apply plugin: 'de.undercouch.download'
+
+ compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
+ group = 'net.minecraftforge'
-license {
- header = project.file('LICENSE-header.txt')
-
- include 'net/minecraftforge/'
- exclude 'net/minecraftforge/api/distmarker/'
- exclude 'net/minecraftforge/fml/repackage/'
- exclude 'net/minecraftforge/server/terminalconsole/'
- exclude 'net/minecraftforge/fml/common/versioning/ComparableVersion.java'
- exclude 'net/minecraftforge/fml/common/versioning/InvalidVersionSpecificationException.java'
- exclude 'net/minecraftforge/fml/common/versioning/Restriction.java'
- exclude 'net/minecraftforge/fml/common/versioning/VersionRange.java'
-
- tasks {
+ sourceSets {
main {
- files = project.files('src/main/java')
+ java {
+ srcDirs = ["$rootDir/src/main/java"]
+ }
+ resources {
+ srcDirs = ["$rootDir/src/main/resources"]
+ }
}
test {
- files = project.files('src/test/java')
+ compileClasspath += sourceSets.main.runtimeClasspath
+ runtimeClasspath += sourceSets.main.runtimeClasspath
+ java {
+ srcDirs = ["$rootDir/src/test/java"]
+ }
+ resources {
+ srcDirs = ["$rootDir/src/test/resources"]
+ }
+ }
+ userdev {
+ compileClasspath += sourceSets.main.runtimeClasspath
+ runtimeClasspath += sourceSets.main.runtimeClasspath
+ java {
+ srcDirs = ["$rootDir/src/userdev/java"]
+ }
+ resources {
+ srcDirs = ["$rootDir/src/userdev/resources"]
+ }
}
}
-}
+ //Eclipse adds the sourcesets twice, once where we tell it to, once in the projects folder. No idea why. So delete them
+ eclipse.classpath.file.whenMerged { cls -> cls.entries.removeIf { e -> e instanceof SourceFolder && e.path.startsWith('src/') && !e.path.startsWith('src/main/') } }
+
+ repositories {
+ mavenLocal()
+ mavenCentral()
+ }
-task changelog() {
ext {
- changelog_old = rootProject.file('legacy_changelog.txt')
- changelog_new = rootProject.file('build/changelog_new.txt')
- output = rootProject.file('build/changelog.txt')
+ LEGACY_MAJOR = 14 //Legacy versions have a API change prefix
+ LEGACY_BUILD = 2848 //Base build number to not conflict with existing build numbers
+ BUILD_NUMBER = 0 // LEGACY_BUILD + commit offset, used to mimic unique build from old versions
+
+ SPEC_VERSION = '23.5' // This is overwritten by git tag, but here so dev time doesnt explode
+ MCP_ARTIFACT = project(':mcp').mcp.config
+ SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.8.5'
+ VERSION_JSON = project(':mcp').file('build/mcp/downloadJson/version.json')
+ BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.1.1:fatjar'
}
- inputs.file changelog_old
- if (changelog_new.exists())
- inputs.file changelog_new
- outputs.file output
-
- doLast {
- output.text = changelog_new.text + '\n' + changelog_old.text
+
+ def getVersion = {
+ //TAG-offset-hash
+ def raw = grgit.describe(longDescr: true, tags:true)
+ def desc = (raw == null ? '0.0-0-unknown' : grgit.describe(longDescr: true, tags:true)).split('-') as List
+ def hash = desc.remove(desc.size() - 1)
+ def offset = desc.remove(desc.size() - 1)
+ def tag = desc.join('-')
+ def branch = grgit.branch.current().name
+ if (branch in ['master', 'HEAD', MC_VERSION, MC_VERSION + '.0'])
+ branch = null
+ if (branch != null && branch.endsWith('.x') && MC_VERSION.startsWith(branch.substring(0, branch.length() - 2))) //1.13.x
+ branch = null
+ SPEC_VERSION = tag
+ BUILD_NUMBER = LEGACY_BUILD + offset.toInteger()
+ return "${MC_VERSION}-${LEGACY_MAJOR}.${tag}.${BUILD_NUMBER}${t -> if (branch != null) t << '-' + branch}".toString() //Bake the response instead of making it dynamic
}
-}
-task crowdin(type: CrowdinDownload) {
- output = "build/crowdin.zip"
- projectId = 'minecraft-forge'
- extract = false // we wanna keep it as a zip. not extract it to a folder named "crowdin.zip"
-
- // task auomatically skips if this is null
- if (project.hasProperty('crowdinKey'))
- apiKey = project.crowdinKey
-}
+ version = getVersion()
-def extraTxts = [
- "CREDITS.txt",
- "LICENSE.txt",
- "LICENSE-Paulscode SoundSystem CodecIBXM.txt",
- "LICENSE-Paulscode IBXM Library.txt",
- changelog
-]
+ patcher {
+ exc = file("$rootDir/src/main/resources/forge.exc")
+ parent = project(':clean')
+ patches = file("$rootDir/patches/minecraft")
+ patchedSrc = file('src/main/java')
+ srgPatches = true
+ notchObf = true
+ accessTransformer = file("$rootDir/src/main/resources/forge_at.cfg")
+ //sideAnnotationStripper = file("$rootDir/src/main/resources/forge.sas")
+ processor = POST_PROCESSOR
-import groovy.json.JsonSlurper;
-import groovy.json.JsonBuilder;
+ runs {
+ forge_client {
+ taskName 'forge_client'
+ main 'net.minecraftforge.legacydev.MainClient'
-task extractAnnotationsVanilla(type: net.minecraftforge.gradle.tasks.TaskExtractAnnotationsText, dependsOn: deobfuscateJar) {
- jar = deobfuscateJar.outJar
- output = 'build/vanilla_annotations_raw.json'
- doLast { //Re-dump it so it's in groovy's sorted order. Because I like being able to do diffs against things.
- def json = new JsonSlurper().parseText(file(output).text)
- file(output).write(new JsonBuilder(json).toPrettyString())
- }
-}
+ environment 'tweakClass', 'net.minecraftforge.fml.common.launcher.FMLTweaker'
+ environment 'mainClass', 'net.minecraft.launchwrapper.Launch'
+ environment 'assetIndex', '{asset_index}'
+ environment 'assetDirectory', '{assets_root}'
+ environment 'nativesDirectory', '{natives}'
+ environment 'MC_VERSION', '${MC_VERSION}'
+ environment 'MCP_MAPPINGS', '{mcp_mappings}'
+ environment 'MCP_TO_SRG', '{mcp_to_srg}'
+ environment 'FORGE_GROUP', "${project.group}"
+ environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
+ }
-task reobfToSRG(type: net.minecraftforge.gradle.patcher.TaskReobfuscate, dependsOn: reobfuscate) {
- srg = patcher_plugin.delayedFile('{CACHE_DIR}/de/oceanlabs/mcp/mcp_{MAPPING_CHANNEL}/{MAPPING_VERSION}/{MC_VERSION}/srgs/mcp-srg.srg')
- exc = reobfuscate.exc
- preFFJar = reobfuscate.preFFJar
- methodsCsv = reobfuscate.methodsCsv
- fieldsCsv = reobfuscate.fieldsCsv
- addLibs reobfuscate.libs
- inJar = patcher_plugin.delayedFile('{BUILD_DIR}/localCache/Forge/recompiled.jar')
- outJar = 'build/forge_srg.jar'
-}
+ forge_server {
+ taskName 'forge_server'
+ main 'net.minecraftforge.legacydev.MainServer'
-task extractAnnotationsForgeSRG(type: net.minecraftforge.gradle.tasks.TaskExtractAnnotationsText, dependsOn: reobfToSRG) {
- jar = reobfToSRG.outJar
- output = 'build/forge_annotations.json'
- doLast { //Re-dump it so it's in groovy's sorted order. Because I like being able to do diffs against things.
- def json = new JsonSlurper().parseText(file(output).text)
- json.entrySet().removeIf{e -> (!e.key.startsWith('net/minecraft/') && !e.key.startsWith('net/minecraftforge/')) || e.key.endsWith('/package-info')}
- file(output).write(new JsonBuilder(json).toPrettyString())
- }
-}
-
-task fixAnnotationsJson(dependsOn: [extractAnnotationsVanilla, extractAnnotationsForgeSRG, genPatches]) {
- inputs.file(extractAnnotationsVanilla.output)
- inputs.file(extractAnnotationsForgeSRG.output)
- outputs.file('build/vanilla_annotations.json')
- doLast {
- def json_vanilla = new JsonSlurper().parseText(file(extractAnnotationsVanilla.output).text) as TreeMap
- def json_forge = new JsonSlurper().parseText(file(extractAnnotationsForgeSRG.output).text) as TreeMap
- def start = minecraft.projects.forge.patchDir.absolutePath.length()
- file(minecraft.projects.forge.patchDir).traverse(type: groovy.io.FileType.FILES, nameFilter: {nf -> nf.endsWith('.java.patch')}) { f ->
- def cls = f.absolutePath.substring(start+1).replace('\\', '/').replace('.java.patch', '')
- json_vanilla.entrySet().removeIf{e -> e.key == cls || e.key.startsWith(cls + '$')}
- json_forge.entrySet().stream().filter{e -> e.key == cls || e.key.startsWith(cls + '$')}.forEach{e -> json_vanilla.put(e.key, e.value)}
+ environment 'tweakClass', 'net.minecraftforge.fml.common.launcher.FMLServerTweaker'
+ environment 'mainClass', 'net.minecraft.launchwrapper.Launch'
+ environment 'MC_VERSION', '${MC_VERSION}'
+ environment 'MCP_MAPPINGS', '{mcp_mappings}'
+ environment 'MCP_TO_SRG', '{mcp_to_srg}'
+ environment 'FORGE_GROUP', "${project.group}"
+ environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
+ }
+ }
+ }
+
+ ext {
+ MANIFESTS = [
+ '/': [
+ 'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
+ 'GitCommit': grgit.head().abbreviatedId,
+ 'Git-Branch': grgit.branch.current().getName()
+ ] as LinkedHashMap,
+ 'net/minecraftforge/common/': [
+ 'Specification-Title': 'Forge',
+ 'Specification-Vendor': 'Forge Development LLC',
+ 'Specification-Version': SPEC_VERSION,
+ 'Implementation-Title': project.group,
+ 'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
+ 'Implementation-Vendor': 'Forge Development LLC'
+ ] as LinkedHashMap
+ ]
+ }
+
+ applyPatches {
+ canonicalizeAccess true
+ canonicalizeWhitespace true
+ maxFuzz 3
+ originalPrefix = '../src-base/minecraft/'
+ modifiedPrefix = '../src-work/minecraft/'
+ }
+ genPatches {
+ originalPrefix = '../src-base/minecraft/'
+ modifiedPrefix = '../src-work/minecraft/'
+ }
+ configurations {
+ installer {
+ transitive = false //Don't pull all libraries, if we're missing something, add it to the installer list so the installer knows to download it.
+ }
+ api.extendsFrom(installer)
+ fmllauncherImplementation.extendsFrom(installer)
+ }
+ dependencies {
+ installer 'org.ow2.asm:asm-debug-all:5.2'
+ installer 'net.minecraft:launchwrapper:1.12'
+ installer 'org.jline:jline:3.5.1'
+ installer 'com.typesafe.akka:akka-actor_2.11:2.3.3'
+ installer 'com.typesafe:config:1.2.1'
+ installer 'org.scala-lang:scala-actors-migration_2.11:1.1.0'
+ installer 'org.scala-lang:scala-compiler:2.11.1'
+ installer 'org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2_mc' //We change the version so old installs don't break, as our clone of the jar is different the maven central
+ installer 'org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2_mc' // --^
+ installer 'org.scala-lang:scala-library:2.11.1'
+ installer 'org.scala-lang:scala-parser-combinators_2.11:1.0.1'
+ installer 'org.scala-lang:scala-reflect:2.11.1'
+ installer 'org.scala-lang:scala-swing_2.11:1.0.1'
+ installer 'org.scala-lang:scala-xml_2.11:1.0.2'
+ installer 'lzma:lzma:0.0.1'
+ installer 'java3d:vecmath:1.5.2'
+ installer 'net.sf.trove4j:trove4j:3.0.3'
+ installer 'org.apache.maven:maven-artifact:3.5.3'
+
+ testImplementation 'org.junit.jupiter:junit-jupiter-api:5.0.0'
+ testImplementation 'org.junit.vintage:junit-vintage-engine:5.+'
+ testImplementation 'org.opentest4j:opentest4j:1.0.0' // needed for junit 5
+ testImplementation 'org.hamcrest:hamcrest-all:1.3' // needs advanced matching for list order
+ }
+
+ def extraTxts = [
+ rootProject.file('CREDITS.txt'),
+ rootProject.file('LICENSE.txt'),
+ rootProject.file('LICENSE-Paulscode IBXM Library.txt'),
+ rootProject.file('LICENSE-Paulscode SoundSystem CodecIBXM.txt')
+ ]
+
+ def changelog = rootProject.file('build/changelog.txt')
+ if (changelog.exists())
+ extraTxts += changelog
+
+ // We apply the bin patches we just created to make a jar that is JUST our changes
+ genClientBinPatches.tool = BINPATCH_TOOL
+ task applyClientBinPatches(type: ApplyBinPatches, dependsOn: genClientBinPatches) {
+ clean = { genClientBinPatches.cleanJar }
+ input = genClientBinPatches.output
+ tool = BINPATCH_TOOL
+ }
+ genServerBinPatches.tool = BINPATCH_TOOL
+ genJoinedBinPatches.tool = BINPATCH_TOOL
+ task genRuntimeBinPatches(type: GenerateBinPatches, dependsOn: [genClientBinPatches, genServerBinPatches]) {
+ tool = BINPATCH_TOOL
+ }
+ afterEvaluate { p ->
+ genRuntimeBinPatches {
+ cleanJar = genClientBinPatches.cleanJar
+ dirtyJar = genClientBinPatches.dirtyJar
+ srg = genClientBinPatches.srg
+ patchSets = genClientBinPatches.patchSets
+ args = [
+ '--output', '{output}',
+ '--patches', '{patches}',
+ '--srg', '{srg}',
+ '--legacy',
+
+ '--clean', '{clean}',
+ '--dirty', '{dirty}',
+ '--prefix', 'binpatch/client',
+
+ '--clean', '{server}',
+ '--dirty', '{dirty}',
+ '--prefix', 'binpatch/server'
+ ]
+ addExtra('server', genServerBinPatches.cleanJar)
+ }
+ }
+
+ task downloadLibraries(dependsOn: ':mcp:setupMCP') {
+ inputs.file VERSION_JSON
+ doLast {
+ def json = new JsonSlurper().parseText(VERSION_JSON.text)
+ json.libraries.each {lib ->
+ def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
+ artifacts.each{ art ->
+ def target = file('build/libraries/' + art.path)
+ if (!target.exists()) {
+ download {
+ src art.url
+ dest target
+ }
+ }
+ }
+ }
+ }
+ }
+
+ task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) {
+ input { genJoinedBinPatches.cleanJar }
+ doFirst {
+ def json = new JsonSlurper().parseText(VERSION_JSON.text)
+ json.libraries.each {lib ->
+ def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
+ artifacts.each{ art ->
+ def target = file('build/libraries/' + art.path)
+ if (target.exists())
+ addLibrary(target)
+ }
+ }
+ }
+ }
+ task checkATs(dependsOn: genJoinedBinPatches) {
+ inputs.file { genJoinedBinPatches.cleanJar }
+ inputs.files patcher.accessTransformers
+ doLast {
+ def vanilla = [:]
+ def zip = new java.util.zip.ZipFile(genJoinedBinPatches.cleanJar)
+ zip.entries().findAll { !it.directory && it.name.endsWith('.class') }.each { entry ->
+ new ClassReader(zip.getInputStream(entry)).accept(new org.objectweb.asm.ClassVisitor(org.objectweb.asm.Opcodes.ASM7) {
+ String name
+ void visit(int version, int access, String name, String sig, String superName, String[] interfaces) {
+ this.name = name
+ vanilla[name] = access
+ }
+ org.objectweb.asm.FieldVisitor visitField(int access, String name, String desc, String sig, Object value) {
+ vanilla[this.name + ' ' + name] = access
+ return null
+ }
+ org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String desc, String sig, String[] excs) {
+ vanilla[this.name + ' ' + name + desc] = access
+ return null
+ }
+ }, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
+ }
+ patcher.accessTransformers.each { f ->
+ TreeMap lines = [:]
+ f.eachLine { line ->
+ def idx = line.indexOf('#')
+ if (idx == 0 || line.isEmpty()) return
+ def comment = idx == -1 ? null : line.substring(idx)
+ if (idx != -1) line = line.substring(0, idx - 1)
+ def (modifier, cls, desc) = (line.trim() + ' ').split(' ', -1)
+ def key = cls + (desc.isEmpty() ? '' : ' ' + desc)
+ def access = vanilla[key.replace('.', '/')]
+ if (access == null) {
+ if ((desc.equals('*') || desc.equals('*()')) && vanilla[cls.replace('.', '/')] != null)
+ println('Warning: ' + line)
+ else {
+ println('Invalid: ' + line)
+ return
+ }
+ }
+ //TODO: Check access actually changes, and expand inheretence?
+ lines[key] = [modifier: modifier, comment: comment]
+ }
+ f.text = lines.collect{ it.value.modifier + ' ' + it.key + (it.value.comment == null ? '' : ' ' + it.value.comment) }.join('\n')
+ }
+ }
+ }
+ task checkSAS(dependsOn: extractInheritance) {
+ inputs.file { extractInheritance.output }
+ inputs.files patcher.sideAnnotationStrippers
+ doLast {
+ def json = new JsonSlurper().parseText(extractInheritance.output.text)
+
+ patcher.sideAnnotationStrippers.each { f ->
+ def lines = []
+ f.eachLine { line ->
+ if (line[0] == '\t') return //Skip any tabed lines, those are ones we add
+ def idx = line.indexOf('#')
+ if (idx == 0 || line.isEmpty()) {
+ lines.add(line)
+ return
+ }
+
+ def comment = idx == -1 ? null : line.substring(idx)
+ if (idx != -1) line = line.substring(0, idx - 1)
+
+ def (cls, desc) = (line.trim() + ' ').split(' ', -1)
+ cls = cls.replaceAll('\\.', '/')
+ desc = desc.replace('(', ' (')
+ if (desc.isEmpty() || json[cls] == null || json[cls]['methods'] == null || json[cls]['methods'][desc] == null) {
+ println('Invalid: ' + line)
+ return
+ }
+
+ def mtd = json[cls]['methods'][desc]
+ lines.add(cls + ' ' + desc.replace(' ', '') + (comment == null ? '' : ' ' + comment))
+ def children = json.values().findAll{ it.methods != null && it.methods[desc] != null && it.methods[desc].override == cls}
+ .collect { it.name + ' ' + desc.replace(' ', '') } as TreeSet
+ children.each { lines.add('\t' + it) }
+ }
+ f.text = lines.join('\n')
+ }
+ }
+ }
+
+ task launcherJson(dependsOn: ['signUniversalJar']) {
+ inputs.file { universalJar.archivePath }
+ ext {
+ output = file('build/version.json')
+ vanilla = project(':mcp').file('build/mcp/downloadJson/version.json')
+ timestamp = dateToIso8601(new Date())
+ comment = [
+ "Please do not automate the download and installation of Forge.",
+ "Our efforts are supported by ads from the download page.",
+ "If you MUST automate this, please consider supporting the project through https://www.patreon.com/LexManos/"
+ ]
+ def idx = project.version.indexOf('-')
+ id = project.version.substring(0, idx) + "-${project.name}" + project.version.substring(idx)
+ }
+ inputs.file vanilla
+ outputs.file output
+ doLast {
+ def json_vanilla = new JsonSlurper().parseText(vanilla.text)
+ def json = [
+ _comment_: comment,
+ id: id,
+ time: timestamp,
+ releaseTime: timestamp,
+ type: 'release',
+ mainClass: 'net.minecraft.launchwrapper.Launch',
+ inheritsFrom: MC_VERSION,
+ logging: {},
+ minecraftArguments: [
+ '--username', '${auth_player_name}',
+ '--version', '${version_name}',
+ '--gameDir', '${game_directory}',
+ '--assetsDir', '${assets_root}',
+ '--assetIndex', '${assets_index_name}',
+ '--uuid', '${auth_uuid}',
+ '--accessToken', '${auth_access_token}',
+ '--userType', '${user_type}',
+ '--tweakClass', 'net.minecraftforge.fml.common.launcher.FMLTweaker',
+ '--versionType', 'Forge'
+ ].join(' '),
+ libraries: [
+ [
+ //Package our universal jar as the 'main' jar Mojang's launcher loads. It will in turn load Forge's regular jars itself.
+ name: "${project.group}:${project.name}:${project.version}",
+ downloads: [
+ artifact: [
+ path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar",
+ url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
+ sha1: sha1(universalJar.archivePath),
+ size: universalJar.archivePath.length()
+ ]
+ ]
+ ]
+ ]
+ ]
+
+ def artifacts = getArtifacts(project, project.configurations.installer, false)
+ artifacts.each { key, lib ->
+ json.libraries.add(lib)
+ }
+
+ output.text = new JsonBuilder(json).toPrettyString()
+ }
+ }
+
+ task installerJson(dependsOn: [launcherJson, genClientBinPatches/*, createClientSRG, createServerSRG*/]) {
+ ext {
+ output = file('build/install_profile.json')
+ INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.4'
+ }
+ inputs.file universalJar.archivePath
+ inputs.file genClientBinPatches.toolJar
+ inputs.file launcherJson.output
+ outputs.file output
+ doLast {
+ def libs = [
+ "${project.group}:${project.name}:${project.version}": [
+ name: "${project.group}:${project.name}:${project.version}",
+ downloads: [
+ artifact: [
+ path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar",
+ url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
+ sha1: sha1(universalJar.archivePath),
+ size: universalJar.archivePath.length()
+ ]
+ ]
+ ]
+ ]
+ def json = [
+ _comment_: launcherJson.comment,
+ spec: 0,
+ profile: project.name,
+ version: launcherJson.id,
+ icon: "data:image/png;base64," + new String(Base64.getEncoder().encode(Files.readAllBytes(rootProject.file("icon.ico").toPath()))),
+ json: '/version.json',
+ path: "${project.group}:${project.name}:${project.version}",
+ logo: '/big_logo.png',
+ minecraft: MC_VERSION,
+ welcome: "Welcome to the simple ${project.name.capitalize()} installer.",
+ data: [
+ ],
+ processors: [
+ ]
+ ]
+ getClasspath(project, libs, MCP_ARTIFACT.descriptor) //Tell it to download mcp_config
+ json.libraries = libs.values().sort{a,b -> a.name.compareTo(b.name)}
+
+ output.text = new JsonBuilder(json).toPrettyString()
+ }
+ }
+
+ task extractObf2Srg(type:net.minecraftforge.gradle.common.task.ExtractMCPData, dependsOn: [':mcp:downloadConfig']) {
+ config = project(':mcp').downloadConfig.output
+ }
+
+ task deobfDataLzma(dependsOn: [extractObf2Srg]) {
+ ext {
+ output_srg = file('build/deobfDataLzma/data.srg')
+ output = file('build/deobfDataLzma/data.lzma')
+ }
+ inputs.file extractObf2Srg.output
+ outputs.file output
+ doLast {
+ net.minecraftforge.gradle.common.util.MappingFile.load(extractObf2Srg.output)
+ .write(net.minecraftforge.gradle.common.util.MappingFile.Format.SRG, output_srg)
+
+ output_srg.withInputStream { ins ->
+ output.withOutputStream { outs ->
+ def lz = new lzma.streams.LzmaOutputStream.Builder(outs).useEndMarkerMode(true).build()
+
+ def i = -1
+ def buf = new byte[0x100]
+ while ((i = ins.read(buf)) != -1)
+ lz.write(buf, 0, i)
+
+ lz.close()
+ }
+ }
+ }
+ }
+
+ universalJar {
+ from(extraTxts)
+ dependsOn(deobfDataLzma)
+ from(deobfDataLzma.output){
+ rename{"deobfuscation_data-${MC_VERSION}.lzma"}
+ }
+ dependsOn(genRuntimeBinPatches)
+ from(genRuntimeBinPatches.output) {
+ rename{'binpatches.pack.lzma'}
+ }
+ doFirst {
+ MANIFESTS.each{ pkg, values ->
+ if (pkg == '/') {
+ manifest.attributes(values)
+ } else {
+ manifest.attributes(values, pkg)
+ }
+ }
+ }
+ }
+
+ task downloadInstaller(type: DownloadMavenArtifact) {
+ artifact = 'net.minecraftforge:installer:2.0.+:shrunk'
+ changing = true
+ }
+
+ task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, 'signUniversalJar']) {
+ classifier = 'installer'
+ extension = 'jar' //Needs to be Zip task to not override Manifest, so set extension
+ destinationDir = file('build/libs')
+ from(extraTxts)
+ from(rootProject.file('/src/main/resources/forge_logo.png')) {
+ rename{'big_logo.png'}
+ }
+ from(rootProject.file('/src/main/resources/url.png'))
+ from(universalJar) {
+ into("/maven/${project.group.replace('.', '/')}/${project.name}/${project.version}/")
+ rename{"${project.name}-${project.version}.jar"}
+ }
+ from(installerJson.output)
+ from(launcherJson.output)
+ from(zipTree(downloadInstaller.output)) {
+ duplicatesStrategy = 'exclude'
+ }
+ }
+
+ [universalJar, installerJar].each { t ->
+ task "sign${t.name.capitalize()}"(type: SignJar, dependsOn: t) {
+ onlyIf {
+ JAR_SIGNER != null && t.state.failure == null
+ }
+ def jarsigner = JAR_SIGNER == null ? [:] : JAR_SIGNER
+ alias = 'forge'
+ storePass = jarsigner.storepass
+ keyPass = jarsigner.keypass
+ keyStore = jarsigner.keystore
+ inputFile = t.archivePath
+ outputFile = t.archivePath
+ doFirst {
+ project.logger.lifecycle('Signing: ' + inputFile)
+ }
+ }
+ t.finalizedBy(tasks.getByName("sign${t.name.capitalize()}"))
+ }
+
+ task makeMdk(type: Zip) {
+ baseName = project.name
+ classifier = 'mdk'
+ version = project.version
+ destinationDir = file('build/libs')
+
+ from rootProject.file('gradlew')
+ from rootProject.file('gradlew.bat')
+ from extraTxts
+ from(rootProject.file('gradle/')){
+ into('gradle/')
+ }
+ from(rootProject.file('mdk/')){
+ rootProject.file('mdk/gitignore.txt').eachLine{
+ if (!it.trim().isEmpty() && !it.trim().startsWith('#'))
+ exclude it
+ }
+ filter(ReplaceTokens, tokens: [
+ FORGE_VERSION: project.version,
+ FORGE_GROUP: project.group,
+ FORGE_NAME: project.name,
+ MC_VERSION: MC_VERSION,
+ MAPPING_CHANNEL: MAPPING_CHANNEL,
+ MAPPING_VERSION: MAPPING_VERSION
+ ])
+ rename 'gitignore\\.txt', '.gitignore'
+ }
+ }
+
+ userdevConfig {
+ def artifacts = getArtifacts(project, project.configurations.installer, true)
+ artifacts.each { key, lib ->
+ addLibrary(lib.name)
+ }
+ addLibrary('net.minecraftforge:legacydev:0.2.3.+:fatjar')
+ addUniversalFilter('^(?!binpatches\\.pack\\.lzma$).*$')
+
+ runs {
+ client {
+ main 'net.minecraftforge.legacydev.MainClient'
+
+ environment 'tweakClass', 'net.minecraftforge.fml.common.launcher.FMLTweaker'
+ environment 'mainClass', 'net.minecraft.launchwrapper.Launch'
+ environment 'assetIndex', '{asset_index}'
+ environment 'assetDirectory', '{assets_root}'
+ environment 'nativesDirectory', '{natives}'
+ environment 'MC_VERSION', '${MC_VERSION}'
+ environment 'MCP_MAPPINGS', '{mcp_mappings}'
+ environment 'MCP_TO_SRG', '{mcp_to_srg}'
+ environment 'FORGE_GROUP', "${project.group}"
+ environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
+ }
+
+ server {
+ main 'net.minecraftforge.legacydev.MainServer'
+
+ environment 'tweakClass', 'net.minecraftforge.fml.common.launcher.FMLServerTweaker'
+ environment 'mainClass', 'net.minecraft.launchwrapper.Launch'
+ environment 'MC_VERSION', '${MC_VERSION}'
+ environment 'MCP_MAPPINGS', '{mcp_mappings}'
+ environment 'MCP_TO_SRG', '{mcp_to_srg}'
+ environment 'FORGE_GROUP', "${project.group}"
+ environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
+ }
+ }
+ }
+
+ license {
+ header = file("$rootDir/LICENSE-header.txt")
+
+ include 'net/minecraftforge/'
+ /*
+ exclude 'net/minecraftforge/server/terminalconsole/'
+ exclude 'net/minecraftforge/api/' // exclude API here because it's validated in the SPI build
+ exclude 'net/minecraftforge/fml/common/versioning/ComparableVersion.java'
+ exclude 'net/minecraftforge/fml/common/versioning/InvalidVersionSpecificationException.java'
+ exclude 'net/minecraftforge/fml/common/versioning/Restriction.java'
+ exclude 'net/minecraftforge/fml/common/versioning/VersionRange.java'
+ */
+
+ tasks {
+ main {
+ files = files("$rootDir/src/main/java")
+ }
+ test {
+ files = files("$rootDir/src/test/java")
+ }
+ }
+ }
+
+ task userdevExtras(type:Jar) {
+ dependsOn classes
+ from sourceSets.userdev.output
+ classifier 'userdev-temp'
+ }
+
+ task userdevExtrasReobf(type:TaskReobfuscateJar) {
+ dependsOn userdevExtras, createMcp2Srg
+ input = tasks.userdevExtras.archivePath
+ classpath = project.configurations.compile
+ srg = tasks.createMcp2Srg.output
+ }
+
+ userdevJar {
+ dependsOn userdevExtrasReobf
+ from (zipTree(tasks.userdevExtrasReobf.output)) {
+ into '/inject/'
+ }
+ from (sourceSets.userdev.output.resourcesDir) {
+ into '/inject/'
+ }
+ classifier 'userdev3'
+ }
+
+ extractRangeMap {
+ addDependencies jar.archivePath
+ addSources sourceSets.userdev.java.srcDirs
+ }
+ applyRangeMap {
+ setSources sourceSets.userdev.java.srcDirs
+ }
+
+ tasks.eclipse.dependsOn('genEclipseRuns')
+
+ if (project.hasProperty('UPDATE_MAPPINGS')) {
+ extractRangeMap {
+ sources sourceSets.test.java.srcDirs
+ }
+ applyRangeMap {
+ sources sourceSets.test.java.srcDirs
+ }
+ sourceSets.test.java.srcDirs.each { extractMappedNew.addTarget it }
+ }
+
+ publishing {
+ publications {
+ mavenJava(MavenPublication) {
+ artifact universalJar
+ if (changelog.exists()) {
+ artifact(changelog) {
+ classifier = 'changelog'
+ }
+ }
+ artifact installerJar
+ //TODO: installer-win
+ artifact makeMdk
+ artifact userdevJar
+ artifact sourcesJar
+
+ pom {
+ name = 'forge'
+ description = 'Modifactions to Minecraft to enable mod developers.'
+ url = 'https://github.com/MinecraftForge/MinecraftForge'
+
+ scm {
+ url = 'https://github.com/MinecraftForge/MinecraftForge'
+ connection = 'scm:git:git://github.com/MinecraftForge/MinecraftForge.git'
+ developerConnection = 'scm:git:git@github.com:MinecraftForge/MinecraftForge.git'
+ }
+
+ issueManagement {
+ system = 'github'
+ url = 'https://github.com/MinecraftForge/MinecraftForge/issues'
+ }
+
+ licenses {
+ license {
+ name = 'LGPL 2.1'
+ url = 'https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE.txt'
+ distribution = 'repo'
+ }
+ }
+ }
+ }
+ }
+ repositories {
+ maven {
+ if (project.hasProperty('forgeMavenPassword')) {
+ credentials {
+ username project.properties.forgeMavenUser
+ password project.properties.forgeMavenPassword
+ }
+ url 'https://files.minecraftforge.net/maven/manage/upload'
+ } else {
+ url 'file://' + rootProject.file('repo').getAbsolutePath()
+ }
+ }
}
- json_forge.entrySet().stream().filter{e -> e.key.startsWith('net/minecraftforge/')}.forEach{e -> json_vanilla.put(e.key, e.value)}
- outputs.files.singleFile.write(new JsonBuilder(json_vanilla).toPrettyString())
}
}
-
-outputJar {
- classifier = 'universal'
- from extraTxts
- from(fixAnnotationsJson){
- into 'META-INF'
- }
- dependsOn fixAnnotationsJson
-
- // add crowdin locales
- from { crowdin.getDidWork() ? zipTree(crowdin.output) : null}
- dependsOn 'crowdin'
-
- manifest.attributes([
- "Main-Class": "net.minecraftforge.fml.relauncher.ServerLaunchWrapper",
- "TweakClass": "net.minecraftforge.fml.common.launcher.FMLTweaker",
- "Class-Path": getServerClasspath(file("jsons/${minecraft.version}-rel.json"))
- ])
+def dateToIso8601(date) {
+ def format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
+ def result = format.format(date)
+ return result[0..21] + ':' + result[22..-1]
}
-installer {
- classifier = 'installer'
- from extraTxts
- from "src/main/resources/forge_logo.png"
- from "src/main/resources/url.png"
- rename "forge_logo\\.png", "big_logo.png"
+def sha1(file) {
+ MessageDigest md = MessageDigest.getInstance('SHA-1')
+ file.eachByte 4096, {bytes, size ->
+ md.update(bytes, 0, size)
+ }
+ return md.digest().collect {String.format "%02x", it}.join()
}
-task signUniversal(type: SignJar, dependsOn: 'outputJar') {
- onlyIf {
- project.hasProperty('jarsigner')
- }
-
- alias = 'forge'
- exclude "paulscode/**"
- storePass = JAR_SIGNER.storepass
- keyPass = JAR_SIGNER.keypass
- keyStore = JAR_SIGNER.keystore
- inputFile = outputJar.archivePath
- outputFile = outputJar.archivePath
+def artifactTree(project, artifact) {
+ if (!project.ext.has('tree_resolver'))
+ project.ext.tree_resolver = 1
+ def cfg = project.configurations.create('tree_resolver_' + project.ext.tree_resolver++)
+ def dep = project.dependencies.create(artifact)
+ cfg.dependencies.add(dep)
+ def files = cfg.resolve()
+ return getArtifacts(project, cfg, true)
}
-uploadArchives.dependsOn signUniversal
-build.dependsOn signUniversal
-installer.dependsOn signUniversal
-// MDK package
-
-import org.apache.tools.ant.filters.ReplaceTokens
-task makeMdk(type: Zip) {
- baseName = project.name
- classifier = "mdk"
- version = project.version
- destinationDir = file('build/distributions')
-
- from 'gradlew'
- from 'gradlew.bat'
- from extraTxts
- into ('gradle') {
- from 'gradle'
- }
- into ('eclipse') {
- from 'mdk/eclipse'
- }
- from ('mdk') {
- filter(ReplaceTokens, tokens: [
- VERSION: project.version,
- MAPPINGS: minecraft.mappings.replace('nodoc_', '')
- ])
- exclude 'eclipse'
- rename 'gitignore\\.txt', '.gitignore'
+def getArtifacts(project, config, classifiers) {
+ def ret = [:]
+ config.resolvedConfiguration.resolvedArtifacts.each {
+ def art = [
+ group: it.moduleVersion.id.group,
+ name: it.moduleVersion.id.name,
+ version: it.moduleVersion.id.version,
+ classifier: it.classifier,
+ extension: it.extension,
+ file: it.file
+ ]
+ def key = art.group + ':' + art.name
+ def folder = "${art.group.replace('.', '/')}/${art.name}/${art.version}/"
+ def filename = "${art.name}-${art.version}"
+ if (art.classifier != null)
+ filename += "-${art.classifier}"
+ filename += ".${art.extension}"
+ def path = "${folder}${filename}"
+ def url = "https://libraries.minecraft.net/${path}"
+ if (!checkExists(url)) {
+ url = "https://files.minecraftforge.net/maven/${path}"
+ }
+ //TODO remove when Mojang launcher is updated
+ if (!classifiers && art.classifier != null) { //Mojang launcher doesn't currently support classifiers, so... move it to part of the version, and force the extension to 'jar'
+ art.version = "${art.version}-${art.classifier}"
+ art.classifier = null
+ art.extension = 'jar'
+ path = "${art.group.replace('.', '/')}/${art.name}/${art.version}/${art.name}-${art.version}.jar"
+ }
+ ret[key] = [
+ name: "${art.group}:${art.name}:${art.version}" + (art.classifier == null ? '' : ":${art.classifier}") + (art.extension == 'jar' ? '' : "@${art.extension}"),
+ downloads: [
+ artifact: [
+ path: path,
+ url: url,
+ sha1: sha1(art.file),
+ size: art.file.length()
+ ]
+ ]
+ ]
}
+ return ret
}
-tasks.build.dependsOn makeMdk
-// launch4j
-
-launch4j {
- jar = installer.archivePath.canonicalPath
- outfile = "${project.name}-${project.version}-installer-win.exe"
- icon = file('icon.ico').canonicalPath
- manifest = file('l4jManifest.xml').canonicalPath
- jreMinVersion = '1.8.0_101'
- initialHeapPercent = 5
- maxHeapPercent = 100
-}
-tasks.createExe.dependsOn installer
-tasks.build.dependsOn 'launch4j'
-
-// MAVEN
-
-artifacts {
- archives(changelog.outputs.files.singleFile) {
- classifier = 'changelog'
+def checkExists(url) {
+ def code = new URL(url).openConnection().with {
+ requestMethod = 'HEAD'
+ connect()
+ responseCode
}
- archives file('build/' + launch4j.outputDir + '/' + launch4j.outfile)
- archives makeMdk
+ return code == 200
+}
+
+def getClasspath(project, libs, artifact) {
+ def ret = []
+ artifactTree(project, artifact).each { key, lib ->
+ libs[lib.name] = lib
+ if (lib.name != artifact)
+ ret.add(lib.name)
+ }
+ return ret
}
task ciWriteBuildNumber << {
- def file = file("src/main/java/net/minecraftforge/common/ForgeVersion.java");
- def outfile = "";
- def ln = "\n"; //Linux line endings because we're on git!
+ def file = file('src/main/java/net/minecraftforge/common/ForgeVersion.java');
+ def outfile = '';
+ def ln = '\n'; //Linux line endings because we're on git!
file.eachLine{ String s ->
- if (s.matches("^ public static final int buildVersion = [\\d]+;\$"))
- s = " public static final int buildVersion = ${BUILD_NUMBER};";
+ if (s.matches('^ public static final int buildVersion = [\\d]+;\$'))
+ s = " public static final int buildVersion = ${project(':forge').BUILD_NUMBER};"
if (s.matches('^ public static final String mcVersion = "[^\\"]+";'))
- s = " public static final String mcVersion = \"${minecraft.version}\";";
+ s = " public static final String mcVersion = \"${MC_VERSION}\";"
outfile += (s+ln);
}
file.write(outfile);
}
-uploadArchives {
- repositories.mavenDeployer {
-
- dependsOn 'build'
-
- if (project.hasProperty('forgeMavenPassword'))
- {
- repository(url: "https://files.minecraftforge.net/maven/manage/upload") {
- authentication(userName: project.getProperty('forgeMavenUser'), password: project.getProperty('forgeMavenPassword'))
- }
- }
- else
- {
- repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
- }
-
- pom {
- groupId = project.group
- version = project.version
- artifactId = project.archivesBaseName
- project {
- name project.archivesBaseName
- packaging 'jar'
- description 'Minecraft Forge API'
- url 'https://github.com/MinecraftForge/MinecraftForge'
-
- scm {
- url 'https://github.com/MinecraftForge/MinecraftForge'
- connection 'scm:git:git://github.com/MinecraftForge/MinecraftForge.git'
- developerConnection 'scm:git:git@github.com:MinecraftForge/MinecraftForge.git'
- }
-
- issueManagement {
- system 'github'
- url 'https://github.com/MinecraftForge/MinecraftForge/issues'
- }
-
- licenses {
- license {
- name 'Forge Public License'
- url 'https://raw.github.com/MinecraftForge/MinecraftForge/master/MinecraftForge-License.txt'
- distribution 'repo'
- }
- }
-
- developers {
- developer {
- id 'cpw'
- name 'cpw'
- roles { role 'developer' }
- }
- developer {
- id 'LexManos'
- name 'Lex Manos'
- roles { role 'developer' }
- }
- developer {
- id 'AbrarSyed'
- name 'Abrar Syed'
- roles { role 'contributor' }
- }
- }
- }
- }
- }
+//evaluationDependsOnChildren()
+task setup() {
+ dependsOn ':clean:extractMapped'
+ dependsOn ':forge:extractMapped' //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
}
-// HELPER METHODS
-
-String getServerClasspath(File file)
-{
- def node = new JsonSlurper().parse(file);
- def out = new StringBuilder()
- node.versionInfo.libraries.each { lib ->
- if (lib.serverreq)
- {
- // group : artifact : version
- def split = lib.name.split(':')
- def group = split[0].replace('.', '/')
- def artifact = split[1]
- def version = split[2]
- out += "libraries/$group/$artifact/$version/$artifact-${version}.jar "
- }
- }
- out += "minecraft_server.${minecraft.version}.jar"
-
- return out.toString();
-}
-
-String getVersionFromJava(File file)
-{
- String major = "0";
- String minor = "0";
- String revision = "0";
- String build = "0";
-
- String prefix = "public static final int";
- file.eachLine{ String s ->
- s = s.trim();
- if (s.startsWith(prefix))
- {
- s = s.substring(prefix.length(), s.length() - 1);
- s = s.replace('=', ' ').replace("Version", "").replaceAll(" +", " ").trim();
- String[] pts = s.split(" ");
-
- if (pts[0].equals("major")) major = pts[pts.length - 1];
- else if (pts[0] == "minor") minor = pts[pts.length - 1];
- else if (pts[0] == "revision") revision = pts[pts.length - 1];
- }
- }
-
- build = BUILD_NUMBER
-
- String branch = null;
- if (!System.getenv().containsKey("GIT_BRANCH"))
- {
- // TODO: use grgit - Tried to switch 07/07/16 - jgit broken on windows?
- branch = "git rev-parse --abbrev-ref HEAD".execute().text.trim()
- }
- else
- {
- branch = System.getenv("GIT_BRANCH");
- branch = branch.substring(branch.lastIndexOf('/') + 1);
- }
-
- def out = "${minecraft.version.replace('-', '_')}-$major.$minor.$revision.$build"
-
- if (branch && branch != 'master' && branch != 'HEAD' && branch != minecraft.version && branch != minecraft.version + '.0')
- {
- if (!(branch.endsWith('.x') && minecraft.version.startsWith(branch.substring(0, branch.length() -2))))
- out += "-$branch"
- }
-
- return out;
-}
-
-reobfuscate {
- extraSrg = [
- 'MD: net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry/getKeys ()Ljava/util/Set; net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry/getKeys ()Ljava/util/Set;'
- ]
-}
-
-task resetBuildNumber << {
- project.ext.properties.buildNumber = 0;
- ciWriteBuildNumber.execute()
-}
-// re-add old tasks for jenkins compat
-// should be removed, and the jenkins fixed when no longer building with FG 1.2
-task setupForge { dependsOn 'setup', 'ciWriteBuildNumber' }
-task buildPackages { dependsOn 'build' }
-
-//Temporary hack to fix compile errors caused by mappings shading in Bootstrap
-/*
-task fixParams << {
- logger.lifecycle('Fixing param names!')
- def params = new File(extractMcpMappings.destinationDir, 'params.csv')
- def text = params.text
- text = text.replaceAll('p_180276_1_,biome,', 'p_180276_1_,biomeIn,')
- params.write(text)
-}
-fixParams.dependsOn('extractMcpMappings')
-extractMcpMappings.finalizedBy('fixParams')
-*/
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 30d399d8d2..7a3265ee94 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 e18cba72f4..949819d28a 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
diff --git a/gradlew b/gradlew
index 91a7e269e1..cccdd3d517 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
##############################################################################
##
@@ -6,47 +6,6 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
+cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$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=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 8a0b282aa6..f9553162f1 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
-@rem Get command-line arguments, handling Windowz variants
+@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
diff --git a/mdk/README.txt b/mdk/README.txt
index 82be8dcd24..6904b37735 100644
--- a/mdk/README.txt
+++ b/mdk/README.txt
@@ -19,35 +19,26 @@ http://mcforge.readthedocs.io/en/latest/gettingstarted/
Step 1: Open your command-line and browse to the folder where you extracted the zip file.
-Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:
+Step 2: You're left with a choice.
+If you prefer to use Eclipse:
+1. Run the following command: "gradlew genEclipseRuns" (./gradlew genEclipseRuns if you are on Mac/Linux)
+2. Open Eclipse, Import > Existing Gradle Project > Select Folder
+ or run "gradlew eclipse" to generate the project.
+(Current Issue)
+4. Open Project > Run/Debug Settings > Edit runClient and runServer > Environment
+5. Edit MOD_CLASSES to show [modid]%%[Path]; 2 times rather then the generated 4.
-Windows: "gradlew setupDecompWorkspace"
-Linux/Mac OS: "./gradlew setupDecompWorkspace"
-
-Step 3: After all that finished, you're left with a choice.
-For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)
-
-If you prefer to use IntelliJ, steps are a little different.
+If you prefer to use IntelliJ:
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
-3. Once it's finished you must close IntelliJ and run the following command:
-
-"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
-
-Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)
+3. Run the following command: "gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
+4. Refresh the Gradle Project in IDEA if required.
If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not affect your code} and then start the processs again.
Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.
-
-Tip:
-If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
-"setupDevWorkspace": Will patch, deobfuscate, and gather required assets to run minecraft, but will not generate human readable source code.
-"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.
-
-Tip:
-When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.
+or the Forge Project Discord discord.gg/UvedJ9m
Forge source installation
=========================
diff --git a/mdk/build.gradle b/mdk/build.gradle
index 6f2e0a9097..f41cdad391 100644
--- a/mdk/build.gradle
+++ b/mdk/build.gradle
@@ -1,77 +1,118 @@
buildscript {
repositories {
+ maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
- maven { url = "https://files.minecraftforge.net/maven" }
+ mavenCentral()
}
dependencies {
- classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
+ classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
}
}
-apply plugin: 'net.minecraftforge.gradle.forge'
-//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
+
+apply plugin: 'net.minecraftforge.gradle'
+// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
+apply plugin: 'eclipse'
+apply plugin: 'maven-publish'
+version = '1.0'
+group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
+archivesBaseName = 'modid'
-version = "1.0"
-group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
-archivesBaseName = "modid"
-
-sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
-compileJava {
- sourceCompatibility = targetCompatibility = '1.8'
-}
+sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
- version = "@VERSION@"
- runDir = "run"
-
- // the mappings can be changed at any time, and must be in the following format.
- // snapshot_YYYYMMDD snapshot are built nightly.
- // stable_# stables are built at the discretion of the MCP team.
+ // The mappings can be changed at any time, and must be in the following format.
+ // snapshot_YYYYMMDD Snapshot are built nightly.
+ // stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
- // simply re-run your setup task after changing the mappings to update your workspace.
- mappings = "@MAPPINGS@"
+ // Simply re-run your setup task after changing the mappings to update your workspace.
+ //mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
+ mappings channel: 'snapshot', version: '20171003-1.12'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
+
+ // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
+
+ // Default run configurations.
+ // These can be tweaked, removed, or duplicated as needed.
+ runs {
+ client {
+ workingDirectory project.file('run')
+
+ // Recommended logging data for a userdev environment
+ property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
+
+ // Recommended logging level for the console
+ property 'forge.logging.console.level', 'debug'
+ }
+
+ server {
+
+ // Recommended logging data for a userdev environment
+ property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
+
+ // Recommended logging level for the console
+ property 'forge.logging.console.level', 'debug'
+ }
+ }
}
dependencies {
- // you may put jars on which you depend on in ./libs
- // or you may define them like so..
- //compile "some.group:artifact:version:classifier"
- //compile "some.group:artifact:version"
-
- // real examples
- //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
- //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
+ // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
+ // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
+ // The userdev artifact is a special name and will get all sorts of transformations applied to it.
+ //minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
+ minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2849'
- // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
- //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
+ // You may put jars on which you depend on in ./libs or you may define them like so..
+ // compile "some.group:artifact:version:classifier"
+ // compile "some.group:artifact:version"
- // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
- // except that these dependencies get remapped to your current MCP mappings
- //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
- //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
+ // Real examples
+ // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
+ // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
- // for more info...
+ // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
+ // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
+
+ // These dependencies get remapped to your current MCP mappings
+ // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
+
+ // For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
-processResources {
- // this will ensure that this task is redone when the versions change.
- inputs.property "version", project.version
- inputs.property "mcversion", project.minecraft.version
-
- // replace stuff in mcmod.info, nothing else
- from(sourceSets.main.resources.srcDirs) {
- include 'mcmod.info'
-
- // replace version and mcversion
- expand 'version':project.version, 'mcversion':project.minecraft.version
- }
-
- // copy everything else except the mcmod.info
- from(sourceSets.main.resources.srcDirs) {
- exclude 'mcmod.info'
+// Example for how to get properties into the manifest for reading by the runtime..
+jar {
+ manifest {
+ attributes([
+ "Specification-Title": "examplemod",
+ "Specification-Vendor": "examplemodsareus",
+ "Specification-Version": "1", // We are version 1 of ourselves
+ "Implementation-Title": project.name,
+ "Implementation-Version": "${version}",
+ "Implementation-Vendor" :"examplemodsareus",
+ "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
+ ])
}
}
+
+// Example configuration to allow publishing using the maven-publish task
+// This is the preferred method to reobfuscate your jar file
+jar.finalizedBy('reobfJar')
+// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
+//publish.dependsOn('reobfJar')
+
+publishing {
+ publications {
+ mavenJava(MavenPublication) {
+ artifact jar
+ }
+ }
+ repositories {
+ maven {
+ url "file:///${project.projectDir}/mcmodsrepo"
+ }
+ }
+}
\ No newline at end of file
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/MDKExample/.location b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/MDKExample/.location
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/0.tree b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/0.tree
deleted file mode 100644
index c64a62aa35..0000000000
Binary files a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/0.tree and /dev/null differ
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 466d7f93a1..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Sun Jun 05 18:58:07 CEST 2011
-version=1
-eclipse.preferences.version=1
-refresh.enabled=true
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs
deleted file mode 100644
index 94c56761d3..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun Jun 05 19:03:53 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.debug.ui.UseContextualLaunch=false
-Console.highWaterMark=88000
-org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\r\n\r\n
-org.eclipse.debug.ui.user_view_bindings=\r\n\r\n\r\n\r\n\r\n\r\n
-StringVariablePreferencePage=130,107,107,86,
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs
deleted file mode 100644
index 333b991531..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun Jun 05 18:58:07 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.epp.usagedata.gathering.enabled=false
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 12ec368903..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Sun Sep 18 16:44:39 NZST 2011
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=ignore
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
-org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs
deleted file mode 100644
index 316ef6f309..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Sun Jun 05 18:58:05 CEST 2011
-spacesForTabs=true
-eclipse.preferences.version=1
-overviewRuler_migration=migrated_3.1
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs
deleted file mode 100644
index ae368abb9e..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs
+++ /dev/null
@@ -1,9 +0,0 @@
-#Sun Jun 05 18:58:07 CEST 2011
-IMPORT_FILES_AND_FOLDERS_MODE=prompt
-IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt
-SAVE_ALL_BEFORE_BUILD=true
-eclipse.preferences.version=1
-tipsAndTricks=true
-platformState=1287081747687
-quickStart=false
-PROBLEMS_FILTERS_MIGRATE=true
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs
deleted file mode 100644
index cbc59537b0..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun Jun 05 18:50:08 CEST 2011
-eclipse.preferences.version=1
-showIntro=false
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Client.launch b/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Client.launch
deleted file mode 100644
index 61b8b47f37..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Client.launch
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Server.launch b/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Server.launch
deleted file mode 100644
index c34d27ae57..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Server.launch
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
deleted file mode 100644
index 1208f602e5..0000000000
--- a/mdk/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mdk/gitignore.txt b/mdk/gitignore.txt
index 2c770e09fe..12f864471f 100644
--- a/mdk/gitignore.txt
+++ b/mdk/gitignore.txt
@@ -20,3 +20,6 @@ build
# other
eclipse
run
+
+# Files from Forge MDK
+forge*changelog.txt
diff --git a/mdk/gradle.properties b/mdk/gradle.properties
index e9b9fd5ac1..878bf1f7ec 100644
--- a/mdk/gradle.properties
+++ b/mdk/gradle.properties
@@ -1,3 +1,4 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
+org.gradle.daemon=false
\ No newline at end of file
diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch
index f30aa06996..b3a8372cbf 100644
--- a/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch
+++ b/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch
@@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/entity/monster/EntityEvoker.java
+++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEvoker.java
-@@ -369,7 +369,7 @@
+@@ -365,7 +365,7 @@
{
return false;
}
diff --git a/settings.gradle b/settings.gradle
index 74046b5b85..2acad82fc7 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1,9 @@
-rootProject.name = 'forge'
\ No newline at end of file
+rootProject.name = 'forge'
+
+include ':mcp'
+include ':clean'
+include ':forge'
+
+project(":mcp").projectDir = file("projects/mcp")
+project(":clean").projectDir = file("projects/clean")
+project(":forge").projectDir = file("projects/forge")
\ No newline at end of file