content: package net.optifine.reflect;
  
  import net.minecraft.client.Minecraft;
  import net.minecraft.client.gui.GuiEnchantment;
  import net.minecraft.client.gui.GuiHopper;
  import net.minecraft.client.gui.GuiMainMenu;
  import net.minecraft.client.gui.inventory.GuiBeacon;
  import net.minecraft.client.gui.inventory.GuiBrewingStand;
  import net.minecraft.client.gui.inventory.GuiChest;
  import net.minecraft.client.gui.inventory.GuiFurnace;
  import net.minecraft.client.model.*;
  import net.minecraft.client.multiplayer.ChunkProviderClient;
  import net.minecraft.client.renderer.block.model.ModelBlock;
  import net.minecraft.client.renderer.entity.RenderBoat;
  import net.minecraft.client.renderer.entity.RenderLeashKnot;
  import net.minecraft.client.renderer.entity.RenderMinecart;
  import net.minecraft.client.renderer.tileentity.*;
  import net.minecraft.client.resources.DefaultResourcePack;
  import net.minecraft.entity.passive.EntityVillager;
  import net.minecraft.inventory.IInventory;
  import net.minecraft.inventory.InventoryBasic;
  import net.minecraft.tileentity.TileEntityBeacon;
  import net.minecraft.tileentity.TileEntityBrewingStand;
  import net.minecraft.tileentity.TileEntityEnchantmentTable;
  import net.minecraft.tileentity.TileEntityFurnace;
  import net.minecraft.util.LongHashMap;
  import net.minecraft.util.ResourceLocation;
  import net.minecraft.world.IWorldNameable;
  import net.optifine.Log;
  import net.optifine.util.ArrayUtils;
  import org.apache.logging.log4j.LogManager;
  import org.apache.logging.log4j.Logger;
  
  import java.lang.reflect.Constructor;
  import java.lang.reflect.Field;
  import java.lang.reflect.InvocationTargetException;
  import java.lang.reflect.Method;
  import java.util.Map;
  
  public class Reflector {
      private static final Logger LOGGER = LogManager.getLogger();
      private static final boolean logVanilla = logEntry("*** Reflector Vanilla ***");
      public static ReflectorClass ChunkProviderClient = new ReflectorClass(ChunkProviderClient.class);
      public static ReflectorField ChunkProviderClient_chunkMapping = new ReflectorField(ChunkProviderClient, LongHashMap.class);
      public static ReflectorClass EntityVillager = new ReflectorClass(EntityVillager.class);
      public static ReflectorField EntityVillager_careerId = new ReflectorField(new FieldLocatorTypes(EntityVillager.class, new Class[0], Integer.TYPE, new Class[]{Integer.TYPE, Boolean.TYPE, Boolean.TYPE, InventoryBasic.class}, "EntityVillager.careerId"));
      public static ReflectorField EntityVillager_careerLevel = new ReflectorField(new FieldLocatorTypes(EntityVillager.class, new Class[]{Integer.TYPE}, Integer.TYPE, new Class[]{Boolean.TYPE, Boolean.TYPE, InventoryBasic.class}, "EntityVillager.careerLevel"));
      public static ReflectorClass GuiBeacon = new ReflectorClass(GuiBeacon.class);
      public static ReflectorField GuiBeacon_tileBeacon = new ReflectorField(GuiBeacon, IInventory.class);
      public static ReflectorClass GuiBrewingStand = new ReflectorClass(GuiBrewingStand.class);
      public static ReflectorField GuiBrewingStand_tileBrewingStand = new ReflectorField(GuiBrewingStand, IInventory.class);
      public static ReflectorClass GuiChest = new ReflectorClass(GuiChest.class);
      public static ReflectorField GuiChest_lowerChestInventory = new ReflectorField(GuiChest, IInventory.class, 1);
      public static ReflectorClass GuiEnchantment = new ReflectorClass(GuiEnchantment.class);
      public static ReflectorField GuiEnchantment_nameable = new ReflectorField(GuiEnchantment, IWorldNameable.class);
      public static ReflectorClass GuiFurnace = new ReflectorClass(GuiFurnace.class);
      public static ReflectorField GuiFurnace_tileFurnace = new ReflectorField(GuiFurnace, IInventory.class);
      public static ReflectorClass GuiHopper = new ReflectorClass(GuiHopper.class);
      public static ReflectorField GuiHopper_hopperInventory = new ReflectorField(GuiHopper, IInventory.class, 1);
      public static ReflectorClass GuiMainMenu = new ReflectorClass(GuiMainMenu.class);
      public static ReflectorField GuiMainMenu_splashText = new ReflectorField(GuiMainMenu, String.class);
      public static ReflectorClass Minecraft = new ReflectorClass(Minecraft.class);
      public static ReflectorField Minecraft_defaultResourcePack = new ReflectorField(Minecraft, DefaultResourcePack.class);
      public static ReflectorClass ModelHumanoidHead = new ReflectorClass(ModelHumanoidHead.class);
      public static ReflectorField ModelHumanoidHead_head = new ReflectorField(ModelHumanoidHead, ModelRenderer.class);
      public static ReflectorClass ModelBat = new ReflectorClass(ModelBat.class);
      public static ReflectorFields ModelBat_ModelRenderers = new ReflectorFields(ModelBat, ModelRenderer.class, 6);
      public static ReflectorClass ModelBlaze = new ReflectorClass(ModelBlaze.class);
      public static ReflectorField ModelBlaze_blazeHead = new ReflectorField(ModelBlaze, ModelRenderer.class);
      public static ReflectorField ModelBlaze_blazeSticks = new ReflectorField(ModelBlaze, ModelRenderer[].class);
      public static ReflectorClass ModelBlock = new ReflectorClass(ModelBlock.class);
      public static ReflectorField ModelBlock_parentLocation = new ReflectorField(ModelBlock, ResourceLocation.class);
      public static ReflectorField ModelBlock_textures = new ReflectorField(ModelBlock, Map.class);
      public static ReflectorClass ModelDragon = new ReflectorClass(ModelDragon.class);
      public static ReflectorFields ModelDragon_ModelRenderers = new ReflectorFields(ModelDragon, ModelRenderer.class, 12);
      public static ReflectorClass ModelEnderCrystal = new ReflectorClass(ModelEnderCrystal.class);
      public static ReflectorFields ModelEnderCrystal_ModelRenderers = new ReflectorFields(ModelEnderCrystal, ModelRenderer.class, 3);
      public static ReflectorClass RenderEnderCrystal = new ReflectorClass(RenderEnderCrystal.class);
      public static ReflectorField RenderEnderCrystal_modelEnderCrystal = new ReflectorField(RenderEnderCrystal, ModelBase.class, 0);
      public static ReflectorClass ModelEnderMite = new ReflectorClass(ModelEnderMite.class);
      public static ReflectorField ModelEnderMite_bodyParts = new ReflectorField(ModelEnderMite, ModelRenderer[].class);
      public static ReflectorClass ModelGhast = new ReflectorClass(ModelGhast.class);
      public static ReflectorField ModelGhast_body = new ReflectorField(ModelGhast, ModelRenderer.class);
      public static ReflectorField ModelGhast_tentacles = new ReflectorField(ModelGhast, ModelRenderer[].class);
      public static ReflectorClass ModelGuardian = new ReflectorClass(ModelGuardian.class);
      public static ReflectorField ModelGuardian_body = new ReflectorField(ModelGuardian, ModelRenderer.class, 0);
      public static ReflectorField ModelGuardian_eye = new ReflectorField(ModelGuardian, ModelRenderer.class, 1);
      public static ReflectorField ModelGuardian_spines = new ReflectorField(ModelGuardian, ModelRenderer[].class, 0);
      public static ReflectorField ModelGuardian_tail = new ReflectorField(ModelGuardian, ModelRenderer[].class, 1);
      public static ReflectorClass ModelHorse = new ReflectorClass(ModelHorse.class);
      public static ReflectorFields ModelHorse_ModelRenderers = new ReflectorFields(ModelHorse, ModelRenderer.class, 39);
      public static ReflectorClass RenderLeashKnot = new ReflectorClass(RenderLeashKnot.class);
      public static ReflectorField RenderLeashKnot_leashKnotModel = new ReflectorField(RenderLeashKnot, ModelLeashKnot.class);
      public static ReflectorClass ModelMagmaCube = new ReflectorClass(ModelMagmaCube.class);
      public static ReflectorField ModelMagmaCube_core = new ReflectorField(ModelMagmaCube, ModelRenderer.class);
      public static ReflectorField ModelMagmaCube_segments = new ReflectorField(ModelMagmaCube, ModelRenderer[].class);
      public static ReflectorClass ModelOcelot = new ReflectorClass(ModelOcelot.class);
      public static ReflectorFields ModelOcelot_ModelRenderers = new ReflectorFields(ModelOcelot, ModelRenderer.class, 8);
      public static ReflectorClass ModelRabbit = new ReflectorClass(ModelRabbit.class);
      public static ReflectorFields ModelRabbit_renderers = new ReflectorFields(ModelRabbit, ModelRenderer.class, 12);
      public static ReflectorClass ModelSilverfish = new ReflectorClass(ModelSilverfish.class);
      public static ReflectorField ModelSilverfish_bodyParts = new ReflectorField(ModelSilverfish, ModelRenderer[].class, 0);
      public static ReflectorField ModelSilverfish_wingParts = new ReflectorField(ModelSilverfish, ModelRenderer[].class, 1);
      public static ReflectorClass ModelSlime = new ReflectorClass(ModelSlime.class);
      public static ReflectorFields ModelSlime_ModelRenderers = new ReflectorFields(ModelSlime, ModelRenderer.class, 4);
      public static ReflectorClass ModelSquid = new ReflectorClass(ModelSquid.class);
      public static ReflectorField ModelSquid_body = new ReflectorField(ModelSquid, ModelRenderer.class);
      public static ReflectorField ModelSquid_tentacles = new ReflectorField(ModelSquid, ModelRenderer[].class);
      public static ReflectorClass ModelWitch = new ReflectorClass(ModelWitch.class);
      public static ReflectorField ModelWitch_mole = new ReflectorField(ModelWitch, ModelRenderer.class, 0);
      public static ReflectorField ModelWitch_hat = new ReflectorField(ModelWitch, ModelRenderer.class, 1);
      public static ReflectorClass ModelWither = new ReflectorClass(ModelWither.class);
      public static ReflectorField ModelWither_bodyParts = new ReflectorField(ModelWither, ModelRenderer[].class, 0);
      public static ReflectorField ModelWither_heads = new ReflectorField(ModelWither, ModelRenderer[].class, 1);
      public static ReflectorClass ModelWolf = new ReflectorClass(ModelWolf.class);
      public static ReflectorField ModelWolf_tail = new ReflectorField(ModelWolf, ModelRenderer.class, 6);
      public static ReflectorField ModelWolf_mane = new ReflectorField(ModelWolf, ModelRenderer.class, 7);
      public static ReflectorClass RenderBoat = new ReflectorClass(RenderBoat.class);
      public static ReflectorField RenderBoat_modelBoat = new ReflectorField(RenderBoat, ModelBase.class);
      public static ReflectorClass RenderMinecart = new ReflectorClass(RenderMinecart.class);
      public static ReflectorField RenderMinecart_modelMinecart = new ReflectorField(RenderMinecart, ModelBase.class);
      public static ReflectorClass RenderWitherSkull = new ReflectorClass(RenderWitherSkull.class);
      public static ReflectorField RenderWitherSkull_model = new ReflectorField(RenderWitherSkull, ModelSkeletonHead.class);
      public static ReflectorClass TileEntityBannerRenderer = new ReflectorClass(TileEntityBannerRenderer.class);
      public static ReflectorField TileEntityBannerRenderer_bannerModel = new ReflectorField(TileEntityBannerRenderer, ModelBanner.class);
      public static ReflectorClass TileEntityBeacon = new ReflectorClass(TileEntityBeacon.class);
      public static ReflectorField TileEntityBeacon_customName = new ReflectorField(TileEntityBeacon, String.class);
      public static ReflectorClass TileEntityBrewingStand = new ReflectorClass(TileEntityBrewingStand.class);
      public static ReflectorField TileEntityBrewingStand_customName = new ReflectorField(TileEntityBrewingStand, String.class);
      public static ReflectorClass TileEntityChestRenderer = new ReflectorClass(TileEntityChestRenderer.class);
      public static ReflectorField TileEntityChestRenderer_simpleChest = new ReflectorField(TileEntityChestRenderer, ModelChest.class, 0);
      public static ReflectorField TileEntityChestRenderer_largeChest = new ReflectorField(TileEntityChestRenderer, ModelChest.class, 1);
      public static ReflectorClass TileEntityEnchantmentTable = new ReflectorClass(TileEntityEnchantmentTable.class);
      public static ReflectorField TileEntityEnchantmentTable_customName = new ReflectorField(TileEntityEnchantmentTable, String.class);
      public static ReflectorClass TileEntityEnchantmentTableRenderer = new ReflectorClass(TileEntityEnchantmentTableRenderer.class);
      public static ReflectorField TileEntityEnchantmentTableRenderer_modelBook = new ReflectorField(TileEntityEnchantmentTableRenderer, ModelBook.class);
      public static ReflectorClass TileEntityEnderChestRenderer = new ReflectorClass(TileEntityEnderChestRenderer.class);
      public static ReflectorField TileEntityEnderChestRenderer_modelChest = new ReflectorField(TileEntityEnderChestRenderer, ModelChest.class);
      public static ReflectorClass TileEntityFurnace = new ReflectorClass(TileEntityFurnace.class);
      public static ReflectorField TileEntityFurnace_customName = new ReflectorField(TileEntityFurnace, String.class);
      public static ReflectorClass TileEntitySignRenderer = new ReflectorClass(TileEntitySignRenderer.class);
      public static ReflectorField TileEntitySignRenderer_model = new ReflectorField(TileEntitySignRenderer, ModelSign.class);
      public static ReflectorClass TileEntitySkullRenderer = new ReflectorClass(TileEntitySkullRenderer.class);
      public static ReflectorField TileEntitySkullRenderer_skeletonHead = new ReflectorField(TileEntitySkullRenderer, ModelSkeletonHead.class, 0);
      public static ReflectorField TileEntitySkullRenderer_humanoidHead = new ReflectorField(TileEntitySkullRenderer, ModelSkeletonHead.class, 1);
  
      public static Object r, s;
  
      public static void callVoid(ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return;
              }
  
              method.invoke(null, params);
          } catch (Throwable throwable) {
              handleException(throwable, null, refMethod, params);
          }
      }
  
      public static boolean callBoolean(ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return false;
              } else {
                  Boolean obool = (Boolean) method.invoke(null, params);
                  return obool.booleanValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, null, refMethod, params);
              return false;
          }
      }
  
      public static int callInt(ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return 0;
              } else {
                  Integer integer = (Integer) method.invoke(null, params);
                  return integer.intValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, null, refMethod, params);
              return 0;
          }
      }
  
      public static float callFloat(ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return 0.0F;
              } else {
                  Float f = (Float) method.invoke(null, params);
                  return f.floatValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, null, refMethod, params);
              return 0.0F;
          }
      }
  
      public static double callDouble(ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return 0.0D;
              } else {
                  Double d0 = (Double) method.invoke(null, params);
                  return d0.doubleValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, null, refMethod, params);
              return 0.0D;
          }
      }
  
      public static String callString(ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return null;
              } else {
                  String s = (String) method.invoke(null, params);
                  return s;
              }
          } catch (Throwable throwable) {
              handleException(throwable, null, refMethod, params);
              return null;
          }
      }
  
      public static Object call(ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return null;
              } else {
                  Object object = method.invoke(null, params);
                  return object;
              }
          } catch (Throwable throwable) {
              handleException(throwable, null, refMethod, params);
              return null;
          }
      }
  
      public static void callVoid(Object obj, ReflectorMethod refMethod, Object... params) {
          try {
              if (obj == null) {
                  return;
              }
  
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return;
              }
  
              method.invoke(obj, params);
          } catch (Throwable throwable) {
              handleException(throwable, obj, refMethod, params);
          }
      }
  
      public static boolean callBoolean(Object obj, ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return false;
              } else {
                  Boolean obool = (Boolean) method.invoke(obj, params);
                  return obool.booleanValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, obj, refMethod, params);
              return false;
          }
      }
  
      public static int callInt(Object obj, ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return 0;
              } else {
                  Integer integer = (Integer) method.invoke(obj, params);
                  return integer.intValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, obj, refMethod, params);
              return 0;
          }
      }
  
      public static float callFloat(Object obj, ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return 0.0F;
              } else {
                  Float f = (Float) method.invoke(obj, params);
                  return f.floatValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, obj, refMethod, params);
              return 0.0F;
          }
      }
  
      public static double callDouble(Object obj, ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return 0.0D;
              } else {
                  Double d0 = (Double) method.invoke(obj, params);
                  return d0.doubleValue();
              }
          } catch (Throwable throwable) {
              handleException(throwable, obj, refMethod, params);
              return 0.0D;
          }
      }
  
      public static String callString(Object obj, ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return null;
              } else {
                  String s = (String) method.invoke(obj, params);
                  return s;
              }
          } catch (Throwable throwable) {
              handleException(throwable, obj, refMethod, params);
              return null;
          }
      }
  
      public static Object call(Object obj, ReflectorMethod refMethod, Object... params) {
          try {
              Method method = refMethod.getTargetMethod();
  
              if (method == null) {
                  return null;
              } else {
                  Object object = method.invoke(obj, params);
                  return object;
              }
          } catch (Throwable throwable) {
              handleException(throwable, obj, refMethod, params);
              return null;
          }
      }
  
      public static Object getFieldValue(ReflectorField refField) {
          return getFieldValue(null, refField);
      }
  
      public static Object getFieldValue(Object obj, ReflectorField refField) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return null;
              } else {
                  Object object = field.get(obj);
                  return object;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return null;
          }
      }
  
      public static boolean getFieldValueBoolean(ReflectorField refField, boolean def) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return def;
              } else {
                  boolean flag = field.getBoolean(null);
                  return flag;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return def;
          }
      }
  
      public static boolean getFieldValueBoolean(Object obj, ReflectorField refField, boolean def) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return def;
              } else {
                  boolean flag = field.getBoolean(obj);
                  return flag;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return def;
          }
      }
  
      public static Object getFieldValue(ReflectorFields refFields, int index) {
          ReflectorField reflectorfield = refFields.getReflectorField(index);
          return reflectorfield == null ? null : getFieldValue(reflectorfield);
      }
  
      public static Object getFieldValue(Object obj, ReflectorFields refFields, int index) {
          ReflectorField reflectorfield = refFields.getReflectorField(index);
          return reflectorfield == null ? null : getFieldValue(obj, reflectorfield);
      }
  
      public static float getFieldValueFloat(Object obj, ReflectorField refField, float def) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return def;
              } else {
                  float f = field.getFloat(obj);
                  return f;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return def;
          }
      }
  
      public static int getFieldValueInt(Object obj, ReflectorField refField, int def) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return def;
              } else {
                  int i = field.getInt(obj);
                  return i;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return def;
          }
      }
  
      public static long getFieldValueLong(Object obj, ReflectorField refField, long def) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return def;
              } else {
                  long i = field.getLong(obj);
                  return i;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return def;
          }
      }
  
      public static boolean setFieldValue(ReflectorField refField, Object value) {
          return setFieldValue(null, refField, value);
      }
  
      public static boolean setFieldValue(Object obj, ReflectorField refField, Object value) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return false;
              } else {
                  field.set(obj, value);
                  return true;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return false;
          }
      }
  
      public static boolean setFieldValueInt(ReflectorField refField, int value) {
          return setFieldValueInt(null, refField, value);
      }
  
      public static boolean setFieldValueInt(Object obj, ReflectorField refField, int value) {
          try {
              Field field = refField.getTargetField();
  
              if (field == null) {
                  return false;
              } else {
                  field.setInt(obj, value);
                  return true;
              }
          } catch (Throwable throwable) {
              Log.error("", throwable);
              return false;
          }
      }
  
      public static Object newInstance(ReflectorConstructor constr, Object... params) {
          Constructor constructor = constr.getTargetConstructor();
  
          if (constructor == null) {
              return null;
          } else {
              try {
                  Object object = constructor.newInstance(params);
                  return object;
              } catch (Throwable throwable) {
                  handleException(throwable, constr, params);
                  return null;
              }
          }
      }
  
      public static boolean matchesTypes(Class[] pTypes, Class[] cTypes) {
          if (pTypes.length != cTypes.length) {
              return false;
          } else {
              for (int i = 0; i < cTypes.length; ++i) {
                  Class oclass = pTypes[i];
                  Class oclass1 = cTypes[i];
  
                  if (oclass != oclass1) {
                      return false;
                  }
              }
  
              return true;
          }
      }
  
      private static void dbgCall(boolean isStatic, String callType, ReflectorMethod refMethod, Object[] params, Object retVal) {
          String s = refMethod.getTargetMethod().getDeclaringClass().getName();
          String s1 = refMethod.getTargetMethod().getName();
          String s2 = "";
  
          if (isStatic) {
              s2 = " static";
          }
  
          Log.dbg(callType + s2 + " " + s + "." + s1 + "(" + ArrayUtils.arrayToString(params) + ") => " + retVal);
      }
  
      private static void dbgCallVoid(boolean isStatic, String callType, ReflectorMethod refMethod, Object[] params) {
          String s = refMethod.getTargetMethod().getDeclaringClass().getName();
          String s1 = refMethod.getTargetMethod().getName();
          String s2 = "";
  
          if (isStatic) {
              s2 = " static";
          }
  
          Log.dbg(callType + s2 + " " + s + "." + s1 + "(" + ArrayUtils.arrayToString(params) + ")");
      }
  
      private static void dbgFieldValue(boolean isStatic, String accessType, ReflectorField refField, Object val) {
          String s = refField.getTargetField().getDeclaringClass().getName();
          String s1 = refField.getTargetField().getName();
          String s2 = "";
  
          if (isStatic) {
              s2 = " static";
          }
  
          Log.dbg(accessType + s2 + " " + s + "." + s1 + " => " + val);
      }
  
      private static void handleException(Throwable e, Object obj, ReflectorMethod refMethod, Object[] params) {
          if (e instanceof InvocationTargetException) {
              Throwable throwable = e.getCause();
  
              if (throwable instanceof RuntimeException) {
                  RuntimeException runtimeexception = (RuntimeException) throwable;
                  throw runtimeexception;
              } else {
                  Log.error("", e);
              }
          } else {
              Log.warn("*** Exception outside of method ***");
              Log.warn("Method deactivated: " + refMethod.getTargetMethod());
              refMethod.deactivate();
  
              if (e instanceof IllegalArgumentException) {
                  Log.warn("*** IllegalArgumentException ***");
                  Log.warn("Method: " + refMethod.getTargetMethod());
                  Log.warn("Object: " + obj);
                  Log.warn("Parameter classes: " + ArrayUtils.arrayToString(getClasses(params)));
                  Log.warn("Parameters: " + ArrayUtils.arrayToString(params));
              }
  
              Log.warn("", e);
          }
      }
  
      private static void handleException(Throwable e, ReflectorConstructor refConstr, Object[] params) {
          if (e instanceof InvocationTargetException) {
              Log.error("", e);
          } else {
              Log.warn("*** Exception outside of constructor ***");
              Log.warn("Constructor deactivated: " + refConstr.getTargetConstructor());
              refConstr.deactivate();
  
              if (e instanceof IllegalArgumentException) {
                  Log.warn("*** IllegalArgumentException ***");
                  Log.warn("Constructor: " + refConstr.getTargetConstructor());
                  Log.warn("Parameter classes: " + ArrayUtils.arrayToString(getClasses(params)));
                  Log.warn("Parameters: " + ArrayUtils.arrayToString(params));
              }
  
              Log.warn("", e);
          }
      }
  
      private static Object[] getClasses(Object[] objs) {
          if (objs == null) {
              return new Class[0];
          } else {
              Class[] aclass = new Class[objs.length];
  
              for (int i = 0; i < aclass.length; ++i) {
                  Object object = objs[i];
  
                  if (object != null) {
                      aclass[i] = object.getClass();
                  }
              }
  
              return aclass;
          }
      }
  
      private static ReflectorField[] getReflectorFields(ReflectorClass parentClass, Class fieldType, int count) {
          ReflectorField[] areflectorfield = new ReflectorField[count];
  
          for (int i = 0; i < areflectorfield.length; ++i) {
              areflectorfield[i] = new ReflectorField(parentClass, fieldType, i);
          }
  
          return areflectorfield;
      }
  
      private static boolean logEntry(String str) {
          LOGGER.info("[OptiFine] " + str);
          return true;
      }
  
      private static boolean registerResolvable(final String str) {
          IResolvable iresolvable = new IResolvable() {
              public void resolve() {
                  Reflector.LOGGER.info("[OptiFine] " + str);
              }
          };
          ReflectorResolver.register(iresolvable);
          return true;
      }
  }
  