diff options
author | Alkalus <Draknyte1@hotmail.com> | 2020-04-09 11:38:41 +0100 |
---|---|---|
committer | Alkalus <Draknyte1@hotmail.com> | 2020-04-09 11:38:41 +0100 |
commit | 0c0c4eba9a8a99687c4d157d1658976871bba047 (patch) | |
tree | 919b02d55d07b8b534cf8e5e7197498ebe4421e5 /src | |
parent | cfbd10cfb2644a981b9b2763166aa66fce5cd491 (diff) | |
download | GT5-Unofficial-0c0c4eba9a8a99687c4d157d1658976871bba047.tar.gz GT5-Unofficial-0c0c4eba9a8a99687c4d157d1658976871bba047.tar.bz2 GT5-Unofficial-0c0c4eba9a8a99687c4d157d1658976871bba047.zip |
$ Fixed Hazmat ASM not actually injecting replacement methods.
Diffstat (limited to 'src')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java | 4 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java | 31 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java (renamed from src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationPond.java) | 10 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java | 4 |
4 files changed, 29 insertions, 20 deletions
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java index 1bb4c53bd2..fc017199b1 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java @@ -6,7 +6,6 @@ import java.lang.reflect.Field; import java.util.HashMap; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.GregTech_API; import gregtech.api.objects.GT_HashSet; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_Utility; @@ -30,8 +29,6 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent; public class HazmatUtils { public static final GT_HashSet<GT_ItemStack> sHazmatList = new GT_HashSet<GT_ItemStack>(); - - private static final HashMap<Item, Boolean> aIgnoreNBTMap = new HashMap<Item, Boolean>(); private static final HashMap<String, AutoMap<String>> mToolTips = new HashMap<String, AutoMap<String>>(); @@ -305,7 +302,6 @@ public class HazmatUtils { return false; } } - aIgnoreNBTMap.put(aVanStack.getItem(), true); Logger.INFO("[Hazmat] Protection added for all 6 damage types, registering to master Hazmat list."); sHazmatList.add(aStack); return true; diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java index 3381518c1f..48493a739e 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java @@ -9,8 +9,8 @@ import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; -import cpw.mods.fml.relauncher.FMLRelaunchLog; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.preloader.Preloader_Logger; public class ClassTransformer_GT_Utility { @@ -35,14 +35,20 @@ public class ClassTransformer_GT_Utility { isValid = false; } - FMLRelaunchLog.log("[GT++ ASM] Gregtech Utilities Patch", Level.INFO, "Valid patch? " + isValid + "."); + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Valid patch? " + isValid + "."); reader = aTempReader; writer = aTempWriter; if (reader != null && writer != null) { - FMLRelaunchLog.log("[GT++ ASM] Gregtech Utilities Patch", Level.INFO, "Attempting Method Injection."); + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Attempting Method Injection."); injectMethod("getTier"); - injectMethod("applyRadioactivity"); + injectMethod("applyRadioactivity"); + injectMethod("isWearingFullFrostHazmat"); + injectMethod("isWearingFullHeatHazmat"); + injectMethod("isWearingFullBioHazmat"); + injectMethod("isWearingFullRadioHazmat"); + injectMethod("isWearingFullElectroHazmat"); + injectMethod("isWearingFullGasHazmat"); } } @@ -63,9 +69,9 @@ public class ClassTransformer_GT_Utility { MethodVisitor mv; boolean didInject = false; ClassWriter cw = getWriter(); - String aClassNameFormatted = Utils.class.getName().replace(".", "/"); - FMLRelaunchLog.log("[GT++ ASM] Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ", static replacement call to "+aClassNameFormatted+"."); + String aClassNameFormatted = Utils.class.getName().replace(".", "/"); if (aMethodName.equals("getTier")) { + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ", static replacement call to "+aClassNameFormatted+"."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "getTier", "(J)B", null, null); mv.visitCode(); Label l0 = new Label(); @@ -82,6 +88,7 @@ public class ClassTransformer_GT_Utility { didInject = true; } if (aMethodName.equals("applyRadioactivity")){ + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "applyRadioactivity", "(Lnet/minecraft/entity/EntityLivingBase;II)Z", null, null); mv.visitCode(); Label l0 = new Label(); @@ -390,6 +397,7 @@ public class ClassTransformer_GT_Utility { } if (aMethodName.equals("isWearingFullFrostHazmat")){ + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullFrostHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null); mv.visitCode(); Label l0 = new Label(); @@ -444,6 +452,7 @@ public class ClassTransformer_GT_Utility { } if (aMethodName.equals("isWearingFullHeatHazmat")){ + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullHeatHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null); mv.visitCode(); Label l0 = new Label(); @@ -498,6 +507,7 @@ public class ClassTransformer_GT_Utility { } if (aMethodName.equals("isWearingFullBioHazmat")){ + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullBioHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null); mv.visitCode(); Label l0 = new Label(); @@ -552,6 +562,7 @@ public class ClassTransformer_GT_Utility { } if (aMethodName.equals("isWearingFullRadioHazmat")){ + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullRadioHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null); mv.visitCode(); Label l0 = new Label(); @@ -606,6 +617,7 @@ public class ClassTransformer_GT_Utility { } if (aMethodName.equals("isWearingFullElectroHazmat")){ + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullElectroHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null); mv.visitCode(); Label l0 = new Label(); @@ -660,6 +672,7 @@ public class ClassTransformer_GT_Utility { } if (aMethodName.equals("isWearingFullGasHazmat")){ + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + "."); mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullGasHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null); mv.visitCode(); Label l0 = new Label(); @@ -713,7 +726,7 @@ public class ClassTransformer_GT_Utility { didInject = true; } - FMLRelaunchLog.log("[GT++ ASM] Gregtech Utilities Patch", Level.INFO, "Method injection complete."); + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Method injection complete."); return didInject; } @@ -759,8 +772,8 @@ public class ClassTransformer_GT_Utility { } if (methodVisitor == null) { - FMLRelaunchLog.log("[GT++ ASM] Gregtech Utilities Patch", Level.INFO, - "Found method " + name + ", removing."); + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Found method " + name + ", removing."); + Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Descriptor: "+desc); } return methodVisitor; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationPond.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index b04a068376..74047e5ecc 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationPond.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -32,26 +32,26 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -public class GregtechMTE_FrothFlotationPond extends GregtechMeta_MultiBlockBase { +public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase { private int mLevel = -1; - public GregtechMTE_FrothFlotationPond(final int aID, final String aName, final String aNameRegional) { + public GregtechMTE_FrothFlotationCell(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } - public GregtechMTE_FrothFlotationPond(final String aName) { + public GregtechMTE_FrothFlotationCell(final String aName) { super(aName); } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMTE_FrothFlotationPond(this.mName); + return new GregtechMTE_FrothFlotationCell(this.mName); } @Override public String getMachineType() { - return "Algae Pond"; + return "Flotation Cell"; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java index 8719061f7c..19c361be93 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java @@ -4,7 +4,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_MillingBalls; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IsaMill; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_FrothFlotationPond; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_FrothFlotationCell; public class GregtechIsaMill { @@ -13,7 +13,7 @@ public class GregtechIsaMill { Logger.INFO("Gregtech5u Content | Registering Milling Content."); GregtechItemList.Controller_IsaMill.set(new GregtechMetaTileEntity_IsaMill(31027, "gtpp.multimachine.isamill", "IsaMill Grinding Machine").getStackForm(1L)); - GregtechItemList.Controller_Flotation_Cell.set(new GregtechMTE_FrothFlotationPond(31028, "gtpp.multimachine.flotationcell", "Flotation Cell Regulator").getStackForm(1L)); + GregtechItemList.Controller_Flotation_Cell.set(new GregtechMTE_FrothFlotationCell(31028, "gtpp.multimachine.flotationcell", "Flotation Cell Regulator").getStackForm(1L)); // Milling Ball Bus GregtechItemList.Bus_Milling_Balls.set((new GT_MetaTileEntity_Hatch_MillingBalls(31029, "hatch.milling", "Ball Housing")).getStackForm(1L)); |