| 17 | import net.minecraft.world.storage.MapData; |
| 18 | |
| 19 | public class ReflectorForge |
| 20 | { |
| 21 | public static Object EVENT_RESULT_ALLOW = Reflector.getFieldValue(Reflector.Event_Result_ALLOW); |
| 22 | public static Object EVENT_RESULT_DENY = Reflector.getFieldValue(Reflector.Event_Result_DENY); |
| 23 | public static Object EVENT_RESULT_DEFAULT = Reflector.getFieldValue(Reflector.Event_Result_DEFAULT); |
| 24 | |
| 25 | public static void FMLClientHandler_trackBrokenTexture(ResourceLocation loc, String message) |
| 26 | { |
| 27 | if (!Reflector.FMLClientHandler_trackBrokenTexture.exists()) |
| 28 | { |
| 29 | Object object = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); |
| 30 | Reflector.call(object, Reflector.FMLClientHandler_trackBrokenTexture, new Object[] {loc, message}); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | public static void FMLClientHandler_trackMissingTexture(ResourceLocation loc) |
| 35 | { |
| 36 | if (!Reflector.FMLClientHandler_trackMissingTexture.exists()) |
| 37 | { |
| 38 | Object object = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); |
| 39 | Reflector.call(object, Reflector.FMLClientHandler_trackMissingTexture, new Object[] {loc}); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | public static void putLaunchBlackboard(String key, Object value) |
| 44 | { |
| 45 | Map map = (Map)Reflector.getFieldValue(Reflector.Launch_blackboard); |
| 46 | |
| 47 | if (map != null) |
| 48 | { |
| 49 | map.put(key, value); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | public static boolean renderFirstPersonHand(RenderGlobal renderGlobal, float partialTicks, int pass) |
| 54 | { |
| 55 | return !Reflector.ForgeHooksClient_renderFirstPersonHand.exists() ? false : Reflector.callBoolean(Reflector.ForgeHooksClient_renderFirstPersonHand, new Object[] {renderGlobal, Float.valueOf(partialTicks), Integer.valueOf(pass)}); |
| 56 | } |
| 57 | |
| 58 | public static InputStream getOptiFineResourceStream(String path) |
| 59 | { |
| 60 | if (!Reflector.OptiFineClassTransformer_instance.exists()) |
| 61 | { |
| 62 | return null; |
| 63 | } |
| 64 | else |
| 65 | { |
| 66 | Object object = Reflector.getFieldValue(Reflector.OptiFineClassTransformer_instance); |
| 67 | |
| 68 | if (object == null) |
| 69 | { |
| 70 | return null; |
| 71 | } |
| 72 | else |
| 73 | { |
| 74 | if (path.startsWith("/")) |
| 75 | { |
| 76 | path = path.substring(1); |
nothing calls this directly
no test coverage detected