diff options
Diffstat (limited to 'src')
76 files changed, 529 insertions, 67 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 2b4eafb9a1..1208a05744 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.eventbus.EventBus; @@ -61,8 +62,11 @@ public class BWCore extends DummyModContainer { shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0]; shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1]; shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; + shouldTransform[4] = true; + shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5]; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); + BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); } @Override @@ -70,6 +74,9 @@ public class BWCore extends DummyModContainer { List<ArtifactVersion> ret = new ArrayList<>(); ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); ret.add(new DefaultArtifactVersion("Thaumcraft", true)); + ret.add(new DefaultArtifactVersion("RWG", true)); + ret.add(new DefaultArtifactVersion("gregtech", true)); + ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 51ee9867a9..bd395ea175 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; import java.util.Arrays; @@ -38,7 +39,8 @@ public class BWCoreTransformer implements IClassTransformer { "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API" + "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", + "DUCTTAPING RWG WORLDEN FAILS" // "ADD EXECTION HANDLEING TO FIND OREIDS/OREDICT" }; public static final String[] CLASSESBEEINGTRANSFORMED = { @@ -46,7 +48,8 @@ public class BWCoreTransformer implements IClassTransformer { "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", - "gregtech.GT_Mod" + "gregtech.GT_Mod", + "rwg.world.ChunkGeneratorRealistic" // "net.minecraftforge.oredict.OreDictionary" }; static boolean obfs; @@ -92,6 +95,7 @@ public class BWCoreTransformer implements IClassTransformer { ClassNode classNode = new ClassNode(); classReader.accept(classNode, ClassReader.SKIP_FRAMES); List<MethodNode> methods = classNode.methods; + scase: switch (id) { case 0: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -140,10 +144,9 @@ public class BWCoreTransformer implements IClassTransformer { toPatch.maxStack = 1; toPatch.maxLocals = 5; methods.set(i, toPatch); - break; + break scase; } } - break; } case 2: { String name_deObfs = "renderSky"; @@ -201,10 +204,9 @@ public class BWCoreTransformer implements IClassTransformer { } } toPatch.instructions = nu; - break; + break scase; } } - break; } case 3: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -217,10 +219,9 @@ public class BWCoreTransformer implements IClassTransformer { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); - break; + break scase; } } - break; } case 4 : { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -244,13 +245,48 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(toPatch.instructions.get(j)); } toPatch.instructions = nu; - break; + break scase; } } - - break; } case 5: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "getNewNoise"; + for (int i = 0; i < methods.size(); i++) { + MethodNode toPatch = methods.get(i); + + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + InsnList nu = new InsnList(); + // if (x < -28675) x %= -28675; + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[0])); + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 2)); + nu.add(LabelNodes[0]); + // if (y < -28675) y %= -28675; + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[1])); + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 3)); + nu.add(LabelNodes[1]); + + for (int j = 1; j < methods.get(i).instructions.size(); j++) { + nu.add(methods.get(i).instructions.get(j)); + } + + methods.get(i).instructions = nu; + break scase; + } + } + // String name_deObfs = "getOreIDs"; // String dsc_deObfs = "(Lnet/minecraft/item/ItemStack;)[I"; // String dsc_Obfs = "(Ladd;)[I"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 3f01018d84..6fedc29f6b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -240,17 +240,18 @@ public final class MainMod { private static void unificationEnforcer() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().enforceUnification) { - if (werkstoff.contains(NOBLE_GAS)){ - String name = werkstoff.getFluidOrGas(1).getFluid().getName(); - String wrongname ="molten."+name; - FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname,1); + if (werkstoff.contains(NOBLE_GAS)) { + String name = werkstoff.getFluidOrGas(1).getFluid().getName(); + String wrongname = "molten." + name; + FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname, 1); + if (wrongNamedFluid != null) { for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { for (GT_Recipe recipe : map.mRecipeList) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { Collection<GT_Recipe> col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); - map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(),col); + map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); } @@ -262,7 +263,8 @@ public final class MainMod { } } } - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false,null,null,null,null,new FluidStack[]{wrongNamedFluid},new FluidStack[]{werkstoff.getFluidOrGas(1)},1,1,0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); + } } MainMod.runMoltenUnificationEnfocement(werkstoff); MainMod.runUnficationDeleter(werkstoff); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 96e69f4cf3..29b78e568e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -23,6 +23,8 @@ public class PrefixTextureLinker implements Runnable { public void run() { for (OrePrefixes prefixes : OrePrefixes.values()) { + if (prefixes == OrePrefixes.rod) + continue; HashMap curr = new HashMap<>(); if (prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) { Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")).forEach(SET -> { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 6e55fd509a..b23afa275c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -37,6 +37,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -130,7 +131,7 @@ public class ItemRegistry { public static ItemStack[] diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; - public static ItemStack[] megaMachines = new ItemStack[2]; + public static ItemStack[] megaMachines = new ItemStack[3]; public static ItemStack dehp; public static ItemStack thtr; public static ItemStack eic; @@ -192,6 +193,7 @@ public class ItemRegistry { ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L); ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); + ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 013a26a6aa..35be05a86e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -254,6 +254,7 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[2], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index ef71506d0e..b8c8be8e4d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -142,6 +142,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl continue; BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt > 0) + this.mEUt = -this.mEUt; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 6c90893975..fc76ab719d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -320,6 +320,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl case 8: internalH = 10801; break; + case 9: + internalH = 21601; + break; default: break; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java new file mode 100644 index 0000000000..19e4455a08 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -0,0 +1,230 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.google.common.collect.ArrayListMultimap; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTil |
