Merge extra and data jars. As Log4j has issues with it's config being in a different jar then the custom logger.

This commit is contained in:
LexManos 2019-02-21 04:24:39 -08:00
parent 329f26ee20
commit b7f6fbcfcb
3 changed files with 13 additions and 16 deletions

View File

@ -493,7 +493,7 @@ project(':forge') {
ext {
output = file('build/install_profile.json')
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.0.3'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.0.4'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.0'
}
doFirst {
ext.BIN_PATCHER = 'net.minecraftforge:binarypatcher:' + genClientBinPatches.resolvedVersion
@ -544,14 +544,6 @@ project(':forge') {
client: "'${sha1(tasks.getByName('downloadClientSlim').output)}'",
server: "'${sha1(tasks.getByName('downloadServerSlim').output)}'"
],
MC_DATA: [
client: "[net.minecraft:client:${MC_VERSION}:data]",
server: "[net.minecraft:server:${MC_VERSION}:data]"
],
MC_DATA_SHA: [
client: "'${sha1(tasks.getByName('downloadClientData').output)}'",
server: "'${sha1(tasks.getByName('downloadServerData').output)}'"
],
MC_EXTRA: [
client: "[net.minecraft:client:${MC_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}:extra]"
@ -589,13 +581,11 @@ project(':forge') {
args: [
'--input', '{MINECRAFT_JAR}',
'--slim', '{MC_SLIM}',
'--data', '{MC_DATA}',
'--extra', '{MC_EXTRA}',
'--srg', '{MAPPINGS}'
],
outputs: [
'{MC_SLIM}': '{MC_SLIM_SHA}',
'{MC_DATA}': '{MC_DATA_SHA}',
'{MC_EXTRA}': '{MC_EXTRA_SHA}'
]
], [ // SpecialSource has a bug where it won't create the nessasary directories, remove when they fix that.
@ -635,7 +625,7 @@ project(':forge') {
}
['client', 'server'].each { side ->
['slim', 'extra', 'data'].each { type ->
['slim', 'extra'].each { type ->
def name = "download${side.capitalize()}${type.capitalize()}"
task "${name}"(type: DownloadMavenArtifact) {
artifact = "net.minecraft:${side}:${MC_VERSION}:${type}"
@ -897,6 +887,8 @@ project(':forge') {
setSources sourceSets.userdev.java.srcDirs.findAll({f -> (f != patcher.patchedSrc) })
}
tasks.eclipse.dependsOn('genEclipseRuns')
publishing {
publications {
mavenJava(MavenPublication) {

View File

@ -81,13 +81,11 @@ public class LibraryFinder {
static Path[] getMCPaths(final String mcVersion, final String mcpVersion, final String forgeVersion, final String forgeGroup, final String type) {
Path srgMcPath = findLibsPath().resolve(MavenCoordinateResolver.get("net.minecraft", type, "", "srg", mcVersion+"-"+mcpVersion));
Path mcDataPath = findLibsPath().resolve(MavenCoordinateResolver.get("net.minecraft", type, "", "data", mcVersion));
Path mcExtrasPath = findLibsPath().resolve(MavenCoordinateResolver.get("net.minecraft", type, "", "extra", mcVersion));
Path patchedBinariesPath = findLibsPath().resolve(MavenCoordinateResolver.get(forgeGroup, "forge", "", type, mcVersion+"-"+forgeVersion));
LOGGER.debug(CORE,"SRG MC at {} is {}", srgMcPath.toString(), pathStatus(srgMcPath));
LOGGER.debug(CORE,"MC Data at {} is {}", mcDataPath.toString(), pathStatus(mcDataPath));
LOGGER.debug(CORE,"MC Extras at {} is {}", mcExtrasPath.toString(), pathStatus(mcExtrasPath));
LOGGER.debug(CORE,"Forge patches at {} is {}", patchedBinariesPath.toString(), pathStatus(patchedBinariesPath));
return new Path[] { patchedBinariesPath, mcDataPath, mcExtrasPath, srgMcPath };
return new Path[] { patchedBinariesPath, mcExtrasPath, srgMcPath };
}
}

View File

@ -32,6 +32,7 @@ import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
@ -79,7 +80,13 @@ public class ConfigTracker {
}
public List<Pair<String, FMLHandshakeMessages.S2CConfigData>> syncConfigs() {
final Map<String, byte[]> configData = configSets.get(ModConfig.Type.SERVER).stream().collect(Collectors.toMap(ModConfig::getFileName, rethrowFunction(mc -> Files.readAllBytes(mc.getFullPath()))));
final Map<String, byte[]> configData = configSets.get(ModConfig.Type.SERVER).stream().collect(Collectors.toMap(ModConfig::getFileName, mc -> { //TODO: Test cpw's LambdaExceptionUtils on Oracle javac.
try {
return Files.readAllBytes(mc.getFullPath());
} catch (IOException e) {
throw new RuntimeException(e);
}
}));
return configData.entrySet().stream().map(e->Pair.of("Config "+e.getKey(), new FMLHandshakeMessages.S2CConfigData(e.getKey(), e.getValue()))).collect(Collectors.toList());
}