Fix problem which meant runtime deobf to MCP names wasn't working. SRG named mods located in the mods dir of a dev

environment will now load normally.
This commit is contained in:
cpw 2016-01-13 00:26:08 -05:00
parent 17db34ae31
commit 9a737b0c90
2 changed files with 7 additions and 5 deletions

View File

@ -124,10 +124,12 @@ public class FMLDeobfuscatingRemapper extends Remapper {
LZMAInputSupplier zis = new LZMAInputSupplier(classData);
CharSource srgSource = zis.asCharSource(Charsets.UTF_8);
srgList = srgSource.readLines();
FMLRelaunchLog.fine("Loading deobfuscation resource %s with %d records", deobfFileName, srgList.size());
}
else
{
srgList = Files.readLines(new File(gradleStartProp), Charsets.UTF_8);
FMLRelaunchLog.fine("Loading deobfuscation resource %s with %d records", gradleStartProp, srgList.size());
}
rawMethodMaps = Maps.newHashMap();
@ -179,7 +181,10 @@ public class FMLDeobfuscatingRemapper extends Remapper {
{
rawFieldMaps.put(cl, Maps.<String,String>newHashMap());
}
rawFieldMaps.get(cl).put(oldName + ":" + getFieldType(cl, oldName), newName);
String fieldType = getFieldType(cl, oldName);
// We might be in mcp named land, where in fact the name is "new"
if (fieldType == null) fieldType = getFieldType(cl, newName);
rawFieldMaps.get(cl).put(oldName + ":" + fieldType, newName);
rawFieldMaps.get(cl).put(oldName + ":null", newName);
}

View File

@ -21,10 +21,7 @@ public class FMLDeobfTweaker implements ITweaker {
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
// Deobfuscation transformer, always last, and the access transformer tweaker as well
if (!(Boolean)Launch.blackboard.get("fml.deobfuscatedEnvironment"))
{
classLoader.registerTransformer("net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer");
}
classLoader.registerTransformer("net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer");
// Add all the access transformers now as well
for (String transformer : CoreModManager.getAccessTransformers())
{