From 0908735fc15396f8313d7643e952c1f9ce124d53 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 31 Mar 2020 12:33:16 +0100 Subject: + Added Carbon Disulfide. + Added Hydrogen Sulfide if it doesn't exist. + Added Sodium Ethoxide. + Added Potassium Hydroxide. + Added Sodium Ethyl Xanthate. + Added Potassium Ethyl Xanthate. + Added Base work for Froth Flotation Multi. --- src/resources/assets/miscutils/lang/en_US.lang | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/resources/assets/miscutils/lang') diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 8064848316..fd8e59662b 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3155,4 +3155,13 @@ item.FrothZincflotation.name=Sphalerite Flotation Froth Cell item.FrothCopperflotation.name=Chalcopyrite Flotation Froth Cell item.FrothNickelflotation.name=Nickel Flotation Froth Cell item.FrothPlatinumflotation.name=Platinum Flotation Froth Cell -item.FrothPentlanditeflotation.name=Pentlandite Flotation Froth Cell \ No newline at end of file +item.FrothPentlanditeflotation.name=Pentlandite Flotation Froth Cell + + +item.BasicGenericChemItem.9.name=Sodium Ethoxide Dust +item.BasicGenericChemItem.10.name=Sodium Ethyl Xanthate Dust +item.BasicGenericChemItem.11.name=Potassium Ethyl Xanthate Dust +item.BasicGenericChemItem.12.name=Potassium Hydroxide Dust + +item.CarbonDisulfide.name=Carbon Disulfide Cell +item.HydrogenSulfide.name=Hydrogen Sulfide Cell \ No newline at end of file -- cgit From 2c4a94b808c61d66163d9969017c2819ddb2c5ae Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 31 Mar 2020 16:35:15 +0100 Subject: + Added a Pine Tree. + Oredict BoP Pinecone if it exists. $ Fixed Algae Farm controller recipe. $ Fixed bug where getOrePrefixStack(rod) would return null. $ Fixed a bug where getItemStackFromFQRN didn't work correctly. --- .../commands/CommandEnableDebugWhileRunning.java | 20 ++- .../core/item/chemistry/AgriculturalChem.java | 7 + .../core/item/chemistry/MilledOreProcessing.java | 184 +++++++++++++++++++-- .../gtPlusPlus/core/util/minecraft/ItemUtils.java | 18 +- .../agrichem/item/algae/ItemAgrichemBase.java | 4 +- .../gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java | 158 +++++++++++++++++- .../xmod/bop/blocks/BOP_Block_Registrator.java | 22 ++- .../xmod/bop/blocks/base/LeavesBase.java | 12 +- .../xmod/bop/blocks/pine/LeavesPineTree.java | 36 ++++ .../xmod/bop/blocks/pine/LogPineTree.java | 24 +++ .../xmod/bop/blocks/pine/SaplingPineTree.java | 55 ++++++ .../bop/world/features/trees/WorldGenPineTree.java | 171 +++++++++++++++++++ .../gregtech/loaders/RecipeGen_DustGeneration.java | 3 +- src/resources/assets/miscutils/lang/en_US.lang | 8 +- .../textures/blocks/trees/leaves/leaves_pine.png | Bin 0 -> 688 bytes .../blocks/trees/leaves/leaves_pine_opaque .png | Bin 0 -> 687 bytes .../blocks/trees/saplings/sapling_pine.png | Bin 0 -> 432 bytes .../textures/items/bioscience/MetaItem1/24.png | Bin 0 -> 357 bytes .../textures/items/bioscience/MetaItem1/25.png | Bin 0 -> 648 bytes 19 files changed, 688 insertions(+), 34 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java create mode 100644 src/Java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java create mode 100644 src/Java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java create mode 100644 src/Java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java create mode 100644 src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine.png create mode 100644 src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine_opaque .png create mode 100644 src/resources/assets/miscutils/textures/blocks/trees/saplings/sapling_pine.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/24.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/25.png (limited to 'src/resources/assets/miscutils/lang') diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index a9bd1568b6..c9cdc41424 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -126,9 +126,9 @@ public class CommandEnableDebugWhileRunning implements ICommand String aOreDictData = ""; if (!aOreDictNames.isEmpty()) { for (String tag : aOreDictNames) { - aOreDictData += (tag+","); + aOreDictData += (tag+", "); } - if (aOreDictData.endsWith(",")) { + if (aOreDictData.endsWith(", ")) { aOreDictData = aOreDictData.substring(0, aOreDictData.length()-2); } } @@ -167,6 +167,18 @@ public class CommandEnableDebugWhileRunning implements ICommand } } } + else if (argString[0].toLowerCase().equals("item")) { + if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) { + final EntityPlayer P = CommandUtils.getPlayer(S); + ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1); + if (P != null && aTest != null) { + PlayerUtils.messagePlayer(P, "Found fluid stack: "+ItemUtils.getItemName(aTest)); + } + else if (P != null && aTest == null) { + PlayerUtils.messagePlayer(P, "Could not find valid item."); + } + } + } else { final EntityPlayer P = CommandUtils.getPlayer(S); PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'"); @@ -217,9 +229,9 @@ public class CommandEnableDebugWhileRunning implements ICommand int a = 0; String data = ""; for (String tag : aItemDataTags) { - data += (tag+","); + data += (tag+", "); } - if (data.endsWith(",")) { + if (data.endsWith(", ")) { data = data.substring(0, data.length()-2); } return data; diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index 3f02ca898d..e11b163753 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -110,6 +110,7 @@ public class AgriculturalChem extends ItemPackage { * 21 - Lithium Chloride * 22 - Pellet Mold * 23 - Clean Aluminium Mix + * 24 - Pinecone */ public static ItemStack mAlgaeBiosmass; @@ -136,6 +137,8 @@ public class AgriculturalChem extends ItemPackage { public static ItemStack mLithiumChloride; public static ItemStack mPelletMold; public static ItemStack mCleanAluminiumMix; + public static ItemStack mPinecone; + public static ItemStack mCrushedPine; @Override @@ -205,6 +208,8 @@ public class AgriculturalChem extends ItemPackage { mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1); mPelletMold = ItemUtils.simpleMetaStack(mAgrichemItem1, 22, 1); mCleanAluminiumMix = ItemUtils.simpleMetaStack(mAgrichemItem1, 23, 1); + mPinecone = ItemUtils.simpleMetaStack(mAgrichemItem1, 24, 1); + mCrushedPine = ItemUtils.simpleMetaStack(mAgrichemItem1, 25, 1); ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae"); ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae"); @@ -231,6 +236,8 @@ public class AgriculturalChem extends ItemPackage { ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate"); ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); + ItemUtils.addItemToOreDictionary(mPinecone, "pinecone"); + ItemUtils.addItemToOreDictionary(mCrushedPine, "crushedPineMaterial"); //Handle GT NaOH dusts List NaOHSmall = OreDictionary.getOres("dustSmallSodiumHydroxide_GT5U", false); diff --git a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java index 426f48ecf9..86ffe49eed 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java @@ -1,46 +1,61 @@ package gtPlusPlus.core.item.chemistry; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.base.ore.BaseItemMilledOre; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; +import gtPlusPlus.core.util.minecraft.NBTUtils; +import gtPlusPlus.xmod.bop.HANDLER_BiomesOPlenty; +import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; public class MilledOreProcessing extends ItemPackage { /** * Fluids */ - + public static Fluid ZincFlotationFroth; public static Fluid CopperFlotationFroth; public static Fluid NickelFlotationFroth; public static Fluid PlatinumFlotationFroth; public static Fluid PentlanditeFlotationFroth; - - + + public static Fluid PineOil; + + /** * Items */ // Zinc, Iron, Indium, Germanium public static Item milledSphalerite; - + // Copper, Iron, Cadmium, Indium public static Item milledChalcopyrite; - + // Nickel, Cobalt, Rhodium, Ruthenium public static Item milledNickel; - + // Platinum, Rhodium, Selenium, Tellurium public static Item milledPlatinum; // Iron, Nickel, Promethium, Hafnium public static Item milledPentlandite; - + @Override public void items() { @@ -50,7 +65,7 @@ public class MilledOreProcessing extends ItemPackage { milledNickel = BaseItemMilledOre.generate(Materials.Nickel, MaterialUtils.getVoltageForTier(4)); milledPlatinum = BaseItemMilledOre.generate(Materials.Platinum, MaterialUtils.getVoltageForTier(5)); milledPentlandite = BaseItemMilledOre.generate(Materials.Pentlandite, MaterialUtils.getVoltageForTier(5)); - + } @Override @@ -60,7 +75,7 @@ public class MilledOreProcessing extends ItemPackage { @Override public void fluids() { - + short[] aZincFrothRGB = Materials.Sphalerite.mRGBa; ZincFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.zincflotation", "Zinc Froth", 32 + 175, new short[] { aZincFrothRGB[0], aZincFrothRGB[1], aZincFrothRGB[2], 100 }, true); short[] aCopperFrothRGB = Materials.Chalcopyrite.mRGBa; @@ -72,9 +87,11 @@ public class MilledOreProcessing extends ItemPackage { short[] aPentlanditeFrothRGB = Materials.Pentlandite.mRGBa; PentlanditeFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.pentlanditeflotation", "Pentlandite Froth", 32 + 175, new short[] { aPentlanditeFrothRGB[0], aPentlanditeFrothRGB[1], aPentlanditeFrothRGB[2], 100 }, true); + PineOil = FluidUtils.generateFluidNoPrefix("pineoil", "Pine Oil", 32 + 175, new short[] { 250, 200, 60, 100 }, true); + } - - + + public MilledOreProcessing() { super(); @@ -98,6 +115,7 @@ public class MilledOreProcessing extends ItemPackage { 30 * 20, 30);*/ + } @Override @@ -108,6 +126,150 @@ public class MilledOreProcessing extends ItemPackage { @Override public boolean generateRecipes() { addMiscRecipes(); + addPineOilExtraction(); return true; } + + private void addPineOilExtraction() { + AutoMap aLogs = new AutoMap(); + AutoMap aLeaves = new AutoMap(); + AutoMap aSaplings = new AutoMap(); + AutoMap aPinecones = new AutoMap(); + + ItemStack aCrushedPine = ItemUtils.getSimpleStack(AgriculturalChem.mCrushedPine, 1); + + aLogs.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.log_Pine)); + aLeaves.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.leaves_Pine)); + aSaplings.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Pine)); + aPinecones.add(ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, 1)); + + if (LoadedMods.BiomesOPlenty) { + aLogs.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.logs4, 0, 1)); + aLeaves.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedLeaves2, 1, 1)); + aSaplings.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedSaplings, 5, 1)); + aPinecones.add(ItemUtils.simpleMetaStack(HANDLER_BiomesOPlenty.mPineCone, 13, 1)); + } + if (LoadedMods.Forestry) { + ItemStack aForestryLog = ItemUtils.getItemStackFromFQRN("Forestry:logs", 1); + if (aForestryLog != null) { + aForestryLog.setItemDamage(20); // Set to Pine + aLogs.add(aForestryLog); + } + ItemStack aForestryLeaves = ItemUtils.getItemStackFromFQRN("Forestry:leaves", 1); + if (aForestryLeaves != null) { + NBTUtils.setString(aForestryLeaves, "species", "forestry.treePine"); // Set to Pine + aLeaves.add(aForestryLeaves); + } + } + + for (ItemStack aLog : aLogs) { + addRecipe(aLog, ItemUtils.getSimpleStack(aCrushedPine, 16), new int[] {10000, 7500, 5000, 2500}, 10, 120); + } + for (ItemStack aLeaf : aLeaves) { + addRecipe(aLeaf, ItemUtils.getSimpleStack(aCrushedPine, 2), new int[] {5000, 5000, 2500, 2500}, 10, 30); + } + for (ItemStack aSapling : aSaplings) { + addRecipe(aSapling, ItemUtils.getSimpleStack(aCrushedPine, 4), new int[] {7500, 7500, 2500, 2500}, 10, 60); + } + for (ItemStack aCone : aPinecones) { + addRecipe(aCone, ItemUtils.getSimpleStack(aCrushedPine, 1), new int[] {7500, 7500, 5000, 2500}, 10, 60); + } + + + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(16), + ItemUtils.getSimpleStack(aCrushedPine, 64) + }, + new FluidStack[] { + FluidUtils.getSteam(5000), + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5) + }, + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 1000) + }, + new int[] { + 2000, 2000, 2000, 2000 + }, + 20 *60, + 120, + 2); + + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(18), + ItemUtils.getSimpleStack(aCrushedPine, 64) + }, + new FluidStack[] { + FluidUtils.getSuperHeatedSteam(5000), + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5) + }, + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 2000) + }, + new int[] { + 3000, 3000, 3000, 3000 + }, + 20 *60, + 120, + 3); + + } + + public boolean addRecipe(ItemStack aInput, ItemStack aOutput1, int[] aChances, int aTime, int aEU) { + aOutput1 = GT_OreDictUnificator.get(true, aOutput1); + ItemStack aOutputs[] = new ItemStack[4]; + for (int i=0;i aCleanedItems = new AutoMap(); + for (ItemStack checkStack : input) { + if (ItemUtils.checkForInvalidItems(checkStack)) { + aCleanedItems.put(checkStack); + } + } + ItemStack[] aOutput = new ItemStack[aCleanedItems.size()]; + for (int i=0;i= 9) { + this.dropBlockAsItem(world, x, y, z, ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, MathUtils.randInt(1, 4))); + } + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java b/src/Java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java new file mode 100644 index 0000000000..dee5bf02fd --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java @@ -0,0 +1,24 @@ +package gtPlusPlus.xmod.bop.blocks.pine; + +import gtPlusPlus.xmod.bop.blocks.base.LogBase; + +public class LogPineTree extends LogBase { + + public LogPineTree(){ + super("Pine Log", "pine", new String[]{"pine"}); + this.treeType = new String[] {"pine"}; + } + + /*@Override + @SideOnly(Side.CLIENT) + protected IIcon getSideIcon(int metaID){ + return this.textureSide[metaID % this.textureSide.length]; + } + + @Override + @SideOnly(Side.CLIENT) + protected IIcon getTopIcon(int metaID){ + return this.textureTop[metaID % this.textureTop.length]; + }*/ + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java b/src/Java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java new file mode 100644 index 0000000000..0ee04de899 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java @@ -0,0 +1,55 @@ +package gtPlusPlus.xmod.bop.blocks.pine; + +import java.util.Random; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.bop.blocks.base.SaplingBase; +import gtPlusPlus.xmod.bop.world.features.trees.WorldGenPineTree; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class SaplingPineTree extends SaplingBase { + + public SaplingPineTree(){ + super("Pine Sapling", "pine", new String[]{"pine"}); + } + + @Override + public void func_149878_d(World world, int x, int y, int z, Random rand){ + Logger.WARNING("func_149878_d - 1"); + if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return; + rand.nextInt(10); + new WorldGenBigTree(true); + new WorldGenTrees(true); + int i1 = 0; + int j1 = 0; + boolean flag = false; + + Block block = Blocks.air; + + if (flag) + { + world.setBlock(x + i1, y, z + j1, block, 0, 4); + world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4); + world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4); + world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4); + } + else + { + world.setBlock(x, y, z, block, 0, 4); + } + Object obj = new WorldGenPineTree(); + if (obj != null) { + world.setBlockToAir(x, y, z); + if (!((WorldGenerator) obj).generate(world, CORE.RANDOM, x, y, z)) { + world.setBlock(x, y, z, this, 0, 2); + } + } + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java b/src/Java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java new file mode 100644 index 0000000000..831108ec99 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java @@ -0,0 +1,171 @@ +package gtPlusPlus.xmod.bop.world.features.trees; + +import java.util.Random; + +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenPineTree extends WorldGenAbstractTree{ + + public WorldGenPineTree() { + super(true); + } + + @Override + public boolean generate(World world, Random random, int x, int y, int z) { + while (world.isAirBlock(x, y, z) && y > 2) { + --y; + } + + Block aSoilBlock = world.getBlock(x, y, z); + + if (!canBlockSustainSapling(world, aSoilBlock, x, y, z)) { + return false; + } else { + int height; + int branches; + for (height = -2; height <= 2; ++height) { + for (branches = -2; branches <= 2; ++branches) { + if (world.isAirBlock(x + height, y - 1, z + branches) + && world.isAirBlock(x + height, y - 2, z + branches) + && !world.isAirBlock(x + height, y, z + branches)) { + return false; + } + } + } + + height = 2 + MathUtils.randInt(8, 16); + branches = 2 + MathUtils.randInt(6, 18); + int h = 1; + aSoilBlock.onPlantGrow(world, x, y - 1, z, x, y, z); + + int c; + int r = MathUtils.randInt(1, 3); + for (c = 0; c < height; ++c) { + this.buildBlock(world, x, y + h, z, BOP_Block_Registrator.log_Pine, 0); + h++; + if (c >= r && c % 2 == 0) { + this.generateBranch(world, random, x, y + h, z, c); + } + } + + this.generateTop(world, x, y + h, z); + return true; + } + } + + public void generateTop(World world, int x, int y, int z) { + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + this.buildBlock(world, x + i, y, z + j, BOP_Block_Registrator.leaves_Pine, 0); + } + } + + this.buildBlock(world, x, y, z, BOP_Block_Registrator.log_Pine, 0); + this.buildBlock(world, x + 1, y + 1, z, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x, y + 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x, y + 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x - 1, y + 1, z, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x, y + 2, z, BOP_Block_Registrator.leaves_Pine, 0); + } + + public void generateBranch(World world, Random rand, int x, int y, int z, int n) { + int var99999; + int var99998; + for (var99999 = -1; var99999 < 2; ++var99999) { + for (var99998 = -1; var99998 < 2; ++var99998) { + this.buildBlock(world, x + var99999, y, z + var99998, BOP_Block_Registrator.leaves_Pine, 0); + } + } + + var99999 = rand.nextInt(2); + var99998 = rand.nextInt(2); + int var99997 = rand.nextInt(2); + int var99996 = rand.nextInt(2); + if (n % 2 == 0) { + if (var99998 == 0) { + this.buildBlock(world, x + 1, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x + 2, y - 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0); + if (var99999 == 0) { + this.buildBlock(world, x + 2, y - 2, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + } else { + this.buildBlock(world, x + 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + } + } else { + this.buildBlock(world, x + 1, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x + 2, y, z - 1, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x + 2, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + } + + if (var99997 == 0) { + this.buildBlock(world, x - 2, y - 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x - 1, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + if (var99996 == 0) { + this.buildBlock(world, x - 2, y - 2, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + } else { + this.buildBlock(world, x - 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + } + } else { + this.buildBlock(world, x - 2, y, z + 1, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x - 1, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x - 2, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + } + } else { + if (var99998 == 0) { + this.buildBlock(world, x + 2, y - 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x + 1, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + if (var99999 == 0) { + this.buildBlock(world, x + 2, y - 2, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + } else { + this.buildBlock(world, x + 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + } + } else { + this.buildBlock(world, x + 2, y, z + 1, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x + 1, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + if (var99999 == 0) { + this.buildBlock(world, x + 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + } else { + this.buildBlock(world, x + 2, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0); + } + } + + if (var99997 == 0) { + this.buildBlock(world, x - 1, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x - 2, y - 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0); + if (var99996 == 0) { + this.buildBlock(world, x - 2, y - 2, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + } else { + this.buildBlock(world, x - 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + } + } else { + this.buildBlock(world, x - 1, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + this.buildBlock(world, x - 2, y, z - 1, BOP_Block_Registrator.leaves_Pine, 0); + if (var99996 == 0) { + this.buildBlock(world, x - 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + } else { + this.buildBlock(world, x - 2, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0); + } + } + } + + this.buildBlock(world, x, y, z, BOP_Block_Registrator.log_Pine, 0); + this.buildBlock(world, x, y + 1, z, BOP_Block_Registrator.log_Pine, 0); + } + + public void buildBlock(World world, int x, int y, int z, Block block, int meta) { + if (world.isAirBlock(x, y, z) || world.getBlock(x, y, z).isLeaves(world, x, y, z)) { + world.setBlock(x, y, z, block, meta, 2); + } + } + + public boolean canBlockSustainSapling(World world, Block block, int x, int y, int z) { + return block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index d4a25e03dd..da93fe212c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -46,9 +46,8 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { } private void generateRecipes(final Material material, final boolean disableOptional){ - final int tVoltageMultiplier = material.vVoltageMultiplier; - Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO + Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); final ItemStack normalDust = material.getDust(1); final ItemStack smallDust = material.getSmallDust(1); diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index fd8e59662b..0dc4b4e170 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3157,11 +3157,15 @@ item.FrothNickelflotation.name=Nickel Flotation Froth Cell item.FrothPlatinumflotation.name=Platinum Flotation Froth Cell item.FrothPentlanditeflotation.name=Pentlandite Flotation Froth Cell - +//Added 31/03/20 item.BasicGenericChemItem.9.name=Sodium Ethoxide Dust item.BasicGenericChemItem.10.name=Sodium Ethyl Xanthate Dust item.BasicGenericChemItem.11.name=Potassium Ethyl Xanthate Dust item.BasicGenericChemItem.12.name=Potassium Hydroxide Dust item.CarbonDisulfide.name=Carbon Disulfide Cell -item.HydrogenSulfide.name=Hydrogen Sulfide Cell \ No newline at end of file +item.HydrogenSulfide.name=Hydrogen Sulfide Cell + +item.BasicAgrichemItem.24.name=Pinecone +item.BasicAgrichemItem.25.name=Crushed Pine Materials +item.pineoil.name=Pine Oil Cell \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine.png b/src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine.png new file mode 100644 index 0000000000..68949e5f47 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine_opaque .png b/src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine_opaque .png new file mode 100644 index 0000000000..c7c0d6492f Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/trees/leaves/leaves_pine_opaque .png differ diff --git a/src/resources/assets/miscutils/textures/blocks/trees/saplings/sapling_pine.png b/src/resources/assets/miscutils/textures/blocks/trees/saplings/sapling_pine.png new file mode 100644 index 0000000000..f4c3ca84ac Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/trees/saplings/sapling_pine.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/24.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/24.png new file mode 100644 index 0000000000..0c065db4ce Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/24.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/25.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/25.png new file mode 100644 index 0000000000..168b15adb3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/25.png differ -- cgit From 59887a8c72f8f9e7d2679d33bfa49b563a920298 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Sat, 11 Apr 2020 22:57:17 +0100 Subject: + Added some localization for the new milling products. --- src/resources/assets/miscutils/lang/en_US.lang | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/resources/assets/miscutils/lang') diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 0dc4b4e170..cb477971ac 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3147,25 +3147,33 @@ item.milledSphalerite.name=Milled Sphalerite item.milledNickel.name=Milled Nickel item.milledPlatinum.name=Milled Platinum item.milledPentlandite.name=Milled Pentlandite - -item.BasicGenericChemItem.7.name=Alumina Milling Ball -item.BasicGenericChemItem.8.name=Soapstone Milling Ball - item.FrothZincflotation.name=Sphalerite Flotation Froth Cell item.FrothCopperflotation.name=Chalcopyrite Flotation Froth Cell item.FrothNickelflotation.name=Nickel Flotation Froth Cell item.FrothPlatinumflotation.name=Platinum Flotation Froth Cell item.FrothPentlanditeflotation.name=Pentlandite Flotation Froth Cell +item.BasicGenericChemItem.7.name=Alumina Milling Ball +item.BasicGenericChemItem.8.name=Soapstone Milling Ball //Added 31/03/20 item.BasicGenericChemItem.9.name=Sodium Ethoxide Dust item.BasicGenericChemItem.10.name=Sodium Ethyl Xanthate Dust item.BasicGenericChemItem.11.name=Potassium Ethyl Xanthate Dust item.BasicGenericChemItem.12.name=Potassium Hydroxide Dust - item.CarbonDisulfide.name=Carbon Disulfide Cell item.HydrogenSulfide.name=Hydrogen Sulfide Cell - item.BasicAgrichemItem.24.name=Pinecone item.BasicAgrichemItem.25.name=Crushed Pine Materials -item.pineoil.name=Pine Oil Cell \ No newline at end of file +item.pineoil.name=Pine Oil Cell + +//Added 11/4/20 +item.milledRedstone.name=Milled Redstone +item.milledSpessartine.name=Milled Spessartine +item.milledGrossular.name=Milled Grossular +item.milledAlmandine.name=Milled Almandine +item.milledPyrope.name=Milled Pyrope +item.FrothRedstoneflotation.name=Redstone Flotation Froth Cell +item.FrothSpessartineflotation.name=Spessartine Flotation Froth Cell +item.FrothGrossularflotation.name=Grossular Flotation Froth Cell +item.FrothAlmandineflotation.name=Almandine Flotation Froth Cell +item.FrothPyropeflotation.name=Pyrope Flotation Froth Cell \ No newline at end of file -- cgit From 492aa5becc6c49cc3afde8c855b5bbcdc5055e51 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 14 Apr 2020 00:05:16 +0100 Subject: + Added an Advanced Hazmat Suit. + Added a T3 circuit for recipe selections. $ Disabled TT Thaumic Repairer patch. $ Fixed a bug in EnumUtils not correctly handling missing entries. --- src/Java/gtPlusPlus/core/common/CommonProxy.java | 26 +--- .../gtPlusPlus/core/handler/EnumHelperHandler.java | 21 +++ .../core/item/chemistry/GenericChem.java | 78 ++++++++-- .../core/item/circuit/ItemAdvancedChip.java | 138 ++++++++++++++++++ .../item/wearable/hazmat/ItemArmorHazmatEx.java | 31 ++++ src/Java/gtPlusPlus/core/recipe/common/CI.java | 4 + src/Java/gtPlusPlus/core/util/data/EnumUtils.java | 7 +- .../core/util/reflect/ReflectionUtils.java | 24 ++++ .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 10 +- src/Java/gtPlusPlus/preloader/asm/AsmConfig.java | 9 ++ .../ClassTransformer_TT_ThaumicRestorer.java | 158 ++++++++++++++++++++- .../Preloader_Transformer_Handler.java | 7 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 7 + .../gtPlusPlus/xmod/ic2/CustomInternalName.java | 27 ++++ src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java | 3 + .../gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java | 87 ++++++++++++ src/resources/assets/ic2/lang/en_US.lang | 6 + .../assets/ic2/textures/armor/hazmatEx_1.png | Bin 0 -> 2669 bytes .../assets/ic2/textures/armor/hazmatEx_2.png | Bin 0 -> 967 bytes .../textures/items/itemArmorHazmatChestplateEx.png | Bin 0 -> 525 bytes .../ic2/textures/items/itemArmorHazmatHelmetEx.png | Bin 0 -> 464 bytes .../textures/items/itemArmorHazmatLeggingsEx.png | Bin 0 -> 418 bytes .../ic2/textures/items/itemArmorRubBootsEx.png | Bin 0 -> 459 bytes src/resources/assets/miscutils/lang/en_US.lang | 5 +- .../items/science/general/AdvancedCircuit.png | Bin 0 -> 515 bytes 25 files changed, 595 insertions(+), 53 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/handler/EnumHelperHandler.java create mode 100644 src/Java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java create mode 100644 src/Java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java create mode 100644 src/Java/gtPlusPlus/xmod/ic2/CustomInternalName.java create mode 100644 src/resources/assets/ic2/textures/armor/hazmatEx_1.png create mode 100644 src/resources/assets/ic2/textures/armor/hazmatEx_2.png create mode 100644 src/resources/assets/ic2/textures/items/itemArmorHazmatChestplateEx.png create mode 100644 src/resources/assets/ic2/textures/items/itemArmorHazmatHelmetEx.png create mode 100644 src/resources/assets/ic2/textures/items/itemArmorHazmatLeggingsEx.png create mode 100644 src/resources/assets/ic2/textures/items/itemArmorRubBootsEx.png create mode 100644 src/resources/assets/miscutils/textures/items/science/general/AdvancedCircuit.png (limited to 'src/resources/assets/miscutils/lang') diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 0aeff5ae16..4dad732e25 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -1,10 +1,6 @@ package gtPlusPlus.core.common; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLLoadCompleteEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; @@ -19,18 +15,8 @@ import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.fluids.FluidFactory; -import gtPlusPlus.core.handler.BookHandler; -import gtPlusPlus.core.handler.BurnableFuelHandler; -import gtPlusPlus.core.handler.COMPAT_HANDLER; -import gtPlusPlus.core.handler.COMPAT_IntermodStaging; -import gtPlusPlus.core.handler.GuiHandler; -import gtPlusPlus.core.handler.StopAnnoyingFuckingAchievements; -import gtPlusPlus.core.handler.events.BlockEventHandler; -import gtPlusPlus.core.handler.events.EnderDragonDeathHandler; -import gtPlusPlus.core.handler.events.EntityDeathHandler; -import gtPlusPlus.core.handler.events.GeneralTooltipEventHandler; -import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler; -import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler; +import gtPlusPlus.core.handler.*; +import gtPlusPlus.core.handler.events.*; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.GenericChem; import gtPlusPlus.core.lib.CORE; @@ -50,7 +36,6 @@ import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO; import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC; -import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler; import net.minecraft.enchantment.Enchantment; @@ -89,10 +74,7 @@ public class CommonProxy { } AddToCreativeTab.initialiseTabs(); - - if (LoadedMods.Gregtech) { - HANDLER_GT.addNewOrePrefixes(); - } + EnumHelperHandler.init(); // Moved from Init after Debug Loading. // 29/01/18 - Alkalus diff --git a/src/Java/gtPlusPlus/core/handler/EnumHelperHandler.java b/src/Java/gtPlusPlus/core/handler/EnumHelperHandler.java new file mode 100644 index 0000000000..d164efa3d7 --- /dev/null +++ b/src/Java/gtPlusPlus/core/handler/EnumHelperHandler.java @@ -0,0 +1,21 @@ +package gtPlusPlus.core.handler; + +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.HANDLER_GT; +import gtPlusPlus.xmod.ic2.CustomInternalName; + +public class EnumHelperHandler { + + public static void init() { + + if (LoadedMods.IndustrialCraft2) { + CustomInternalName.init(); + } + + if (LoadedMods.Gregtech) { + HANDLER_GT.addNewOrePrefixes(); + } + + } + +} diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index 488151a773..fbbc1d24eb 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -1,18 +1,13 @@ package gtPlusPlus.core.item.chemistry; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.TextureSet; +import gregtech.api.enums.*; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; +import gtPlusPlus.core.item.circuit.ItemAdvancedChip; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.MISC_MATERIALS; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.MaterialGenerator; -import gtPlusPlus.core.material.MaterialStack; -import gtPlusPlus.core.material.NONMATERIAL; +import gtPlusPlus.core.material.*; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; @@ -25,10 +20,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.*; public class GenericChem extends ItemPackage { @@ -106,6 +98,7 @@ public class GenericChem extends ItemPackage { // Phenol Byproducts public Item PhenolicResins; //https://en.wikipedia.org/wiki/Phenol_formaldehyde_resin public static ItemGenericChemBase mGenericChemItem1; + public static Item mAdvancedCircuit; private ItemStack mCatalystCarrier; @@ -134,7 +127,9 @@ public class GenericChem extends ItemPackage { MaterialGenerator.generate(NYLON, false); MaterialGenerator.generate(TEFLON, false); - mGenericChemItem1 = new ItemGenericChemBase(); + mGenericChemItem1 = new ItemGenericChemBase(); + mAdvancedCircuit = new ItemAdvancedChip(); + GregtechItemList.Circuit_T3RecipeSelector.set(mAdvancedCircuit); registerItemStacks(); registerOreDict(); @@ -292,6 +287,7 @@ public class GenericChem extends ItemPackage { @Override public boolean generateRecipes() { + recipeAdvancedChip(); recipeCatalystRed(); recipeCatalystYellow(); recipeCatalystBlue(); @@ -1066,6 +1062,60 @@ public class GenericChem extends ItemPackage { return CI.getNumberedBioCircuit(16); } + private static void recipeAdvancedChip() { + GT_ModHandler.addShapelessCraftingRecipe( + GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Advanced)}); + + long bits = 0; + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, + new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, + new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits, + new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits, + new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits, + new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits, + new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits, + new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits, + new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits, + new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits, + new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits, + new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits, + new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits, + new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits, + new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits, + new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits, + new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits, + new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits, + new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits, + new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits, + new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits, + new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits, + new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits, + new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits, + new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + } } diff --git a/src/Java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java b/src/Java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java new file mode 100644 index 0000000000..c375c32952 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java @@ -0,0 +1,138 @@ +package gtPlusPlus.core.item.circuit; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemAdvancedChip extends Item { + + protected IIcon base; + + public ItemAdvancedChip() { + this.setHasSubtypes(true); + this.setNoRepair(); + this.setMaxStackSize(64); + this.setMaxDamage(0); + this.setUnlocalizedName("T3RecipeSelector"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return super.getItemStackDisplayName(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + try { + aList.add("Configuration == "+aStack.getItemDamage()); + } + catch (Throwable t) { + t.printStackTrace(); + } + super.addInformation(aStack, p_77624_2_, aList, p_77624_4_); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.common; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1)); + } + + @Override + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + @Override + public boolean isRepairable() { + return false; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return stack.getItemDamage(); + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getItemEnchantability(ItemStack stack) { + return 0; + } + + @Override + public void registerIcons(final IIconRegister u) { + this.base = u.registerIcon(CORE.MODID + ":" + "science/general/AdvancedCircuit"); + } + + @Override + public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { + return this.base; + } + + @Override + public IIcon getIconFromDamage(int damage) { + return this.base; + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + return this.base; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return this.base; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return super.getUnlocalizedName(); + } + + +} diff --git a/src/Java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java b/src/Java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java new file mode 100644 index 0000000000..1f8009e54a --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java @@ -0,0 +1,31 @@ +package gtPlusPlus.core.item.wearable.hazmat; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.ic2.CustomInternalName; +import ic2.core.IC2; +import ic2.core.init.InternalName; +import ic2.core.item.armor.ItemArmorHazmat; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; + +public class ItemArmorHazmatEx extends ItemArmorHazmat { + + public static void init() { + GregtechItemList.Armour_Hazmat_Advanced_Helmet.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatHelmetEx, 0))); + GregtechItemList.Armour_Hazmat_Advanced_Chest.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatChestEx, 1))); + GregtechItemList.Armour_Hazmat_Advanced_Legs.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatLegsEx, 2))); + GregtechItemList.Armour_Hazmat_Advanced_Boots.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatBootsEx, 3))); + } + + private ItemArmorHazmatEx(InternalName internalName, int type) { + super(internalName, type); + this.setMaxDamage(256); + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + int suffix = this.armorType == 2 ? 2 : 1; + return IC2.textureDomain + ":textures/armor/" + "hazmatEx_" + suffix + ".png"; + } + +} diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index d67a372572..93ede378a8 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -1235,6 +1235,10 @@ public class CI { return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, i, 0); } + public static ItemStack getNumberedAdvancedCircuit(int i) { + return ItemUtils.simpleMetaStack(GenericChem.mAdvancedCircuit, i, 0); + } + public static ItemStack getTieredGTPPMachineCasing(int aTier, int aAmount) { GregtechItemList[] aHulls = new GregtechItemList[] { GregtechItemList.GTPP_Casing_ULV, diff --git a/src/Java/gtPlusPlus/core/util/data/EnumUtils.java b/src/Java/gtPlusPlus/core/util/data/EnumUtils.java index 9c96b61876..edcc071b54 100644 --- a/src/Java/gtPlusPlus/core/util/data/EnumUtils.java +++ b/src/Java/gtPlusPlus/core/util/data/EnumUtils.java @@ -12,10 +12,13 @@ public class EnumUtils { **/ public static > T getValue(Class enumeration, String name) { Optional j = Enums.getIfPresent(enumeration, name); - T VALUE = j.get(); - if (j.get() == null) { + T VALUE; + if (j == null || !j.isPresent()) { VALUE = valueOfIgnoreCase(enumeration, name); } + else { + VALUE = j.get(); + } return VALUE; } diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 8b9b5cf94f..e0634dfb14 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -508,6 +508,30 @@ public class ReflectionUtils { Logger.REFLECTION("Invoke failed or did something wrong."); return false; } + + public static boolean invokeVoid(Object objectInstance, Method method, Object[] values){ + if (method == null || values == null || (!ReflectionUtils.isStaticMethod(method) && objectInstance == null)){ + //Logger.REFLECTION("Null value when trying to Dynamically invoke "+methodName+" on an object of type: "+objectInstance.getClass().getName()); + return false; + } + String methodName = method.getName(); + String classname = objectInstance != null ? objectInstance.getClass().getCanonicalName() : method.getDeclaringClass().getCanonicalName(); + Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+classname+"."); + try { + Method mInvokingMethod = method; + if (mInvokingMethod != null){ + Logger.REFLECTION(methodName+" was not null."); + mInvokingMethod.invoke(objectInstance, values); + Logger.REFLECTION("Successfully invoked "+methodName+"."); + return true; + } + } + catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+classname); + } + Logger.REFLECTION("Invoke failed or did something wrong."); + return false; + } public static boolean invokeVoid(Object objectInstance, String methodName, Class[] parameters, Object[] values){ if (objectInstance == null || methodName == null || parameters == null || values == null){ diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java index f6a59e3900..490b94d71c 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -23,11 +23,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.MaterialUtils; -import gtPlusPlus.core.util.minecraft.OreDictUtils; -import gtPlusPlus.core.util.minecraft.RecipeUtils; +import gtPlusPlus.core.util.minecraft.*; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.plugin.agrichem.block.AgrichemFluids; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -1323,14 +1319,10 @@ public class BioRecipes { } private static void recipeBioChip() { - GT_ModHandler.addShapelessCraftingRecipe( GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}); long bits = 0; - - - addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, diff --git a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java index d0c59726de..a5981b15d9 100644 --- a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java +++ b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java @@ -30,6 +30,7 @@ public class AsmConfig { public static boolean enableTcAspectSafety; public static boolean enabledLwjglKeybindingFix; public static boolean enabledFixEntitySetHealth; + public static boolean enableThaumicTinkererRepairFix; public static boolean disableAllLogging; public static boolean debugMode; @@ -96,6 +97,14 @@ public class AsmConfig { 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); + enableThaumicTinkererRepairFix = prop.getBoolean(false); + propOrderDebug.add(prop.getName()); + + + diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java index 1dc8c3bc38..05b8054ff8 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java @@ -2,19 +2,147 @@ package gtPlusPlus.preloader.asm.transformers; import static org.objectweb.asm.Opcodes.*; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + import org.apache.logging.log4j.Level; import org.objectweb.asm.*; +import cpw.mods.fml.common.Loader; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.Preloader_Logger; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; public class ClassTransformer_TT_ThaumicRestorer { private final boolean isValid; private final ClassReader reader; private final ClassWriter writer; + + private static boolean mInit = false; + + private static Class mTileRepairerClass; + private static Class mTTConfigHandler; + private static Class mTinkersConstructCompat; + private static Class mThaumicTinkerer; + private static Class mTCProxy; + + private static Method mIsTcTool; + private static Method mGetTcDamage; + private static Method mFixTcDamage; + private static Method mSparkle; + private static Method mDrawEssentia; + + private static Field mRepairTiconTools; + private static Field mTicksExisted; + private static Field mInventory; + private static Field mTookLastTick; + private static Field mDamageLastTick; + private static Field mProxyTC; + + private static boolean repairTConTools = false; // thaumic.tinkerer.common.block.tile.TileRepairer + private static final boolean isTConstructTool(ItemStack aStack) { + return ReflectionUtils.invoke(null, mIsTcTool, new Object[] {aStack}); + } + private static final int getDamage(ItemStack aStack) { + return (int) ReflectionUtils.invokeNonBool(null, mGetTcDamage, new Object[] {aStack}); + } + private static final boolean fixDamage(ItemStack aStack, int aAmount) { + return ReflectionUtils.invoke(null, mFixTcDamage, new Object[] {aStack, aAmount}); + } + private static final int drawEssentia(TileEntity aTile) { + return (int) ReflectionUtils.invokeNonBool(aTile, mDrawEssentia, new Object[] {}); + } + private static final void sparkle(float a, float b, float c, int d) { + ReflectionUtils.invokeVoid(ReflectionUtils.getFieldValue(mProxyTC), mSparkle, new Object[] {a, b, c, d}); + } + + public static void updateEntity(TileEntity aTile) { + if (!mInit) { + // Set the classes we need + mTileRepairerClass = ReflectionUtils.getClass("thaumic.tinkerer.common.block.tile.TileRepairer"); + mTTConfigHandler = ReflectionUtils.getClass("thaumic.tinkerer.common.core.handler.ConfigHandler"); + mTinkersConstructCompat = ReflectionUtils.getClass("thaumic.tinkerer.common.compat.TinkersConstructCompat"); + mThaumicTinkerer = ReflectionUtils.getClass("thaumic.tinkerer.common.ThaumicTinkerer"); + mTCProxy = ReflectionUtils.getClass("thaumcraft.common.CommonProxy"); + // Set the methods we need + mIsTcTool = ReflectionUtils.getMethod(mTinkersConstructCompat, "isTConstructTool", new Class[] {ItemStack.class}); + mGetTcDamage = ReflectionUtils.getMethod(mTinkersConstructCompat, "getDamage", new Class[] {ItemStack.class}); + mFixTcDamage = ReflectionUtils.getMethod(mTinkersConstructCompat, "fixDamage", new Class[] {ItemStack.class, int.class}); + mSparkle = ReflectionUtils.getMethod(mTCProxy, "sparkle", new Class[] {float.class, float.class, float.class, int.class}); + mDrawEssentia = ReflectionUtils.getMethod(mTileRepairerClass, "drawEssentia", new Class[] {}); + // Set the fields we need + mRepairTiconTools = ReflectionUtils.getField(mTTConfigHandler, "repairTConTools"); + mTicksExisted = ReflectionUtils.getField(mTileRepairerClass, "ticksExisted"); + mInventory = ReflectionUtils.getField(mTileRepairerClass, "inventorySlots"); + mTookLastTick = ReflectionUtils.getField(mTileRepairerClass, "tookLastTick"); + mDamageLastTick = ReflectionUtils.getField(mTileRepairerClass, "dmgLastTick"); + mProxyTC = ReflectionUtils.getField(mThaumicTinkerer, "tcProxy"); + repairTConTools = (boolean) ReflectionUtils.getFieldValue(mRepairTiconTools); + mInit = true; + } + if (mInit) { + if (mTileRepairerClass.isInstance(aTile)) { + int ticksExisted = (int) ReflectionUtils.getFieldValue(mTicksExisted, aTile); + ItemStack[] inventorySlots = (ItemStack[]) ReflectionUtils.getFieldValue(mInventory, aTile); + boolean tookLastTick = (boolean) ReflectionUtils.getFieldValue(mTookLastTick, aTile); + int dmgLastTick = (int) ReflectionUtils.getFieldValue(mDamageLastTick, aTile); + ticksExisted++; + ReflectionUtils.setField(aTile, mTicksExisted, ticksExisted); + boolean aDidRun = false; + if (ticksExisted % 10 == 0) { + if (Loader.isModLoaded("TConstruct") && repairTConTools && inventorySlots[0] != null && isTConstructTool(inventorySlots[0])) { + final int dmg = getDamage(inventorySlots[0]); + if (dmg > 0) { + final int essentia = drawEssentia(aTile); + fixDamage(inventorySlots[0], essentia); + aTile.markDirty(); + if (dmgLastTick != 0 && dmgLastTick != dmg) { + sparkle((float)(aTile.xCoord + 0.25 + Math.random() / 2.0), (float)(aTile.yCoord + 1 + Math.random() / 2.0), (float)(aTile.zCoord + 0.25 + Math.random() / 2.0), 0); + tookLastTick = true; + } + else { + tookLastTick = false; + } + } + else { + tookLastTick = false; + } + dmgLastTick = ((inventorySlots[0] == null) ? 0 : getDamage(inventorySlots[0])); + aDidRun = true; + } + if (inventorySlots[0] != null && inventorySlots[0].getItemDamage() > 0 && inventorySlots[0].getItem().isRepairable()) { + final int essentia2 = drawEssentia(aTile); + final int dmg2 = inventorySlots[0].getItemDamage(); + inventorySlots[0].setItemDamage(Math.max(0, dmg2 - essentia2)); + aTile.markDirty(); + if (dmgLastTick != 0 && dmgLastTick != dmg2) { + sparkle((float)(aTile.xCoord + 0.25 + Math.random() / 2.0), (float)(aTile.yCoord + 1 + Math.random() / 2.0), (float)(aTile.zCoord + 0.25 + Math.random() / 2.0), 0); + tookLastTick = true; + } + else { + tookLastTick = false; + } + } + else { + tookLastTick = false; + } + dmgLastTick = ((inventorySlots[0] == null) ? 0 : inventorySlots[0].getItemDamage()); + aDidRun = true; + } + if (aDidRun) { + ReflectionUtils.setField(aTile, mInventory, inventorySlots); + ReflectionUtils.setField(aTile, mTookLastTick, tookLastTick); + ReflectionUtils.setField(aTile, mDamageLastTick, dmgLastTick); + } + } + } + } + public ClassTransformer_TT_ThaumicRestorer(byte[] basicClass) { ClassReader aTempReader = null; ClassWriter aTempWriter = null; @@ -26,7 +154,8 @@ public class ClassTransformer_TT_ThaumicRestorer { obfuscated = aMethodStripper.isObfuscated; String aUpdateEntity = obfuscated ? "func_145845_h" : "updateEntity"; Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Patching: "+aUpdateEntity+", Are we patching obfuscated methods? "+obfuscated); - injectMethod(aUpdateEntity, aTempWriter, obfuscated); + //injectMethod(aUpdateEntity, aTempWriter, obfuscated); + injectMethodNew(aTempWriter, obfuscated); if (aTempReader != null && aTempWriter != null) { isValid = true; } @@ -49,6 +178,33 @@ public class ClassTransformer_TT_ThaumicRestorer { public ClassWriter getWriter() { return writer; } + + public boolean injectMethodNew(ClassWriter cw, boolean obfuscated) { + MethodVisitor mv; + boolean didInject = false; + String aUpdateEntity = obfuscated ? "func_145845_h" : "updateEntity"; + String aTileEntity = obfuscated ? "aor" : "net/minecraft/tileentity/TileEntity"; + Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Injecting " + aUpdateEntity + "."); + mv = cw.visitMethod(ACC_PUBLIC, aUpdateEntity, "()V", null, null); + mv.visitCode(); + Label l0 = new Label(); + mv.visitLabel(l0); + mv.visitLineNumber(60, l0); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer", "updateEntity", "(L"+aTileEntity+";)V", false); + Label l1 = new Label(); + mv.visitLabel(l1); + mv.visitLineNumber(61, l1); + mv.visitInsn(RETURN); + Label l2 = new Label(); + mv.visitLabel(l2); + mv.visitLocalVariable("this", "Lthaumic/tinkerer/common/block/tile/TileRepairer;", null, l0, l2, 0); + mv.visitMaxs(1, 1); + mv.visitEnd(); + didInject = true; + Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Method injection complete. "+(obfuscated ? "Obfuscated" : "Non-Obfuscated")); + return didInject; + } public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) { MethodVisitor mv; diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java index 398e69a2f9..cb9799fce7 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java @@ -272,10 +272,9 @@ public class Preloader_Transformer_Handler implements IClassTransformer { return new ClassTransformer_TC_ItemWispEssence(basicClass, obfuscated).getWriter().toByteArray(); } //Fix Thaumic Tinkerer Shit - //Patching ItemWispEssence to allow invalid item handling - if (transformedName.equals(THAUMICTINKERER_TILE_REPAIRER)) { - Preloader_Logger.INFO("Thaumic Tinkerer RepairItem Patch", "Transforming "+transformedName); - return new ClassTransformer_TT_ThaumicRestorer(basicClass).getWriter().toByteArray(); + if (transformedName.equals(THAUMICTINKERER_TILE_REPAIRER) && AsmConfig.enableThaumicTinkererRepairFix) { + //Preloader_Logger.INFO("Thaumic Tinkerer RepairItem Patch", "Transforming "+transformedName); + //return new ClassTransformer_TT_ThaumicRestorer(basicClass).getWriter().toByteArray(); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 173b260d57..b7662ca25e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -19,6 +19,12 @@ public enum GregtechItemList implements GregtechItemContainer { /** * Items */ + + // Advanced Hazmat Suit + Armour_Hazmat_Advanced_Helmet, + Armour_Hazmat_Advanced_Chest, + Armour_Hazmat_Advanced_Legs, + Armour_Hazmat_Advanced_Boots, //Gregtech Machine Parts Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, Electric_Motor_MAX, @@ -49,6 +55,7 @@ public enum GregtechItemList implements GregtechItemContainer { //Recipe Circuit Circuit_BioRecipeSelector, + Circuit_T3RecipeSelector, //Circuits Old_Circuit_Primitive, Old_Circuit_Basic, Old_Circuit_Good, diff --git a/src/Java/gtPlusPlus/xmod/ic2/CustomInternalName.java b/src/Java/gtPlusPlus/xmod/ic2/CustomInternalName.java new file mode 100644 index 0000000000..18fb286d15 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/ic2/CustomInternalName.java @@ -0,0 +1,27 @@ +package gtPlusPlus.xmod.ic2; + +import gtPlusPlus.core.util.data.EnumUtils; +import ic2.core.init.InternalName; +import net.minecraftforge.common.util.EnumHelper; + +public class CustomInternalName { + + public static InternalName aHazmatHelmetEx; + public static InternalName aHazmatChestEx; + public static InternalName aHazmatLegsEx; + public static InternalName aHazmatBootsEx; + + public static void init() { + EnumHelper.addEnum(InternalName.class, "itemArmorHazmatHelmetEx", new Class[] {}, new Object[] {}); + EnumHelper.addEnum(InternalName.class, "itemArmorHazmatChestplateEx", new Class[] {}, new Object[] {}); + EnumHelper.addEnum(InternalName.class, "itemArmorHazmatLeggingsEx", new Class[] {}, new Object[] {}); + EnumHelper.addEnum(InternalName.class, "itemArmorRubBootsEx", new Class[] {}, new Object[] {}); + aHazmatHelmetEx = EnumUtils.getValue(InternalName.class, "itemArmorHazmatHelmetEx"); + aHazmatChestEx = EnumUtils.getValue(InternalName.class, "itemArmorHazmatChestplateEx"); + aHazmatLegsEx = EnumUtils.getValue(InternalName.class, "itemArmorHazmatLeggingsEx"); + aHazmatBootsEx = EnumUtils.getValue(InternalName.class, "itemArmorRubBootsEx"); + } + + + +} diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java index 862ba38748..8c8b2ea7ad 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java +++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.ic2.item; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.CoreItem; +import gtPlusPlus.core.item.wearable.hazmat.ItemArmorHazmatEx; import gtPlusPlus.core.lib.LoadedMods; import net.minecraft.item.ItemStack; @@ -52,6 +53,8 @@ public class IC2_Items { rotor_Material_2 = new ItemStack (new CustomKineticRotor(1)); rotor_Material_3 = new ItemStack (new CustomKineticRotor(2)); rotor_Material_4 = new ItemStack (new CustomKineticRotor(3)); + + ItemArmorHazmatEx.init(); } } diff --git a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java index 6c43e2b6e0..1f5f9abe1d 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java +++ b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.ic2.recipe; import static gtPlusPlus.core.recipe.RECIPES_Tools.*; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import gregtech.api.enums.*; @@ -12,10 +13,15 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.ic2.item.IC2_Items; +import ic2.core.Ic2Items; public class RECIPE_IC2 { @@ -84,6 +90,7 @@ public class RECIPE_IC2 { public static void initRecipes() { checkForEnderIO(); + addAdvancedHazmat(); if (!CORE.GTNH) { //Rotor Blade Recipes @@ -236,4 +243,84 @@ public class RECIPE_IC2 { } + + private static void addAdvancedHazmat() { + + ItemStack[] aBasicHazmatPieces = new ItemStack[] { + Ic2Items.hazmatHelmet.copy(), + Ic2Items.hazmatChestplate.copy(), + Ic2Items.hazmatLeggings.copy(), + Ic2Items.hazmatBoots.copy() + }; + + Material aRubber = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubber); + ItemStack aYellowWool = ItemUtils.getSimpleStack(Blocks.wool, 4, 1); + ItemStack aBlackWool = ItemUtils.getSimpleStack(Blocks.wool, 15, 1); + ItemStack aCoilIC2 = Ic2Items.coil; + ItemStack aPlateCobalt = CI.getTieredComponentOfMaterial(Materials.Cobalt, OrePrefixes.plate, 1); + ItemStack aGearSmallSteel = CI.getTieredComponentOfMaterial(Materials.Steel, OrePrefixes.gearGtSmall, 1); + ItemStack aGearSmallAluminium = CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.gearGtSmall, 1); + ItemStack aGearPotin = ALLOY.TUMBAGA.getGear(1); + ItemStack aGearSiliconCarbide = ALLOY.SILICON_CARBIDE.getGear(1); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(2), + aBasicHazmatPieces[0], + ItemUtils.getSimpleStack(aYellowWool,16), + ItemUtils.getSimpleStack(aPlateCobalt, 4), + ItemUtils.getSimpleStack(aCoilIC2, 8), + ItemUtils.getSimpleStack(aGearSmallAluminium, 4), + }, + aRubber.getFluid(144 * 4), + GregtechItemList.Armour_Hazmat_Advanced_Helmet.get(1), + 30 * 20, + MaterialUtils.getVoltageForTier(2)); + + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(2), + aBasicHazmatPieces[1], + ItemUtils.getSimpleStack(aYellowWool, 64), + ItemUtils.getSimpleStack(aCoilIC2, 32), + ItemUtils.getSimpleStack(aPlateCobalt, 16), + ItemUtils.getSimpleStack(aGearSiliconCarbide, 8), + }, + aRubber.getFluid(144 * 10), + GregtechItemList.Armour_Hazmat_Advanced_Chest.get(1), + 90 * 20, + MaterialUtils.getVoltageForTier(2)); + + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(2), + aBasicHazmatPieces[2], + ItemUtils.getSimpleStack(aYellowWool, 32), + ItemUtils.getSimpleStack(aCoilIC2, 16), + ItemUtils.getSimpleStack(aPlateCobalt, 8), + ItemUtils.getSimpleStack(aGearSiliconCarbide, 4), + }, + aRubber.getFluid(144 * 8), + GregtechItemList.Armour_Hazmat_Advanced_Legs.get(1), + 75 * 20, + MaterialUtils.getVoltageForTier(2)); + + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(2), + aBasicHazmatPieces[3], + ItemUtils.getSimpleStack(aBlackWool, 16), + ItemUtils.getSimpleStack(aCoilIC2, 6), + ItemUtils.getSimpleStack(aGearSmallSteel, 8), + ItemUtils.getSimpleStack(aGearPotin, 4), + }, + aRubber.getFluid(144 * 6), + GregtechItemList.Armour_Hazmat_Advanced_Boots.get(1), + 45 * 20, + MaterialUtils.getVoltageForTier(2)); + + } } diff --git a/src/resources/assets/ic2/lang/en_US.lang b/src/resources/assets/ic2/lang/en_US.lang index 3fb59885d4..9b44f2d14e 100644 --- a/src/resources/assets/ic2/lang/en_US.lang +++ b/src/resources/assets/ic2/lang/en_US.lang @@ -27,3 +27,9 @@ ic2.SulfuricLithium=Sulfuric Lithium Cell ic2.UraniumHexaFluoride=Uranium Hexafluoride Cell ic2.ThoriumTetraFluoride=Thorium Tetrafluoride Cell ic2.UraniumTetraFluoride=Uranium Tetrafluoride Cell + + +ic2.itemArmorHazmatHelmetEx=Advanced Hazmat Helmet +ic2.itemArmorHazmatChestplateEx=Advanced Hazmat Suit +ic2.itemArmorHazmatLeggingsEx=Advanced Hazmat Leggings +ic2.itemArmorRubBootsEx=Advanced Hazmat Boots \ No newline at end of file diff --git a/src/resources/assets/ic2/textures/armor/hazmatEx_1.png b/src/resources/assets/ic2/textures/armor/hazmatEx_1.png new file mode 100644 index 0000000000..2275007fbe Binary files /dev/null and b/src/resources/assets/ic2/textures/armor/hazmatEx_1.png differ diff --git a/src/resources/assets/ic2/textures/armor/hazmatEx_2.png b/src/resources/assets/ic2/textures/armor/hazmatEx_2.png new file mode 100644 index 0000000000..758adafdf2 Binary files /dev/null and b/src/resources/assets/ic2/textures/armor/hazmatEx_2.png differ diff --git a/src/resources/assets/ic2/textures/items/itemArmorHazmatChestplateEx.png b/src/resources/assets/ic2/textures/items/itemArmorHazmatChestplateEx.png new file mode 100644 index 0000000000..742d1d7035 Binary files /dev/null and b/src/resources/assets/ic2/textures/items/itemArmorHazmatChestplateEx.png differ diff --git a/src/resources/assets/ic2/textures/items/itemArmorHazmatHelmetEx.png b/src/resources/assets/ic2/textures/items/itemArmorHazmatHelmetEx.png new file mode 100644 index 0000000000..5340375595 Binary files /dev/null and b/src/resources/assets/ic2/textures/items/itemArmorHazmatHelmetEx.png differ diff --git a/src/resources/assets/ic2/textures/items/itemArmorHazmatLeggingsEx.png b/src/resources/assets/ic2/textures/items/itemArmorHazmatLeggingsEx.png new file mode 100644 index 0000000000..80cdca9b23 Binary files /dev/null and b/src/resources/assets/ic2/textures/items/itemArmorHazmatLeggingsEx.png differ diff --git a/src/resources/assets/ic2/textures/items/itemArmorRubBootsEx.png b/src/resources/assets/ic2/textures/items/itemArmorRubBootsEx.png new file mode 100644 index 0000000000..901a8fbc35 Binary files /dev/null and b/src/resources/assets/ic2/textures/items/itemArmorRubBootsEx.png differ diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index cb477971ac..df6fbaa5b3 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3176,4 +3176,7 @@ item.FrothRedstoneflotation.name=Redstone Flotation Froth Cell item.FrothSpessartineflotation.name=Spessartine Flotation Froth Cell item.FrothGrossularflotation.name=Grossular Flotation Froth Cell item.FrothAlmandineflotation.name=Almandine Flotation Froth Cell -item.FrothPyropeflotation.name=Pyrope Flotation Froth Cell \ No newline at end of file +item.FrothPyropeflotation.name=Pyrope Flotation Froth Cell + +//Added 13/04/20 +item.T3RecipeSelector.name=Programmed Breakthrough Circuit \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/items/science/general/AdvancedCircuit.png b/src/resources/assets/miscutils/textures/items/science/general/AdvancedCircuit.png new file mode 100644 index 0000000000..8bcfa62ae4 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/general/AdvancedCircuit.png differ -- cgit