Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf.
This commit is contained in:
parent
0d3d03ab83
commit
c33cd0d9ea
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue