diff options
| author | Raven Szewczyk <git@eigenraven.me> | 2024-05-24 19:04:17 +0100 |
|---|---|---|
| committer | Raven Szewczyk <git@eigenraven.me> | 2024-05-24 19:04:17 +0100 |
| commit | 69ce418e29e22391f60cdd55815727762a78c33a (patch) | |
| tree | 97be683e94b8a541d7578760a154f16d4dea38e2 /src/main/java/gtPlusPlus/preloader/asm | |
| parent | 38f38a991e433f6eff30476b87a71eeadee228ce (diff) | |
| download | GT5-Unofficial-69ce418e29e22391f60cdd55815727762a78c33a.tar.gz GT5-Unofficial-69ce418e29e22391f60cdd55815727762a78c33a.tar.bz2 GT5-Unofficial-69ce418e29e22391f60cdd55815727762a78c33a.zip | |
Apply updated GT5u spotless configs
Diffstat (limited to 'src/main/java/gtPlusPlus/preloader/asm')
8 files changed, 212 insertions, 207 deletions
diff --git a/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java b/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java index b11eb66801..b4a49c275c 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java +++ b/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java @@ -47,69 +47,80 @@ public class AsmConfig { // Debug prop = config.get("debug", "disableAllLogging", true); prop.comment = "Disables ALL logging from GT++."; - prop.setLanguageKey("gtpp.disableAllLogging").setRequiresMcRestart(false); + prop.setLanguageKey("gtpp.disableAllLogging") + .setRequiresMcRestart(false); disableAllLogging = prop.getBoolean(true); propOrderDebug.add(prop.getName()); prop = config.get("debug", "debugMode", false); prop.comment = "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)"; - prop.setLanguageKey("gtpp.debugMode").setRequiresMcRestart(false); + prop.setLanguageKey("gtpp.debugMode") + .setRequiresMcRestart(false); debugMode = prop.getBoolean(false); propOrderDebug.add(prop.getName()); prop = config.get("debug", "enabledFixEntitySetHealth", false); prop.comment = "Enable/Disable entity setHealth() fix."; - prop.setLanguageKey("gtpp.enabledFixEntitySetHealth").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enabledFixEntitySetHealth") + .setRequiresMcRestart(true); enabledFixEntitySetHealth = prop.getBoolean(false); propOrderDebug.add(prop.getName()); prop = config.get("debug", "enableGtNbtFix", true); prop.comment = "Enable/Disable GT NBT Persistency Fix"; - prop.setLanguageKey("gtpp.enableGtNbtFix").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enableGtNbtFix") + .setRequiresMcRestart(true); enableGtNbtFix = prop.getBoolean(true); propOrderDebug.add(prop.getName()); prop = config.get("debug", "enableCofhPatch", false); prop.comment = "Enable/Disable COFH OreDictionaryArbiter Patch (Useful for Development)"; - prop.setLanguageKey("gtpp.enableCofhPatch").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enableCofhPatch") + .setRequiresMcRestart(true); enableCofhPatch = prop.getBoolean(false); propOrderDebug.add(prop.getName()); prop = config.get("debug", "enableOreDictPatch", false); prop.comment = "Enable/Disable Forge OreDictionary Patch (Useful for Development)"; - prop.setLanguageKey("gtpp.enableOreDictPatch").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enableOreDictPatch") + .setRequiresMcRestart(true); enableOreDictPatch = prop.getBoolean(false); propOrderDebug.add(prop.getName()); prop = config.get("debug", "enableThaumicTinkererRepairFix", false); prop.comment = "Enable/Disable Patch for Thaumic Repairer"; - prop.setLanguageKey("gtpp.enableThaumicTinkererRepairFix").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enableThaumicTinkererRepairFix") + .setRequiresMcRestart(true); enableThaumicTinkererRepairFix = prop.getBoolean(false); propOrderDebug.add(prop.getName()); // General Features prop = config.get("general", "enabledLwjglKeybindingFix", true); prop.comment = "Prevents the game crashing from having invalid keybinds. https://github.com/alkcorp/GTplusplus/issues/544"; - prop.setLanguageKey("gtpp.enabledLwjglKeybindingFix").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enabledLwjglKeybindingFix") + .setRequiresMcRestart(true); enabledLwjglKeybindingFix = prop.getBoolean(true); propOrder.add(prop.getName()); prop = config.get("general", "enableGtTooltipFix", true); prop.comment = "Enable/Disable Custom GT Tooltips"; - prop.setLanguageKey("gtpp.enableGtTooltipFix").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enableGtTooltipFix") + .setRequiresMcRestart(true); enableGtTooltipFix = prop.getBoolean(true); propOrder.add(prop.getName()); prop = config.get("general", "enableGtCharcoalPitFix", true); prop.comment = "Makes the Charcoal Pile Igniter work better."; - prop.setLanguageKey("gtpp.enableGtCharcoalPitFix").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enableGtCharcoalPitFix") + .setRequiresMcRestart(true); enableGtCharcoalPitFix = prop.getBoolean(true); propOrder.add(prop.getName()); // TC Aspect Safety prop = config.get("general", "enableTcAspectSafety", true); prop.comment = "Fixes small oversights in Thaumcraft 4."; - prop.setLanguageKey("gtpp.enableTcAspectSafety").setRequiresMcRestart(true); + prop.setLanguageKey("gtpp.enableTcAspectSafety") + .setRequiresMcRestart(true); enableTcAspectSafety = prop.getBoolean(true); propOrder.add(prop.getName()); @@ -124,7 +135,7 @@ public class AsmConfig { Preloader_Logger.INFO("COFH Patch - Enabled: " + enableCofhPatch); Preloader_Logger.INFO("Thaumcraft Aspect Safety Patch - Enabled: " + enableTcAspectSafety); Preloader_Logger - .INFO("Fix bad usage of EntityLivingBase.setHealth Patch - Enabled: " + enabledFixEntitySetHealth); + .INFO("Fix bad usage of EntityLivingBase.setHealth Patch - Enabled: " + enabledFixEntitySetHealth); } catch (Exception var3) { FMLLog.log(Level.ERROR, var3, "GT++ ASM had a problem loading it's config", new Object[0]); diff --git a/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java b/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java index b157424e6e..c77f570a8d 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java +++ b/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java @@ -47,24 +47,24 @@ public class Preloader_DummyContainer extends DummyModContainer { public static void handleConfigFile(final FMLPreInitializationEvent event) { final Configuration config = new Configuration( - new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); + new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); config.load(); // BGM Watchdog CORE_Preloader.enableWatchdogBGM = config.getInt( - "enableWatchdogBGM", - "features", - 0, - 0, - Short.MAX_VALUE, - "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s."); + "enableWatchdogBGM", + "features", + 0, + 0, + Short.MAX_VALUE, + "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s."); // Circuits CORE_Preloader.enableOldGTcircuits = config.getBoolean( - "enableOldGTcircuits", - GregTech.ID, - false, - "Restores circuits and their recipes from Pre-5.09.28 times."); + "enableOldGTcircuits", + GregTech.ID, + false, + "Restores circuits and their recipes from Pre-5.09.28 times."); } } diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java index 84fecda974..0b41846928 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java +++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java @@ -78,15 +78,15 @@ public class ClassTransformer_COFH_OreDictionaryArbiter { MethodVisitor mv; if (aMethodName.equals("registerOreDictionaryEntry")) { FMLRelaunchLog.log( - "[GT++ ASM] COFH OreDictionaryArbiter Patch", - Level.INFO, - "Injecting " + aMethodName + " into " + className + ". ItemStack: " + aItemStack); + "[GT++ ASM] COFH OreDictionaryArbiter Patch", + Level.INFO, + "Injecting " + aMethodName + " into " + className + ". ItemStack: " + aItemStack); mv = getWriter().visitMethod( - ACC_PUBLIC + ACC_STATIC, - "registerOreDictionaryEntry", - "(L" + aItemStack + ";Ljava/lang/String;)V", - null, - null); + ACC_PUBLIC + ACC_STATIC, + "registerOreDictionaryEntry", + "(L" + aItemStack + ";Ljava/lang/String;)V", + null, + null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); @@ -94,11 +94,11 @@ public class ClassTransformer_COFH_OreDictionaryArbiter { mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter$FixCOFH", - "registerOreDictionaryEntry", - "(L" + aItemStack + ";Ljava/lang/String;)V", - false); + INVOKESTATIC, + "gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter$FixCOFH", + "registerOreDictionaryEntry", + "(L" + aItemStack + ";Ljava/lang/String;)V", + false); Label l1 = new Label(); mv.visitLabel(l1); mv.visitLineNumber(62, l1); @@ -141,13 +141,16 @@ public class ClassTransformer_COFH_OreDictionaryArbiter { static { try { oreIDs = (BiMap<String, Integer>) ReflectionUtils.getField(OreDictionaryArbiter.class, "oreIDs") - .get(null); + .get(null); oreStacks = (TMap<Integer, ArrayList<ItemStack>>) ReflectionUtils - .getField(OreDictionaryArbiter.class, "oreStacks").get(null); + .getField(OreDictionaryArbiter.class, "oreStacks") + .get(null); stackIDs = (TMap<ItemWrapper, ArrayList<Integer>>) ReflectionUtils - .getField(OreDictionaryArbiter.class, "stackIDs").get(null); + .getField(OreDictionaryArbiter.class, "stackIDs") + .get(null); stackNames = (TMap<ItemWrapper, ArrayList<String>>) ReflectionUtils - .getField(OreDictionaryArbiter.class, "stackNames").get(null); + .getField(OreDictionaryArbiter.class, "stackNames") + .get(null); } catch (Throwable t) { oreIDs = HashBiMap.create(); oreStacks = new THashMap<>(); diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java index da5907e6fd..7aa5ff4f90 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java +++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java @@ -53,9 +53,9 @@ public class ClassTransformer_IC2_GetHarvestTool { aName_damageDropped = obfuscated ? "func_149692_a" : "damageDropped"; FMLRelaunchLog.log( - "[GT++ ASM] IC2 getHarvestTool Patch", - Level.INFO, - "Attempting to patch in mode " + className + ". Obfuscated? " + obfuscated); + "[GT++ ASM] IC2 getHarvestTool Patch", + Level.INFO, + "Attempting to patch in mode " + className + ". Obfuscated? " + obfuscated); aTempReader = new ClassReader(basicClass); aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES); @@ -75,14 +75,14 @@ public class ClassTransformer_IC2_GetHarvestTool { FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Attempting Method Injection."); injectMethod("getHarvestTool"); if (aClassName.equals("ic2.core.block.machine.BlockMachine2") - || aClassName.equals("ic2.core.block.machine.BlockMachine3") - || aClassName.equals("ic2.core.block.wiring.BlockElectric")) { + || aClassName.equals("ic2.core.block.machine.BlockMachine3") + || aClassName.equals("ic2.core.block.wiring.BlockElectric")) { injectMethod(aName_getItemDropped); injectMethod(aName_damageDropped); } else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator") - || aClassName.equals("ic2.core.block.machine.BlockMachine")) { - injectMethod(aName_damageDropped); - } + || aClassName.equals("ic2.core.block.machine.BlockMachine")) { + injectMethod(aName_damageDropped); + } } } @@ -113,11 +113,11 @@ public class ClassTransformer_IC2_GetHarvestTool { mv.visitLineNumber(63, l0); mv.visitVarInsn(ILOAD, 1); mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", - "getHarvestTool", - "(I)Ljava/lang/String;", - false); + INVOKESTATIC, + "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", + "getHarvestTool", + "(I)Ljava/lang/String;", + false); mv.visitInsn(ARETURN); Label l1 = new Label(); mv.visitLabel(l1); @@ -128,11 +128,11 @@ public class ClassTransformer_IC2_GetHarvestTool { didInject = true; } else if (aMethodName.equals(aName_getItemDropped)) { mv = cw.visitMethod( - ACC_PUBLIC, - aName_getItemDropped, - "(ILjava/util/Random;I)Lnet/minecraft/item/Item;", - null, - null); + ACC_PUBLIC, + aName_getItemDropped, + "(ILjava/util/Random;I)Lnet/minecraft/item/Item;", + null, + null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); @@ -142,11 +142,11 @@ public class ClassTransformer_IC2_GetHarvestTool { mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(ILOAD, 3); mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", - "getItemDropped", - "(Lnet/minecraft/block/Block;ILjava/util/Random;I)Lnet/minecraft/item/Item;", - false); + INVOKESTATIC, + "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", + "getItemDropped", + "(Lnet/minecraft/block/Block;ILjava/util/Random;I)Lnet/minecraft/item/Item;", + false); mv.visitInsn(ARETURN); Label l1 = new Label(); mv.visitLabel(l1); @@ -165,11 +165,11 @@ public class ClassTransformer_IC2_GetHarvestTool { mv.visitLineNumber(48, l0); mv.visitVarInsn(ILOAD, 1); mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", - "damageDropped", - "(I)I", - false); + INVOKESTATIC, + "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", + "damageDropped", + "(I)I", + false); mv.visitInsn(IRETURN); Label l1 = new Label(); mv.visitLabel(l1); @@ -196,8 +196,8 @@ public class ClassTransformer_IC2_GetHarvestTool { public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor methodVisitor; if (aClassName.equals("ic2.core.block.machine.BlockMachine2") - || aClassName.equals("ic2.core.block.machine.BlockMachine3") - || aClassName.equals("ic2.core.block.wiring.BlockElectric")) { + || aClassName.equals("ic2.core.block.machine.BlockMachine3") + || aClassName.equals("ic2.core.block.wiring.BlockElectric")) { if (name.equals(aName_getItemDropped)) { methodVisitor = null; } else if (name.equals(aName_damageDropped)) { @@ -208,24 +208,24 @@ public class ClassTransformer_IC2_GetHarvestTool { methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); } } else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator") - || aClassName.equals("ic2.core.block.machine.BlockMachine")) { - if (name.equals(aName_damageDropped)) { - methodVisitor = null; - } else if (name.equals("getHarvestTool")) { - methodVisitor = null; - } else { - methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); - } + || aClassName.equals("ic2.core.block.machine.BlockMachine")) { + if (name.equals(aName_damageDropped)) { + methodVisitor = null; + } else if (name.equals("getHarvestTool")) { + methodVisitor = null; + } else { + methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); + } + } else { + if (name.equals("getHarvestTool")) { + methodVisitor = null; } else { - if (name.equals("getHarvestTool")) { - methodVisitor = null; - } else { - methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); - } + methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); } + } if (methodVisitor == null) { FMLRelaunchLog - .log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Found method " + name + ", removing."); + .log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Found method " + name + ", removing."); } return methodVisitor; } diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java index f478a0f1f1..4d3c78e6bd 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java +++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java @@ -50,13 +50,13 @@ public class ClassTransformer_LWJGL_Keyboard { String aCachedValue = mBadKeyCache.get("key-" + key); if (aCachedValue == null) { FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Unable to map key code " + key + " to LWJGL keymap."); + "[GT++ ASM] LWJGL Keybinding index out of bounds fix", + Level.INFO, + "Unable to map key code " + key + " to LWJGL keymap."); FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Caching key value to be empty."); + "[GT++ ASM] LWJGL Keybinding index out of bounds fix", + Level.INFO, + "Caching key value to be empty."); // mBadKeyCache.put("key-"+key, getKeyName()[0x00]); aCachedValue = "FIX!"; mBadKeyCache.put("key-" + key, aCachedValue); @@ -68,9 +68,9 @@ public class ClassTransformer_LWJGL_Keyboard { public static void trySetClientKey(int aKey) { if (Utils.isClient() && ReflectionUtils.doesClassExist("net.minecraft.client.Minecraft")) { FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Trying to set key value to be empty."); + "[GT++ ASM] LWJGL Keybinding index out of bounds fix", + Level.INFO, + "Trying to set key value to be empty."); GameSettings options = Minecraft.getMinecraft().gameSettings; KeyBinding[] akeybinding = Minecraft.getMinecraft().gameSettings.keyBindings; int i = akeybinding.length; @@ -78,9 +78,9 @@ public class ClassTransformer_LWJGL_Keyboard { if (keybinding != null && keybinding.getKeyCode() == aKey) { options.setOptionKeyBinding(keybinding, 0); FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Set keybind " + aKey + " to 0."); + "[GT++ ASM] LWJGL Keybinding index out of bounds fix", + Level.INFO, + "Set keybind " + aKey + " to 0."); break; } } @@ -140,7 +140,7 @@ public class ClassTransformer_LWJGL_Keyboard { isValid = false; } FMLRelaunchLog - .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Valid? " + isValid + "."); + .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Valid? " + isValid + "."); reader = aTempReader; writer = aTempWriter; } @@ -162,27 +162,21 @@ public class ClassTransformer_LWJGL_Keyboard { public boolean injectLWJGLPatch(ClassWriter cw) { MethodVisitor mv; boolean didInject = false; - FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Injecting " + "getKeyName" + "."); - mv = cw.visitMethod( - ACC_PUBLIC + ACC_STATIC + ACC_SYNCHRONIZED, - "getKeyName", - "(I)Ljava/lang/String;", - null, - null); + FMLRelaunchLog + .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Injecting " + "getKeyName" + "."); + mv = cw + .visitMethod(ACC_PUBLIC + ACC_STATIC + ACC_SYNCHRONIZED, "getKeyName", "(I)Ljava/lang/String;", null, null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); mv.visitLineNumber(49, l0); mv.visitVarInsn(ILOAD, 0); mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard", - "getKeyName", - "(I)Ljava/lang/String;", - false); + INVOKESTATIC, + "gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard", + "getKeyName", + "(I)Ljava/lang/String;", + false); mv.visitInsn(ARETURN); Label l1 = new Label(); mv.visitLabel(l1); @@ -192,7 +186,7 @@ public class ClassTransformer_LWJGL_Keyboard { didInject = true; FMLRelaunchLog - .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete."); + .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete."); return didInject; } @@ -200,10 +194,8 @@ public class ClassTransformer_LWJGL_Keyboard { MethodVisitor mv; boolean didInject = false; String aMethodName = this.isClientSettingsObfuscated ? "func_74298_c" : "getKeyDisplayString"; - FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Injecting " + aMethodName + "."); + FMLRelaunchLog + .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, aMethodName, "(I)Ljava/lang/String;", null, null); mv.visitCode(); Label l0 = new Label(); @@ -211,11 +203,11 @@ public class ClassTransformer_LWJGL_Keyboard { mv.visitLineNumber(130, l0); mv.visitVarInsn(ILOAD, 0); mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/keyboard/BetterKeyboard", - "getKeyDisplayString", - "(I)Ljava/lang/String;", - false); + INVOKESTATIC, + "gtPlusPlus/preloader/keyboard/BetterKeyboard", + "getKeyDisplayString", + "(I)Ljava/lang/String;", + false); mv.visitInsn(ARETURN); Label l1 = new Label(); mv.visitLabel(l1); @@ -224,7 +216,7 @@ public class ClassTransformer_LWJGL_Keyboard { mv.visitEnd(); didInject = true; FMLRelaunchLog - .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete."); + .log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete."); return didInject; } @@ -260,9 +252,9 @@ public class ClassTransformer_LWJGL_Keyboard { } if (found) { FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Found method " + name + ", removing."); + "[GT++ ASM] LWJGL Keybinding index out of bounds fix", + Level.INFO, + "Found method " + name + ", removing."); } return methodVisitor; } @@ -295,9 +287,9 @@ public class ClassTransformer_LWJGL_Keyboard { } if (found) { FMLRelaunchLog.log( - "[GT++ ASM] LWJGL Keybinding index out of bounds fix", - Level.INFO, - "Found method " + name + ", removing."); + "[GT++ ASM] LWJGL Keybinding index out of bounds fix", + Level.INFO, + "Found method " + name + ", removing."); } return methodVisitor; } diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java index 98e1e7d473..cf8b08d40c 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java +++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java @@ -52,9 +52,9 @@ public class ClassTransformer_TC_ItemWispEssence { ClassReader aTempReader = null; ClassWriter aTempWriter = null; FMLRelaunchLog.log( - "[GT++ ASM] Thaumcraft WispEssence_Patch", - Level.INFO, - "Are we patching obfuscated methods? " + obfuscated2); + "[GT++ ASM] Thaumcraft WispEssence_Patch", + Level.INFO, + "Are we patching obfuscated methods? " + obfuscated2); String aGetColour = obfuscated2 ? "func_82790_a" : "getColorFromItemStack"; aTempReader = new ClassReader(basicClass); aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES); @@ -94,11 +94,11 @@ public class ClassTransformer_TC_ItemWispEssence { if (aMethodName.equals("getAspects")) { mv = cw.visitMethod( - ACC_PUBLIC, - "getAspects", - "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", - null, - null); + ACC_PUBLIC, + "getAspects", + "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", + null, + null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); @@ -131,17 +131,17 @@ public class ClassTransformer_TC_ItemWispEssence { mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn( - INVOKEVIRTUAL, - "net/minecraft/item/ItemStack", - aGetTagCompound, - "()Lnet/minecraft/nbt/NBTTagCompound;", - false); + INVOKEVIRTUAL, + "net/minecraft/item/ItemStack", + aGetTagCompound, + "()Lnet/minecraft/nbt/NBTTagCompound;", + false); mv.visitMethodInsn( - INVOKEVIRTUAL, - "thaumcraft/api/aspects/AspectList", - "readFromNBT", - "(Lnet/minecraft/nbt/NBTTagCompound;)V", - false); + INVOKEVIRTUAL, + "thaumcraft/api/aspects/AspectList", + "readFromNBT", + "(Lnet/minecraft/nbt/NBTTagCompound;)V", + false); Label l6 = new Label(); mv.visitLabel(l6); mv.visitLineNumber(147, l6); @@ -166,12 +166,12 @@ public class ClassTransformer_TC_ItemWispEssence { Label l9 = new Label(); mv.visitLabel(l9); mv.visitLocalVariable( - "this", - "LgtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence;", - null, - l0, - l9, - 0); + "this", + "LgtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence;", + null, + l0, + l9, + 0); mv.visitLocalVariable("itemstack", "Lnet/minecraft/item/ItemStack;", null, l0, l9, 1); mv.visitLocalVariable("aspects", "Lthaumcraft/api/aspects/AspectList;", null, l5, l3, 2); mv.visitMaxs(2, 3); @@ -205,11 +205,11 @@ public class ClassTransformer_TC_ItemWispEssence { mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn( - INVOKEVIRTUAL, - "thaumcraft/common/items/ItemWispEssence", - "getAspects", - "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", - false); + INVOKEVIRTUAL, + "thaumcraft/common/items/ItemWispEssence", + "getAspects", + "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", + false); Label l3 = new Label(); mv.visitJumpInsn(IFNULL, l3); Label l4 = new Label(); @@ -218,17 +218,17 @@ public class ClassTransformer_TC_ItemWispEssence { mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn( - INVOKEVIRTUAL, - "thaumcraft/common/items/ItemWispEssence", - "getAspects", - "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", - false); + INVOKEVIRTUAL, + "thaumcraft/common/items/ItemWispEssence", + "getAspects", + "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", + false); mv.visitMethodInsn( - INVOKEVIRTUAL, - "thaumcraft/api/aspects/AspectList", - "getAspects", - "()[Lthaumcraft/api/aspects/Aspect;", - false); + INVOKEVIRTUAL, + "thaumcraft/api/aspects/AspectList", + "getAspects", + "()[Lthaumcraft/api/aspects/Aspect;", + false); mv.visitInsn(ICONST_0); mv.visitInsn(AALOAD); mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/Aspect", "getColor", "()I", false); @@ -240,10 +240,10 @@ public class ClassTransformer_TC_ItemWispEssence { mv.visitLdcInsn(new Long(500L)); mv.visitInsn(LDIV); mv.visitFieldInsn( - GETSTATIC, - "thaumcraft/common/items/ItemWispEssence", - "displayAspects", - "[Lthaumcraft/api/aspects/Aspect;"); + GETSTATIC, + "thaumcraft/common/items/ItemWispEssence", + "displayAspects", + "[Lthaumcraft/api/aspects/Aspect;"); mv.visitInsn(ARRAYLENGTH); mv.visitInsn(I2L); mv.visitInsn(LREM); @@ -253,10 +253,10 @@ public class ClassTransformer_TC_ItemWispEssence { mv.visitLabel(l5); mv.visitLineNumber(204, l5); mv.visitFieldInsn( - GETSTATIC, - "thaumcraft/common/items/ItemWispEssence", - "displayAspects", - "[Lthaumcraft/api/aspects/Aspect;"); + GETSTATIC, + "thaumcraft/common/items/ItemWispEssence", + "displayAspects", + "[Lthaumcraft/api/aspects/Aspect;"); mv.visitVarInsn(ILOAD, 3); mv.visitInsn(AALOAD); mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/Aspect", "getColor", "()I", false); @@ -273,9 +273,9 @@ public class ClassTransformer_TC_ItemWispEssence { } FMLRelaunchLog.log( - "[GT++ ASM] Thaumcraft WispEssence_Patch", - Level.INFO, - "Method injection complete. " + (obfuscated ? "Obfuscated" : "Non-Obfuscated")); + "[GT++ ASM] Thaumcraft WispEssence_Patch", + Level.INFO, + "Method injection complete. " + (obfuscated ? "Obfuscated" : "Non-Obfuscated")); return didInject; } @@ -308,10 +308,8 @@ public class ClassTransformer_TC_ItemWispEssence |
