mirror of https://github.com/cabaletta/baritone
fabric with volder-mappings, soo close to working
This commit is contained in:
parent
6e78384bcf
commit
d6cbb58e7e
226
build.gradle
226
build.gradle
|
@ -28,12 +28,20 @@ buildscript {
|
|||
name = 'impactdevelopment-repo'
|
||||
url = 'https://impactdevelopment.github.io/maven/'
|
||||
}
|
||||
maven {
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
}
|
||||
maven {
|
||||
url = 'https://libraries.minecraft.net/'
|
||||
}
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath group: 'com.github.ImpactDevelopment', name: 'ForgeGradle', version: '3.0.115'
|
||||
classpath group: 'com.github.ImpactDevelopment', name: 'MixinGradle', version: '0.6.2'
|
||||
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.5-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,9 +52,17 @@ import net.minecraftforge.gradle.userdev.tasks.GenerateSRG
|
|||
import net.minecraftforge.gradle.userdev.tasks.RenameJarInPlace
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
def isMCP = false
|
||||
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
if (isMCP) {
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
} else {
|
||||
apply plugin: 'fabric-loom'
|
||||
}
|
||||
|
||||
|
||||
sourceCompatibility = targetCompatibility = '1.8'
|
||||
compileJava {
|
||||
|
@ -54,6 +70,7 @@ compileJava {
|
|||
options.encoding = "UTF-8" // allow emoji in comments :^)
|
||||
}
|
||||
|
||||
|
||||
sourceSets {
|
||||
api {
|
||||
compileClasspath += main.compileClasspath
|
||||
|
@ -83,51 +100,57 @@ task sourceJar(type: Jar, dependsOn: classes) {
|
|||
classifier = 'sources'
|
||||
from sourceSets.api.allSource
|
||||
}
|
||||
if (isMCP) {
|
||||
minecraft {
|
||||
mappings channel: 'snapshot', version: '20201028-1.16.3'
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'snapshot', version: '20200515-1.15.1'
|
||||
if (getProject().hasProperty("baritone.forge_build")) {
|
||||
reobfMappings 'searge'
|
||||
} else {
|
||||
reobfMappings 'notch'
|
||||
}
|
||||
|
||||
if (getProject().hasProperty("baritone.forge_build")) {
|
||||
reobfMappings 'searge'
|
||||
} else {
|
||||
reobfMappings 'notch'
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
source sourceSets.launch
|
||||
|
||||
main 'baritone.launch.LaunchTesting'
|
||||
|
||||
environment 'assetIndex', '{asset_index}'
|
||||
environment 'assetDirectory', downloadAssets.output
|
||||
environment 'nativesDirectory', extractNatives.output
|
||||
|
||||
environment 'tweakClass', 'baritone.launch.BaritoneTweaker'
|
||||
|
||||
if (Os.isFamily(Os.FAMILY_MAC)) {
|
||||
jvmArgs "-XstartOnFirstThread"
|
||||
}
|
||||
}
|
||||
|
||||
autoTest {
|
||||
workingDirectory project.file('autotest')
|
||||
source sourceSets.launch
|
||||
|
||||
main 'baritone.launch.LaunchTesting'
|
||||
|
||||
environment 'assetIndex', '{asset_index}'
|
||||
environment 'assetDirectory', downloadAssets.output
|
||||
environment 'nativesDirectory', extractNatives.output
|
||||
|
||||
environment 'tweakClass', 'baritone.launch.BaritoneTweaker'
|
||||
environment 'BARITONE_AUTO_TEST', 'true'
|
||||
|
||||
if (Os.isFamily(Os.FAMILY_MAC)) {
|
||||
jvmArgs "-XstartOnFirstThread"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
source sourceSets.launch
|
||||
|
||||
main 'baritone.launch.LaunchTesting'
|
||||
|
||||
environment 'assetIndex', '{asset_index}'
|
||||
environment 'assetDirectory', downloadAssets.output
|
||||
environment 'nativesDirectory', extractNatives.output
|
||||
|
||||
environment 'tweakClass', 'baritone.launch.BaritoneTweaker'
|
||||
|
||||
if (Os.isFamily(Os.FAMILY_MAC)) {
|
||||
jvmArgs "-XstartOnFirstThread"
|
||||
}
|
||||
}
|
||||
|
||||
autoTest {
|
||||
workingDirectory project.file('autotest')
|
||||
source sourceSets.launch
|
||||
|
||||
main 'baritone.launch.LaunchTesting'
|
||||
|
||||
environment 'assetIndex', '{asset_index}'
|
||||
environment 'assetDirectory', downloadAssets.output
|
||||
environment 'nativesDirectory', extractNatives.output
|
||||
|
||||
environment 'tweakClass', 'baritone.launch.BaritoneTweaker'
|
||||
environment 'BARITONE_AUTO_TEST', 'true'
|
||||
|
||||
if (Os.isFamily(Os.FAMILY_MAC)) {
|
||||
jvmArgs "-XstartOnFirstThread"
|
||||
}
|
||||
}
|
||||
mixin {
|
||||
defaultObfuscationEnv searge
|
||||
add sourceSets.launch, 'mixins.baritone.refmap.json'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,30 +169,37 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
if (isMCP) {
|
||||
minecraft 'com.github.ImpactDevelopment:Vanilla:1.15.2'
|
||||
|
||||
runtime launchCompile('net.minecraft:launchwrapper:1.12') {
|
||||
exclude module: 'lwjgl'
|
||||
}
|
||||
runtime launchCompile('org.ow2.asm:asm-debug-all:5.2')
|
||||
runtime launchCompile('com.github.ImpactDevelopment:SimpleTweaker:1.2')
|
||||
runtime launchCompile('org.spongepowered:mixin:0.8.+') {
|
||||
// Mixin includes a lot of dependencies that are too up-to-date
|
||||
exclude module: 'launchwrapper'
|
||||
exclude module: 'guava'
|
||||
exclude module: 'gson'
|
||||
exclude module: 'commons-io'
|
||||
exclude module: 'log4j-core'
|
||||
runtime launchCompile('net.minecraft:launchwrapper:1.12') {
|
||||
exclude module: 'lwjgl'
|
||||
}
|
||||
runtime launchCompile('org.ow2.asm:asm-debug-all:5.2')
|
||||
runtime launchCompile('com.github.ImpactDevelopment:SimpleTweaker:1.2')
|
||||
runtime launchCompile('org.spongepowered:mixin:0.8.+') {
|
||||
// Mixin includes a lot of dependencies that are too up-to-date
|
||||
exclude module: 'launchwrapper'
|
||||
exclude module: 'guava'
|
||||
exclude module: 'gson'
|
||||
exclude module: 'commons-io'
|
||||
exclude module: 'log4j-core'
|
||||
}
|
||||
} else {
|
||||
minecraft "com.mojang:minecraft:1.16.4"
|
||||
mappings fileTree(dir: "volderyarn", include: "**.jar")
|
||||
modImplementation "net.fabricmc:fabric-loader:0.9.1+build.205"
|
||||
|
||||
// this makes it compile with the forge tweak stuff
|
||||
implementation 'com.github.ImpactDevelopment:SimpleTweaker:1.2'
|
||||
implementation 'net.minecraft:launchwrapper:1.12'
|
||||
|
||||
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
}
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
}
|
||||
|
||||
mixin {
|
||||
defaultObfuscationEnv searge
|
||||
add sourceSets.launch, 'mixins.baritone.refmap.json'
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.addStringOption('Xwerror', '-quiet') // makes the build fail on travis when there is a javadoc error
|
||||
options.linkSource true
|
||||
|
@ -178,11 +208,34 @@ javadoc {
|
|||
classpath += sourceSets.api.compileClasspath
|
||||
}
|
||||
|
||||
if (!isMCP) {
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
// this fixes some edge cases with special characters not displaying correctly
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
// If Javadoc is generated, this must be specified in that task too.
|
||||
it.options.encoding = "UTF-8"
|
||||
|
||||
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
|
||||
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
|
||||
// We'll use that if it's available, but otherwise we'll use the older option.
|
||||
def targetVersion = 8
|
||||
if (JavaVersion.current().isJava9Compatible()) {
|
||||
it.options.release = targetVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
from sourceSets.launch.output, sourceSets.api.output
|
||||
preserveFileTimestamps = false
|
||||
reproducibleFileOrder = true
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": version
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes(
|
||||
'MixinConfigs': 'mixins.baritone.json',
|
||||
|
@ -204,33 +257,36 @@ File getClientJar() {
|
|||
.get()
|
||||
}
|
||||
|
||||
task copyMcJar(type: Copy) {
|
||||
def mcJar = {getClientJar()}
|
||||
if (isMCP) {
|
||||
task copyMcJar(type: Copy) {
|
||||
def mcJar = {getClientJar()}
|
||||
|
||||
from mcJar
|
||||
into 'build/createMcSrgJar/'
|
||||
rename {'client-srg.jar'}
|
||||
from mcJar
|
||||
into 'build/createMcSrgJar/'
|
||||
rename {'client-srg.jar'}
|
||||
}
|
||||
|
||||
task createSrgMc(type: RenameJarInPlace) {
|
||||
setInput(new File(copyMcJar.getOutputs().getFiles().getSingleFile(), "client-srg.jar"))
|
||||
setClasspath(files({getClientJar()}))
|
||||
|
||||
// fork
|
||||
setMappingType(net.minecraftforge.gradle.common.util.MappingFile.Mapping.SEARGE)
|
||||
setJarTask('trans alaska pipeline')
|
||||
}
|
||||
|
||||
task createSrgMc(type: RenameJarInPlace) {
|
||||
setInput(new File(copyMcJar.getOutputs().getFiles().getSingleFile(), "client-srg.jar"))
|
||||
setClasspath(files({getClientJar()}))
|
||||
project.afterEvaluate {
|
||||
createSrgMc.dependsOn(extractSrg, copyMcJar)
|
||||
createSrgMc.setMappings(extractSrg.getOutput())
|
||||
}
|
||||
|
||||
// fork
|
||||
setMappingType(net.minecraftforge.gradle.common.util.MappingFile.Mapping.SEARGE)
|
||||
setJarTask('trans alaska pipeline')
|
||||
|
||||
task proguard(type: ProguardTask, dependsOn: createSrgMc) { // TODO: dont need to create srg mc if doing notch build
|
||||
url 'https://downloads.sourceforge.net/project/proguard/proguard/6.0/proguard6.0.3.zip'
|
||||
extract 'proguard6.0.3/lib/proguard.jar'
|
||||
}
|
||||
|
||||
task createDist(type: CreateDistTask, dependsOn: proguard)
|
||||
|
||||
build.finalizedBy(createDist)
|
||||
}
|
||||
project.afterEvaluate {
|
||||
createSrgMc.dependsOn(extractSrg, copyMcJar)
|
||||
createSrgMc.setMappings(extractSrg.getOutput())
|
||||
}
|
||||
|
||||
|
||||
task proguard(type: ProguardTask, dependsOn: createSrgMc) { // TODO: dont need to create srg mc if doing notch build
|
||||
url 'https://downloads.sourceforge.net/project/proguard/proguard/6.0/proguard6.0.3.zip'
|
||||
extract 'proguard6.0.3/lib/proguard.jar'
|
||||
}
|
||||
|
||||
task createDist(type: CreateDistTask, dependsOn: proguard)
|
||||
|
||||
build.finalizedBy(createDist)
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "baritone",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "Baritone",
|
||||
"description": "Google Maps for Blockgame",
|
||||
"authors": [
|
||||
"people"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://github.com/cabaletta/baritone",
|
||||
"sources": "https://github.com/cabaletta/baritone"
|
||||
},
|
||||
|
||||
"license": "LGPL-3.0",
|
||||
"icon": "assets/modid/icon.png",
|
||||
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
},
|
||||
"mixins": [
|
||||
"mixins.baritone.json"
|
||||
],
|
||||
|
||||
"depends": {
|
||||
"fabricloader": ">=0.7.4",
|
||||
"minecraft": "1.16.x"
|
||||
},
|
||||
"suggests": {
|
||||
"another-mod": "*"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
Reference in New Issue