Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf.

This commit is contained in:
Christian 2013-03-09 17:19:48 -05:00
parent 0d3d03ab83
commit c33cd0d9ea

View file

@ -14,6 +14,8 @@ package cpw.mods.fml.relauncher;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
/**
* Some reflection helper code.
*
@ -73,9 +75,10 @@ public class ReflectionHelper
Exception failed = null;
for (String fieldName : fieldNames)
{
String remappedField = FMLDeobfuscatingRemapper.INSTANCE.mapFieldName(clazz.getName().replace('.', '/'), fieldName, null);
try
{
Field f = clazz.getDeclaredField(fieldName);
Field f = clazz.getDeclaredField(remappedField);
f.setAccessible(true);
return f;
}