Advertisement
Corosus

Untitled

Apr 24th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. public static Object getPrivateValue(Class var0, Object var1, int var2) throws IllegalArgumentException, SecurityException, NoSuchFieldException
  2.     {
  3.         try
  4.         {
  5.             Field var3 = var0.getDeclaredFields()[var2];
  6.             var3.setAccessible(true);
  7.             return var3.get(var1);
  8.         }
  9.         catch (IllegalAccessException var4)
  10.         {
  11.             logger.throwing("ModLoader", "getPrivateValue", var4);
  12.             throwException("An impossible error has occured!", var4);
  13.             return null;
  14.         }
  15.     }
  16.  
  17.     public static Object getPrivateValue(Class var0, Object var1, String var2) throws IllegalArgumentException, SecurityException, NoSuchFieldException
  18.     {
  19.         try
  20.         {
  21.             Field var3 = var0.getDeclaredField(var2);
  22.             var3.setAccessible(true);
  23.             return var3.get(var1);
  24.         }
  25.         catch (IllegalAccessException var4)
  26.         {
  27.             logger.throwing("ModLoader", "getPrivateValue", var4);
  28.             throwException("An impossible error has occured!", var4);
  29.             return null;
  30.         }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement