From e28ccb5d6b678245c2f78f910e6c39aa29fb3793 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 14 Feb 2022 21:25:31 +0000 Subject: Screwdriver driven development. (#124) * Added NEI handler for TGS. Added BoP support to TGS. Added base work for LFH. * Added Witchery support to TGS. * Finished LFH. Added missing steam multiblock. Fixed GT++ NEI time values not being precise enough. * Implement Fert use in TGS. * Fix broken checkRecipes. Did initial work for XLHE. Other misc. stuff. * Update GregtechLargeTurbinesAndHeatExchanger.java * Update RECIPES_Machines.java Changes requested by @Dream-Master --- src/main/java/gregtech/api/enums/TAE.java | 37 ++- src/main/java/gregtech/api/util/GTPP_Recipe.java | 8 +- src/main/java/gtPlusPlus/core/block/ModBlocks.java | 1 + .../core/block/base/BlockBaseModular.java | 10 + .../gtPlusPlus/core/block/base/BlockBaseOre.java | 16 +- .../commands/CommandEnableDebugWhileRunning.java | 3 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + src/main/java/gtPlusPlus/core/item/ModItems.java | 9 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 17 + .../gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java | 19 +- .../java/gtPlusPlus/nei/GT_NEI_FluidReactor.java | 2 +- src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java | 2 +- .../java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java | 2 +- .../nei/GT_NEI_MolecularTransformer.java | 2 +- .../java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java | 2 +- .../gtPlusPlus/nei/GT_NEI_MultiSolarTower.java | 2 +- .../nei/GT_NEI_MultiTreeGrowthSimulator.java | 177 ++++++++++ src/main/java/gtPlusPlus/nei/NEI_GT_Config.java | 3 + src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java | 1 + .../xmod/gregtech/api/enums/GregtechItemList.java | 6 + .../api/objects/GTPP_CopiedBlockTexture.java | 27 ++ .../gregtech/api/objects/GTPP_RenderedTexture.java | 27 ++ .../common/blocks/GregtechMetaCasingBlocks.java | 13 +- .../common/blocks/GregtechMetaCasingBlocks2.java | 20 +- .../common/blocks/GregtechMetaCasingBlocks3.java | 4 +- .../common/blocks/GregtechMetaCasingBlocks4.java | 12 +- .../common/blocks/GregtechMetaCasingBlocks5.java | 12 +- .../GregtechMetaCasingBlocksPipeGearbox.java | 103 ++++++ .../blocks/GregtechMetaSpecialMachineCasings.java | 4 +- .../blocks/GregtechMetaSpecialMultiCasings.java | 13 +- .../common/blocks/textures/TexturesGtBlock.java | 22 +- .../machines/multi/misc/GMTE_AmazonPackager.java | 9 +- ...egtechMetaTileEntity_IndustrialFluidHeater.java | 244 ++++++++++++++ .../GregtechMetaTileEntity_Adv_HeatExchanger.java | 355 +++++++++++++++++++++ .../GregtechMetaTileEntity_SteamCompressor.java | 14 +- .../production/GregtechMetaTileEntityTreeFarm.java | 181 ++++++++--- .../turbines/GT_MTE_LargeTurbine_Plasma.java | 9 +- .../GregtechMetaTileEntity_LargerTurbineBase.java | 4 +- .../xmod/gregtech/loaders/Gregtech_Blocks.java | 1 + .../gregtech/GregtechIndustrialFluidHeater.java | 22 ++ .../gregtech/GregtechIndustrialTreeFarm.java | 5 +- .../GregtechLargeTurbinesAndHeatExchanger.java | 4 +- .../registration/gregtech/GregtechSteamMultis.java | 4 +- .../iconsets/MACHINE_CASING_GEARBOX_ABYSSAL.png | Bin 0 -> 3324 bytes .../MACHINE_CASING_GEARBOX_EGLIN_STEEL.png | Bin 0 -> 3324 bytes .../iconsets/MACHINE_CASING_GEARBOX_GENERIC.png | Bin 0 -> 651 bytes .../MACHINE_CASING_GEARBOX_INCOLOY_MA956.png | Bin 0 -> 3324 bytes .../MACHINE_CASING_GEARBOX_INCONEL_792.png | Bin 0 -> 3324 bytes .../iconsets/MACHINE_CASING_GEARBOX_NITINOL_60.png | Bin 0 -> 3324 bytes .../iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM.png | Bin 0 -> 3324 bytes .../iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL.png | Bin 0 -> 3324 bytes .../iconsets/MACHINE_CASING_GEARBOX_ZERON_100.png | Bin 0 -> 3324 bytes .../iconsets/MACHINE_CASING_PIPE_ABYSSAL.png | Bin 0 -> 610 bytes .../iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY.png | Bin 0 -> 610 bytes .../iconsets/MACHINE_CASING_PIPE_CINOBITE.png | Bin 0 -> 610 bytes .../iconsets/MACHINE_CASING_PIPE_GENERIC.png | Bin 0 -> 539 bytes .../iconsets/MACHINE_CASING_PIPE_INCONEL_690.png | Bin 0 -> 610 bytes .../blocks/iconsets/MACHINE_CASING_PIPE_LAFIUM.png | Bin 0 -> 610 bytes .../iconsets/MACHINE_CASING_PIPE_NITINOL_60.png | Bin 0 -> 610 bytes .../iconsets/MACHINE_CASING_PIPE_STELLITE.png | Bin 0 -> 610 bytes .../iconsets/MACHINE_CASING_PIPE_TITANSTEEL.png | Bin 0 -> 610 bytes 61 files changed, 1278 insertions(+), 151 deletions(-) create mode 100644 src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ABYSSAL.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_GENERIC.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCONEL_792.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_NITINOL_60.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ZERON_100.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_ABYSSAL.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_CINOBITE.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_GENERIC.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_INCONEL_690.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_LAFIUM.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_NITINOL_60.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_STELLITE.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_TITANSTEEL.png diff --git a/src/main/java/gregtech/api/enums/TAE.java b/src/main/java/gregtech/api/enums/TAE.java index e8fd31d89e..274a29065b 100644 --- a/src/main/java/gregtech/api/enums/TAE.java +++ b/src/main/java/gregtech/api/enums/TAE.java @@ -5,13 +5,13 @@ import java.util.HashMap; import java.util.HashSet; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; public class TAE { @@ -20,7 +20,7 @@ public class TAE { public static int gtPPLastUsedIndex = 64; public static int secondaryIndex = 0; - public static HashMap mTAE = new HashMap(); + public static HashMap mTAE = new HashMap(); private static final HashSet mFreeSlots = new HashSet(64); static { @@ -34,18 +34,18 @@ public class TAE { * * @param aPage - The Texture page (0-3) * @param aID - The ID on the specified page (0-15) - * @param gt_CopiedBlockTexture - The Texture to register + * @param GTPP_CopiedBlockTexture - The Texture to register * @return - Did it register correctly? */ - public static boolean registerTexture(int aPage, int aID, GT_CopiedBlockTexture gt_CopiedBlockTexture) { + public static boolean registerTexture(int aPage, int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { int aRealID = aID + (aPage * 16); - return registerTexture(64 + aRealID, gt_CopiedBlockTexture); + return registerTexture(64 + aRealID, GTPP_CopiedBlockTexture); } - public static boolean registerTexture(int aID, GT_CopiedBlockTexture gt_CopiedBlockTexture) { + public static boolean registerTexture(int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { if (mFreeSlots.contains(aID)) { mFreeSlots.remove(aID); - mTAE.put(aID, gt_CopiedBlockTexture); + mTAE.put(aID, GTPP_CopiedBlockTexture); return true; } else { @@ -56,17 +56,22 @@ public class TAE { public static void finalizeTAE() { String aFreeSpaces = ""; + String aPageAndSlotFree = ""; AutoMap aTemp = new AutoMap(mFreeSlots); for (int i = 0; i < mFreeSlots.size() ; i++) { - aFreeSpaces += aTemp.get(i); + int j = aTemp.get(i); + aFreeSpaces += j; + aPageAndSlotFree += getPageFromIndex(j); if (i != (mFreeSlots.size() - 1)) { aFreeSpaces += ", "; + aPageAndSlotFree += ", "; } } Logger.INFO("Free Indexes within TAE: "+aFreeSpaces); + Logger.INFO("Free Page slots within TAE: "+aPageAndSlotFree); Logger.INFO("Filling them with ERROR textures."); for (int aFreeSlot : aTemp.values()) { - registerTexture(aFreeSlot, new GT_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); + registerTexture(aFreeSlot, new GTPP_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); } Logger.INFO("Finalising TAE."); for (int aKeyTae : mTAE.keySet()) { @@ -75,7 +80,7 @@ public class TAE { Logger.INFO("Finalised TAE."); } - private static boolean registerTextures(GT_CopiedBlockTexture gt_CopiedBlockTexture) { + private static boolean registerTextures(GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { try { //Handle page 2. Logger.INFO("[TAE} Registering Texture, Last used casing ID is "+gtPPLastUsedIndex+"."); @@ -85,7 +90,7 @@ public class TAE { if (x != null) { ITexture[][] h = (ITexture[][]) x.get(null); if (h != null) { - h[64][secondaryIndex++] = gt_CopiedBlockTexture; + h[64][secondaryIndex++] = GTPP_CopiedBlockTexture; x.set(null, h); Logger.INFO("[TAE} Registered Texture with ID "+(secondaryIndex-1)+" in secondary index."); return true; @@ -96,7 +101,7 @@ public class TAE { //set to page 1. else { - Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, gt_CopiedBlockTexture); + Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, GTPP_CopiedBlockTexture); Logger.INFO("[TAE} Registered Texture with ID "+(gtPPLastUsedIndex)+" in main index."); gtPPLastUsedIndex++; return true; @@ -136,4 +141,12 @@ public class TAE { id += blockMeta; return id; } + public static String getPageFromIndex(int aIndex) { + int aPage = 0; + int aSlot = 0; + int aAdjustedIndex = aIndex > 64 ? (aIndex - 64) : aIndex; + aPage = aAdjustedIndex / 16; + aSlot = aAdjustedIndex - (16 * aPage); + return "["+aIndex+" | "+aPage+", "+aSlot+"]"; + } } diff --git a/src/main/java/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java index ba914e0857..e777a0bf36 100644 --- a/src/main/java/gregtech/api/util/GTPP_Recipe.java +++ b/src/main/java/gregtech/api/util/GTPP_Recipe.java @@ -12,6 +12,7 @@ import gtPlusPlus.api.interfaces.IComparableRecipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.RecipeUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.*; @@ -69,6 +70,10 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { private final void checkModified() { if (hasBeenModified()) { + String[] aInfo = RecipeUtils.getRecipeInfo(this); + for (String s : aInfo) { + Logger.INFO(s); + } CORE.crash("Someone has edited an internal GT++ recipe, which is no longer allowed. Please complain to whoever has done this, not Alkalus."); } } @@ -432,7 +437,8 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { // Flotation Cell public static final GTPP_Recipe_Map_Internal sFlotationCellRecipes = new GTPP_Recipe_Map_Internal(new HashSet(10000), "gtpp.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "Ore Key: ", 1, E, true, false); - + // Tree Growth Simulator + public static final GTPP_Recipe_Map_Internal sTreeSimFakeRecipes = new GTPP_Recipe_Map_Internal(new HashSet(100), "gtpp.recipe.treefarm", "Tree Growth Simulator", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 1, 0, 1, "", 1, "", false, true); /** diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java index 5b29d9a636..4842cb891e 100644 --- a/src/main/java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java @@ -61,6 +61,7 @@ public final class ModBlocks { public static Block blockSpecialMultiCasings; public static Block blockSpecialMultiCasings2; public static Block blockCustomMachineCasings; + public static Block blockCustomPipeGearCasings; public static Block blockMetaTileEntity; public static Block blockHeliumGenerator; diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java index 035b13dfbf..2dc780bb78 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java +++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java @@ -17,6 +17,7 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; @@ -29,6 +30,12 @@ public class BlockBaseModular extends BasicBlock { public BlockTypes thisBlock; protected String thisBlockMaterial; protected final String thisBlockType; + + private static HashMap sBlockCache = new HashMap(); + + public static Block getMaterialBlock(Material aMaterial, BlockTypes aType) { + return sBlockCache.get(aMaterial.getUnlocalizedName()+"."+aType.name()); + } public BlockBaseModular(final Material material, final BlockTypes blockType) { this(material, blockType, material.getRgbAsHex()); @@ -39,6 +46,9 @@ public class BlockBaseModular extends BasicBlock { blockType, colour, Math.min(Math.max(material.vTier, 1), 6)); blockMaterial = material; registerComponent(); + if (material != null) { + sBlockCache.put(material.getUnlocalizedName()+"."+blockType.name(), this); + } } protected BlockBaseModular(final String unlocalizedName, final String blockMaterialString, diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java index e1bc3462be..df69a050a6 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java +++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java @@ -7,8 +7,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.interfaces.ITexturedBlock; import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer; @@ -18,6 +16,8 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EnumCreatureType; @@ -93,9 +93,9 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { public ITexture[] getTexture(Block block, byte side) { if (this.blockMaterial != null){ - GT_RenderedTexture aIconSet = new GT_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); + GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); if (aIconSet != null){ - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + return new ITexture[]{new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; } } @@ -118,7 +118,7 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { } } } - return new ITexture[]{new GT_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; + return new ITexture[]{new GTPP_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; } @Override @@ -196,9 +196,9 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { public ITexture[] getTexture(Block block, byte side) { if (this.blockMaterial != null){ - GT_RenderedTexture aIconSet = new GT_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); + GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); if (aIconSet != null){ - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + return new ITexture[]{new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; } } @@ -221,7 +221,7 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { } } } - return new ITexture[]{new GT_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; + return new ITexture[]{new GTPP_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; } } diff --git a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index 493b7d415d..4f5615b60a 100644 --- a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -116,9 +116,10 @@ public class CommandEnableDebugWhileRunning implements ICommand if (aItem != null) { String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId; String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name; - Logger.INFO(aModID+":"+aRegistryName); + Logger.INFO(aModID+":"+aRegistryName+":"+aItem.getItemDamage()+" | "+aItem.getDisplayName()); } } + PlayerUtils.messagePlayer(P, "Dumped Inventory."); } } else if (argString[0].toLowerCase().equals("hand")) { diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 1faf07dde3..79446db6e6 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -165,6 +165,7 @@ public class COMPAT_HANDLER { GregtechIndustrialElementDuplicator.run(); GregtechIndustrialRockBreaker.run(); GregtechIndustrialChisel.run(); + GregtechIndustrialFluidHeater.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index 159598189e..b77b46d34b 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -297,6 +297,9 @@ public final class ModItems { public static ItemStack itemHotTitaniumIngot; public static Fluid fluidZrF4; + public static Fluid fluidFertBasic; + public static Fluid fluidFertUN32; + public static Fluid fluidFertUN18; public static Item boxTools; public static Item boxFood; @@ -771,10 +774,10 @@ public final class ModItems { temp2 = ItemUtils.getCorrectStacktype("Forestry:fertilizerCompound", 1); } if (temp1 != null){ - FluidUtils.generateFluidNonMolten("Fertiliser", "Fertiliser", 32, new short[]{45, 170, 45, 100}, temp1, temp2, true); + fluidFertBasic = FluidUtils.generateFluidNonMolten("Fertiliser", "Fertiliser", 32, new short[]{45, 170, 45, 100}, temp1, temp2, true); } - FluidUtils.generateFluidNonMolten("UN32Fertiliser", "UN-32 Fertiliser", 24, new short[]{55, 190, 55, 100}, null, null, true); - FluidUtils.generateFluidNonMolten("UN18Fertiliser", "UN-18 Fertiliser", 22, new short[]{60, 155, 60, 100}, null, null, true); + fluidFertUN32 = FluidUtils.generateFluidNonMolten("UN32Fertiliser", "UN-32 Fertiliser", 24, new short[]{55, 190, 55, 100}, null, null, true); + fluidFertUN18 = FluidUtils.generateFluidNonMolten("UN18Fertiliser", "UN-18 Fertiliser", 22, new short[]{60, 155, 60, 100}, null, null, true); /*GT_Values.RA.addMixerRecipe( arg0, //Item In diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index d27919c18c..f9ab366285 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -256,6 +256,7 @@ public class RECIPES_Machines { sparging(); chisels(); rockBreaker(); + thermicFluidHeater(); gt4FarmManager(); gt4Redstone(); @@ -276,6 +277,16 @@ public class RECIPES_Machines { } + + private static void thermicFluidHeater() { + + RecipeUtils.addShapedGregtechRecipe( + CI.getPlate(5, 1), CI.circuitTier5, CI.getPlate(5, 1), + pipeTier7, ItemList.Machine_IV_FluidHeater.get(1), pipeTier7, + CI.getPlate(5, 1), CI.circuitTier4, CI.getPlate(5, 1), + GregtechItemList.Controller_IndustrialFluidHeater.get(1)); + } + private static void computerCube() { CORE.RA.addSixSlotAssemblingRecipe( @@ -1299,6 +1310,12 @@ public class RECIPES_Machines { "craftingPiston", ALLOY.TUMBAGA.getFrameBox(1), "craftingPiston", aBronzeBricks, "gemDiamond", aBronzeBricks, GregtechItemList.Controller_SteamMaceratorMulti.get(1)); + // Steam Compressor Multi + RecipeUtils.addShapedGregtechRecipe( + aBronzeBricks, "craftingPiston", aBronzeBricks, + ALLOY.TUMBAGA.getGear(1), ALLOY.TUMBAGA.getFrameBox(1), ALLOY.TUMBAGA.getGear(1), + aBronzeBricks, "craftingPiston", aBronzeBricks, + GregtechItemList.Controller_SteamCompressorMulti.get(1)); // Steam Hatch RecipeUtils.addShapedGregtechRecipe( diff --git a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index fe1204a661..8acd54c401 100644 --- a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -2,11 +2,7 @@ package gtPlusPlus.nei; import java.awt.Rectangle; import java.lang.ref.SoftReference; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; import org.lwjgl.opengl.GL11; @@ -15,20 +11,13 @@ import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import codechicken.nei.guihook.IContainerInputHandler; import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; -import codechicken.nei.recipe.TemplateRecipeHandler; +import codechicken.nei.recipe.*; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.client.Minecraft; @@ -246,7 +235,7 @@ public class GTPP_NEI_DefaultHandler extends TemplateRecipeHandler { } } if (tDuration > 0) { - drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); } if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java index 7ef76f68b2..9885ac5474 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java @@ -78,7 +78,7 @@ public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler { } } if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); } if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { int aTier = (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue); diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java index dd7338eccd..3683676808 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java @@ -36,7 +36,7 @@ public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { public void drawExtras(final int aRecipeIndex) { final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - drawText(10, 83, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 83, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); drawText(10, 93, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216); drawText(10, 103, "Dynamo: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); drawText(10, 113, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt * 4)) + " EU", -16777216); diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java index c9f9f0722a..5b8451b6b5 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java @@ -156,7 +156,7 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { final long tDuration = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; GT_NEI_LFTR.drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); GT_NEI_LFTR.drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); - GT_NEI_LFTR.drawText(10, 93, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20))) + " secs", -16777216); + GT_NEI_LFTR.drawText(10, 93, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); GT_NEI_LFTR.drawText(10, 103, "Gas not used to sparge is", -16777216); GT_NEI_LFTR.drawText(10, 113, "returned alongside outputs.", -16777216); } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java index fc2c16b423..5e62d8f3df 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java @@ -28,7 +28,7 @@ public class GT_NEI_MolecularTransformer extends GTPP_NEI_DefaultHandler { drawText(10, 103, "Amperage: " + aRecipe.mSpecialValue, -16777216); } if (tDuration > 0) { - drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java index f4f69589b6..5fd6cc5b64 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java @@ -48,7 +48,7 @@ public class GT_NEI_MultiNoCell extends GTPP_NEI_DefaultHandler { drawText(10, 100, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); } if (tDuration > 0) { - drawText(10, 110, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 110, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); } if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { drawText(10, 120, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216); diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java index e5666d84b4..fd611cbabe 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java @@ -26,7 +26,7 @@ public class GT_NEI_MultiSolarTower extends GT_NEI_MultiNoCell { public void drawExtras(final int aRecipeIndex) { final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; if (tDuration > 0) { - drawText(10, 90, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 90, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); } drawText(5, 100, "Solar Heater rings boost tier", -16777216); drawText(5, 110, "R1:T1, R2:T2, R3:T4, R4:T8, R5:T16", -16777216); diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java new file mode 100644 index 0000000000..33d5f1c884 --- /dev/null +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java @@ -0,0 +1,177 @@ +package gtPlusPlus.nei; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import java.util.HashMap; +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.data.Pair; +import gtPlusPlus.core.item.ModItems; +import net.minecraft.item.ItemStack; + +public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { + + private static final HashMap> mInputSlotMap = new HashMap>(); + private static final HashMap> mOutputSlotMap = new HashMap>(); + + static { + int[] aSlotX = new int[] {12, 30, 48}; + int[] aSlotY = new int[] {5, 23, 41, 64}; + // Input slots + int aIndex = 0; + for (int y=0; y(aSlotX[x], aSlotY[y])); + } + } + // Output slots + aSlotX = new int[] {102, 120, 138}; + aIndex = 0; + for (int y=0; y(aSlotX[x], aSlotY[y])); + } + } + } + + public GT_NEI_MultiTreeGrowthSimulator() { + super(GTPP_Recipe_Map.sTreeSimFakeRecipes); + } + + @Override + public TemplateRecipeHandler newInstance() { + return new GT_NEI_MultiTreeGrowthSimulator(); + } + + @Override + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new TreeSimDefaultRecipe(aRecipe); + } + + @Override + public void drawBackground(final int recipe) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 89); + } + + @Override + public String getGuiTexture() { + return RES_PATH_GUI + "basicmachines/FissionFuel.png"; + } + + @Override + public void drawExtras(final int aRecipeIndex) { + if (ModItems.fluidFertBasic != null) { + drawText(5, 90, "Chance of Sapling output if", -16777216); + drawText(5, 100, ""+ModItems.fluidFertBasic.getLocalizedName()+" is provided.", -16777216); + drawText(5, 110, "This is optional.", -16777216); + } + } + + @Override + public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { + final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); + if ((tObject instanceof CachedDefaultRecipe)) { + final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; + for (final PositionedStack tStack : tRecipe.mOutputs) { + if (aStack == tStack.item) { + if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { + break; + } + if (ModItems.fluidFertBasic != null) { + currenttip.add("Chance output if "+ModItems.fluidFertBasic.getLocalizedName()+" is provided."); + } + break; + } + } + } + return currenttip; + } + + public class TreeSimDefaultRecipe extends CachedDefaultRecipe { + + public TreeSimDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); + + } + + @Override + public void handleSlots() { + + int aInputItemsCount = this.mRecipe.mInputs.length; + int aInputFluidsCount = this.mRecipe.mFluidInputs.length; + int aOutputItemsCount = this.mRecipe.mOutputs.length; + int aInputSlotsUsed = 0; + int aOutputSlotsUsed = 0; + int aSlotToCheck = 0; + + // Special Slot + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); + } + + /* + * Items + */ + + // Upto 9 Inputs Slots + if (aInputItemsCount > 0) { + if (aInputItemsCount > 9) { + aInputItemsCount = 9; + } + for (int i=0;i 0) { + if (aOutputItemsCount > 9) { + aOutputItemsCount = 9; + } + for (int i=0;i 0) { + for (int i=0;ieverywhere. + * @author Alkalus + * + */ +@SuppressWarnings("deprecation") +public class GTPP_CopiedBlockTexture extends GT_CopiedBlockTexture { + + public GTPP_CopiedBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa, boolean aAllowAlpha) { + super(aBlock, aMeta, aMeta, aRGBa, aAllowAlpha); + } + + public GTPP_CopiedBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa) { + this(aBlock, aSide, aMeta, aRGBa, true); + } + + public GTPP_CopiedBlockTexture(Block aBlock, int aSide, int aMeta) { + this(aBlock, aSide, aMeta, Dyes._NULL.mRGBa); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java new file mode 100644 index 0000000000..562be6a8ef --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java @@ -0,0 +1,27 @@ +package gtPlusPlus.xmod.gregtech.api.objects; + +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.objects.GT_RenderedTexture; + +/** + * Made this to get rid of deprecation warnings everywhere. + * @author Alkalus + * + */ +@SuppressWarnings("deprecation") +public class GTPP_RenderedTexture extends GT_RenderedTexture { + + public GTPP_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { + super(aIcon, aRGBa, aAllowAlpha); + } + + public GTPP_RenderedTexture(IIconContainer aIcon, short[] aRGBa) { + this(aIcon, aRGBa, true); + } + + public GTPP_RenderedTexture(IIconContainer aIcon) { + this(aIcon, Dyes._NULL.mRGBa); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java index c4b2e4f738..daeebe2fe6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java @@ -2,18 +2,15 @@ package gtPlusPlus.xmod.gregtech.common.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; - import gregtech.api.enums.TAE; -import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; - import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { @@ -26,7 +23,7 @@ extends GregtechMetaCasingBlocksAbstract { if (i == 2 || i == 3 || i == 4) { continue; } - TAE.registerTexture(0, i, new GT_CopiedBlockTexture(this, 6, i)); + TAE.registerTexture(0, i, new GTPP_CopiedBlockTexture(this, 6, i)); } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index 596643e06c..171339b08b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -1,21 +1,19 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import java.util.List; import gregtech.api.enums.TAE; -import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Material_Casings; - import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler2; - -import java.util.List; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract { @@ -46,7 +44,7 @@ extends GregtechMetaCasingBlocksAbstract { if (i == 4 || i == 10 || i == 11 || i == 12 || i == 14) { continue; } - TAE.registerTexture(1, i, new GT_CopiedBlockTexture(this, 6, i)); + TAE.registerTexture(1, i, new GTPP_CopiedBlockTexture(this, 6, i)); } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Thermal Processing Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 76bd57b3fa..e9251d908e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -5,11 +5,11 @@ import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.TAE; -import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler3; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; @@ -50,7 +50,7 @@ extends GregtechMetaCasingBlocksAbstract { if (i >= 4 && i <= 8) { continue; } - TAE.registerTexture(2, i, new GT_CopiedBlockTexture(this, 6, i)); + TAE.registerTexture(2, i, new GTPP_CopiedBlockTexture(this, 6, i)); } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Aquatic Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel Reinforced Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 13eb045748..93ec53baba 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -1,18 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; - import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; public class GregtechMetaCasingBlocks4 @@ -24,7 +20,7 @@ extends GregtechMetaCasingBlocksAbstract { if (i == 2 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 12 || i == 13 || i == 14 || i == 15) { continue; } - TAE.registerTexture(3, i, new GT_CopiedBlockTexture(this, 6, i)); + TAE.registerTexture(3, i, new GTPP_CopiedBlockTexture(this, 6, i)); } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Naquadah Reactor Base"); //48 GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reactor Piping"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index fe247e24a4..27fa7349ca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -4,10 +4,10 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGrinderMultiblock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.item.ItemStack; @@ -25,17 +25,17 @@ extends GregtechMetaCasingBlocksAbstract { public GregtechMetaCasingBlocks5() { super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.5", GT_Material_Casings.INSTANCE); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "IsaMill Exterior Casing"); // IsaMill Casing - TAE.registerTexture(0, 2, new GT_CopiedBlockTexture(this, 6, 0)); + TAE.registerTexture(0, 2, new GTPP_CopiedBlockTexture(this, 6, 0)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "IsaMill Piping"); // IsaMill Pipe GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "IsaMill Gearbox"); // IsaMill Gearbox GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Elemental Confinement Shell"); // Duplicator Casing - TAE.registerTexture(0, 3, new GT_CopiedBlockTexture(this, 6, 3)); + TAE.registerTexture(0, 3, new GTPP_CopiedBlockTexture(this, 6, 3)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing - TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); + TAE.registerTexture(0, 4, new GTPP_CopiedBlockTexture(this, 6, 4)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused - TAE.registerTexture(1, 10, new GT_CopiedBlockTexture(this, 6, 5)); + TAE.registerTexture(1, 10, new GTPP_CopiedBlockTexture(this, 6, 5)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing - TAE.registerTexture(1, 11, new GT_CopiedBlockTexture(this, 6, 6)); + TAE.registerTexture(1, 11, new GTPP_CopiedBlockTexture(this, 6, 6)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java new file mode 100644 index 0000000000..10c1a4e80f --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java @@ -0,0 +1,103 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import java.util.HashMap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlocksAbstract { + + private static HashMap sMaterialMapping = new HashMap(); + + public GregtechMetaCasingBlocksPipeGearbox() { + super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.pipesgears", GT_Material_Casings.INSTANCE); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Eglin Steel Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel-792 Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Incoloy MA956 Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Nitinol-60 Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Zeron-100 Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Pikyonium Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Titansteel Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Abyssal Gear Box Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Babbit Alloy Pipe Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Inconel-690 Pipe Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Stellite Pipe Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Nitinol-60 Pipe Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Lafium Pipe Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cinobite Pipe Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Titansteel Pipe Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Abyssal Pipe Casing"); + + int aMappingID = 0; + sMaterialMapping.put(aMappingID++, ALLOY.EGLIN_STEEL.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.INCONEL_792.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.INCOLOY_MA956.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.NITINOL_60.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.ZERON_100.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.PIKYONIUM.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.TITANSTEEL.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.ABYSSAL.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.BABBIT_ALLOY.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.INCONEL_690.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.STELLITE.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.NITINOL_60.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.LAFIUM.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.CINOBITE.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.TITANSTEEL.getRgbAsHex()); + sMaterialMapping.put(aMappingID++, ALLOY.ABYSSAL.getRgbAsHex()); + + } + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + case 0 : + case 1 : + case 2 : + case 3 : + case 4 : + case 5 : + case 6 : + case 7 : + return TexturesGtBlock.TEXTURE_GEARBOX_GENERIC.getIcon(); + case 8 : + case 9 : + case 10 : + case 11 : + case 12 : + case 13 : + case 14 : + case 15 : + return TexturesGtBlock.TEXTURE_PIPE_GENERIC.getIcon(); + } + } + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + } + + @SideOnly(Side.CLIENT) + @Override + public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) { + return sMaterialMapping.get(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); + } + + @SideOnly(Side.CLIENT) + @Override + public int getRenderColor(final int aMeta) { + return sMaterialMapping.get(aMeta); + } + + @SideOnly(Side.CLIENT) + @Override + public int getBlockColor() { + return super.getBlockColor(); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java index 8f5dff592a..b46e9d7464 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java @@ -4,10 +4,10 @@ import java.util.List; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -43,7 +43,7 @@ public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksA GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Strong Bronze Machine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing"); - TAE.registerTexture(84, new GT_CopiedBlockTexture(this, 6, 2)); + TAE.registerTexture(84, new GTPP_CopiedBlockTexture(this, 6, 2)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java index a9c8a1e9bc..8b8955df43 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -4,10 +4,12 @@ import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler; import net.minecraft.block.Block; @@ -37,10 +39,6 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs public GregtechMetaSpecialMultiCasings() { super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.1", GT_Material_Casings.INSTANCE); - for (byte i = 0; i < 16; i = (byte) (i + 1)) { - //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); - // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08) - } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Turbine Shaft"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing"); @@ -55,7 +53,8 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Particle Containment Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Reinforced Heat Exchanger Casing"); + TAE.registerTexture(1, 12, new GTPP_CopiedBlockTexture(this, 6, 14)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 0)); @@ -72,6 +71,8 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GregtechItemList.Casing_Molecular_Transformer_1.set(new ItemStack(this, 1, 11)); GregtechItemList.Casing_Molecular_Transformer_2.set(new ItemStack(this, 1, 12)); GregtechItemList.Casing_Molecular_Transformer_3.set(new ItemStack(this, 1, 13)); + GregtechItemList.Casing_XL_HeatExchanger.set(new ItemStack(this, 1, 14)); + } @Override @@ -114,6 +115,8 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs return TexturesGtBlock.Casing_Redox_5.getIcon(); case 13: return TexturesGtBlock.TEXTURE_MAGIC_PANEL_B.getIcon(); + case 14: + return TexturesGtBlock.Casing_Material_Talonite.getIcon(); } return Textures.BlockIcons.RENDERING_ERROR.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index e6ccc419e0..27c33e53b6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -321,9 +321,29 @@ public class TexturesGtBlock { // Custom Pipes public static final CustomIcon TEXTURE_PIPE_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_PIPE_T1"); + public static final CustomIcon TEXTURE_PIPE_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_PIPE_GENERIC"); + + public static final CustomIcon TEXTURE_PIPE_T1_BABBIT_ALLOY = new CustomIcon("iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY"); + public static final CustomIcon TEXTURE_PIPE_T2_INCONEL_690 = new CustomIcon("iconsets/MACHINE_CASING_PIPE_INCONEL_690"); + public static final CustomIcon TEXTURE_PIPE_T3_STELLITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_STELLITE"); + public static final CustomIcon TEXTURE_PIPE_T4_NITINOL_60 = new CustomIcon("iconsets/MACHINE_CASING_PIPE_NITINOL_60"); + public static final CustomIcon TEXTURE_PIPE_T5_LAFIUM = new CustomIcon("iconsets/MACHINE_CASING_PIPE_LAFIUM"); + public static final CustomIcon TEXTURE_PIPE_T6_CINOBITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_CINOBITE"); + public static final CustomIcon TEXTURE_PIPE_T7_TITANSTEEL = new CustomIcon("iconsets/MACHINE_CASING_PIPE_TITANSTEEL"); + public static final CustomIcon TEXTURE_PIPE_T8_ABYSSAL = new CustomIcon("iconsets/MACHINE_CASING_PIPE_ABYSSAL"); // Custom Gearboxes - public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_GEARBOX_T1"); + public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_GEARBOX_T1"); + public static final CustomIcon TEXTURE_GEARBOX_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_GENERIC"); + + public static final CustomIcon TEXTURE_GEARBOX_T1_EGLIN_STEEL = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL"); + public static final CustomIcon TEXTURE_GEARBOX_T2_INCONEL_792 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCONEL_792"); + public static final CustomIcon TEXTURE_GEARBOX_T3_INCOLOY_MA956 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956"); + public static final CustomIcon TEXTURE_GEARBOX_T4_NITINOL_60 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_NITINOL_60"); + public static final CustomIcon TEXTURE_GEARBOX_T5_ZERON_100 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ZERON_100"); + public static final CustomIcon TEXTURE_GEARBOX_T6_PIKYONIUM = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM"); + public static final CustomIcon TEXTURE_GEARBOX_T7_TITANSTEEL = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL"); + public static final CustomIcon TEXTURE_GEARBOX_T8_ABYSSAL = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ABYSSAL"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = new CustomIcon("iconsets/MACHINE_CASING_FUSION_COIL_II"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index 7e7ecfa390..36b031a56f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -395,14 +395,11 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { + + private int mCasing1; + private IStructureDefinition STRUCTURE_DEFINITION = null; + + public GregtechMetaTileEntity_IndustrialFluidHeater(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialFluidHeater(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialFluidHeater(this.mName); + } + + @Override + public String getMachineType() { + return "Fluid Heater"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Fluid Heater") + .addInfo("120% faster than using single block machines of the same voltage") + .addInfo("Only uses 90% of the eu/t normally required") + .addInfo("Processes eight items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(5, 6, 5, true) + .addController("Front Center") + .addCasingInfo("Top/Bottom layer: Multi-use Casings", 34) + .addCasingInfo("Middle layers: Thermal Containment Casing", 47) + .addInputBus("Bottom Layer (optional)", 1) + .addInputHatch("Bottom Layer", 1) + .addOutputBus("Top Layer (optional)", 1) + .addOutputHatch("Top Layer", 1) + .addEnergyHatch("Any Multi-use Casing", 1) + .addMaintenanceHatch("Any Multi-use Casing", 1) + .addMufflerHatch("Any Multi-use Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(mName, transpose(new String[][]{ + {" TTT ", "TTTTT", "TTTTT", "TTTTT", " TTT "}, + {" XXX ", "X---X", "X---X", "X---X", " XXX "}, + {" XXX ", "X---X", "X---X", "X---X", " XXX "}, + {" XXX ", "X---X", "X---X", "X---X", " XXX "}, + {" X~X ", "X---X", "X---X", "X---X", " XXX "}, + {" BBB ", "BBBBB", "BBBBB", "BBBBB", " BBB "}, + })) + + .addElement('B', ofChain( + ofHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater::addIndustrialFluidHeaterInputList, getCasingTextureIndex(), 1), + onElementPass(x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))) + + .addElement('X', ofBlock(getCasingBlock1(), getCasingMeta1())) + + .addElement('T', ofChain( + ofHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater::addIndustrialFluidHeaterOutputList, getCasingTextureIndex(), 1), + onElementPass(x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))) + + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 2, 4, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing1 = 0; + boolean didBuild = checkPiece(mName, 2, 4, 0); + log("Built? "+didBuild+", "+mCasing1); + return didBuild && mCasing1 >= 34 && checkHatch(); + } + + public final boolean addIndustrialFluidHeaterInputList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + public final boolean addIndustrialFluidHeaterOutputList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(0, 1)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(0, 1))}; + } + + @Override + public boolean hasSlotInGUI() { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return "IndustrialThermalCentrifuge"; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 120); + } + + @Override + public int getMaxParallelRecipes() { + return (8 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + + @Override + public int getEuDiscountForParallelism() { + return 90; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialThermalCentrifuge; + } + + @Override + public int getAmountOfOutputs() { + return 1; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + public Block getCasingBlock1() { + return ModBlocks.blockCasings2Misc; + } + + public byte getCasingMeta1() { + return 11; + } + + public Block getCasingBlock2() { + return ModBlocks.blockCasings3Misc; + } + + public byte getCasingMeta2() { + return 2; + } + + public byte getCasingTextureIndex() { + return (byte) TAE.getIndexFromPage(2, 2); + } + +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java new file mode 100644 index 0000000000..9a6fcd4989 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java @@ -0,0 +1,355 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.*; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; +import gtPlusPlus.core.block.base.BlockBaseModular; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_RenderedTexture; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_MultiBlockBase { + + private static final int CASING_INDEX = TAE.getIndexFromPage(1, 12); + private static final String STRUCTURE_PIECE_MAIN = "main"; + + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" ccc ", "cCCCc", "cCCCc", "cCCCc", " ccc "}, + {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, + {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, + {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, + {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, + {" c~c ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, + {" hhh ", "hHHHh", "hHHHh", "hHHHh", " hhh "}, + {" f f ", "f f", " ", "f f", " f f "}, + {" f f ", "f f", " ", "f f", " f f "}, + })) + .addElement('P', ofBlock(ModBlocks.blockCustomPipeGearCasings, 11)) + .addElement('f', ofBlock(getFrame(), 0)) + .addElement('C', ofChain( + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addColdFluidOutputToMachineList, CASING_INDEX, 2), + onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14)) + )) + .addElement('H', ofChain( + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addHotFluidInputToMachineList, CASING_INDEX, 3), + onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14)) + )) + .addElement('h', ofChain( + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14)) + )) + .addElement('c', ofChain( + onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14)) + )) + .build(); + public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) + + private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; + private GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch; + private boolean superheated = false; + private int superheated_threshold=0; + private float water; + private int mCasingAmount; + + public GregtechMetaTileEntity_Adv_HeatExchanger(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + public GregtechMetaTileEntity_Adv_HeatExchanger(String aName) { + super(aName); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the XL Heat Exchanger") + .addInfo("More complicated than a Fusion Reactor. Seriously") + .addInfo("But you know this by now, right?") + .addSeparator() + .addInfo("Inputs are Hot Coolant or Lava") + .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") + .addInfo("Read the wiki article to understand how it works") + .addInfo("Then go to the Discord to understand the wiki") + .addSeparator() + .beginStructureBlock(5, 9, 5, false) + .addController("Front bottom") + .addCasingInfo("Stable Titanium Machine Casing", 20) + .addOtherStructurePart("Titanium Pipe Casing", "Center 2 blocks") + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Hot fluid, bottom center", 2) + .addInputHatch("Distilled water, any casing", 1) + .addOutputHatch("Cold fluid, top center", 3) + .addOutputHatch("Steam/SH Steam, any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + superheated = aNBT.getBoolean("superheated"); + super.loadNBTData(aNBT); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("superheated", superheated); + super.saveNBTData(aNBT); + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), new GTPP_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeHeatExchanger.png"); + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> !r.isUpsideDown() && !f.isVerticallyFliped(); + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + if (mInputHotFluidHatch.getFluid() == null) + return true; + + int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch + + superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam + float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry + int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25) + float steam_output_multiplier = 20f; // default: multiply output by 4 * 10 (boosted x5) + float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25). + boolean do_lava = false; + + // Do we have an integrated circuit with a valid configuration? + if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) { + int circuit_config = mInventory[1].getItemDamage(); + if (circuit_config >= 1 && circuit_config <= 25) { + // If so, apply the penalty and reduced threshold. + penalty = (circuit_config - 1) * penalty_per_config; + superheated_threshold -= (shs_reduction_per_config * (circuit_config - 1)); + } + } + efficiency -= penalty; + + // If we're working with lava, adjust the threshold and multipliers accordingly. + if (GT_ModHandler.isLava(mInputHotFluidHatch.getFluid())) { + steam_output_multiplier /= 5f; // lava is not boosted + superheated_threshold /= 4f; // unchanged + do_lava = true; + } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { + steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> nerf with this code back to 5x + superheated_threshold /=5f; // 10x smaller since the Hot Things production in reactor is the same. + } else { + // If we're working with neither, fail out + superheated_threshold=0; + return false; + } + + superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method. + fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second + mInputHotFluidHatch.drain(fluidAmountToConsume, true); + this.mMaxProgresstime = 20; + this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency); + if (do_lava) { + mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2pahoehoelava", fluidAmountToConsume), true); + } else { + mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true); + } + this.mEfficiencyIncrease = 80; + return true; + } + + private int useWater(float input) { + water = water + input; + int usage = (int) water; + water = water - usage; + return usage; + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (this.mEUt > 0) { + int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate. + if (tGeneratedEU > 0) { + + if (superheated) tGeneratedEU /= 2; // We produce half as much superheated steam if necessary + + int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume + //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption + + FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed); + if (depleteInput(distilledStack)) // Consume the distilled water + { + if (superheated) { + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam + } else { + addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam + } + } else { + GT_Log.exp.println(this.mName+" had no more Distilled water!"); + explodeMultiblock(); // Generate crater + } + } + return true; + } + return true; + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + private void onCasingAdded() { + mCasingAmount++; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mOutputColdFluidHatch = null; + mInputHotFluidHatch = null; + mCasingAmount = 0; + return checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0) && mCasingAmount >= 20 && mMaintenanceHatches.size() == 1; + } + + public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + mOutputColdFluidHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; + return true; + } + return false; + } + + public boolean addHotFluidInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = getRecipeMap(); + mInputHotFluidHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; + return true; + } + return false; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Adv_HeatExchanger(this.mName); + } + + @Override + public boolean isGivingInformation() { + return super.isGivingInformation(); + } + + @Override + public String[] getExtraInfoData() { + return new String[]{ + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + GT_Utility.formatNumbers(superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(superheated_threshold) + EnumChatFormatting.RESET + }; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 2, 5, 0); + } + @Override + public boolean hasSlotInGUI() { + return true; + } + @Override + public String getCustomGUIResourceName() { + return null; + } + @Override + public String getMachineType() { + return "Heat Exchanger"; + } + @Override + public int getMaxParallelRecipes() { + return 0; + } + @Override + public int getEuDiscountForParallelism() { + return 0; + } + + private static Block sFrame; + + public static Block getFrame() { + if (sFrame == null) { + sFrame = BlockBaseModular.getMaterialBlock(ALLOY.TALONITE, BlockTypes.FRAME); + } + return sFrame; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java index 92190521cd..c6500f0fcc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java @@ -44,12 +44,12 @@ public class GregtechMetaTileEntity_SteamCompressor extends GregtechMeta_SteamMu @Override protected GT_RenderedTexture getFrontOverlay() { - return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR); + return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR); } @Override protected GT_RenderedTexture getFrontOverlayActive() { - return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE); + return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE); } @Override @@ -61,12 +61,12 @@ public class GregtechMetaTileEntity_SteamCompressor extends GregtechMeta_SteamMu protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Steam Macerator") - .addInfo("Macerates " + getMaxParallelRecipes() + " ores at a time") + .addInfo("Controller Block for the Steam Compressor") + .addInfo("Compresses " + getMaxParallelRecipes() + " things at a time") .addSeparator() - .beginStructureBlock(3, 3, 3, true) + .beginStructureBlock(3, 3, 4, true) .addController("Front center") - .addCasingInfo(mCasingName, 14) + .addCasingInfo(mCasingName, 28) .addStructureHint("Input Bus (Steam)", 1) .addStructureHint("Output Bus (Steam)", 1) .addStructureHint("Steam Hatch", 1) @@ -127,7 +127,7 @@ public class GregtechMetaTileEntity_SteamCompressor extends GregtechMeta_SteamMu public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; fixAllMaintenanceIssue(); - return checkPiece(mName, 1, 1, 0) && mCasing >= 14; + return checkPiece(mName, 1, 1, 0) && mCasing >= 28; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index 3a97df6065..a2d467a60c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -13,10 +13,13 @@ import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.implementations.*; import gregtech.api.render.TextureFactory; import gregtech.api.util.*; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.slots.SlotBuzzSaw.SAWTOOL; import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -25,6 +28,8 @@ import gtPlusPlus.xmod.gregtech.common.helpers.treefarm.TreeGenerator; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashMap; @@ -70,7 +75,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("Converts EU to Oak Logs") + .addInfo("Converts EU to Logs") .addInfo("Eu Usage: 100% | Parallel: 1") .addInfo("Requires a Saw or Chainsaw in GUI slot") .addInfo("Output multiplier:") @@ -161,6 +166,23 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< } getWoodFromSapling(); try { + int aFert = hasLiquidFert(); + if (aFert > 0) { + int aOutputAmount = ((2 * (tTier * tTier)) - (2 * tTier) + 5)*(mMaxProgresstime/20) / 10; + if (aFert < aOutputAmount) { + aOutputAmount /= 10; + } + if (aFert >= aOutputAmount) { + if (tryConsumeLiquidFert(aOutputAmount)) { + int aFullStacks = aOutputAmount / 64; + for (int i = 0; i < aFullStacks; i++) { + this.addOutput(ItemUtils.getSimpleStack(currSapling, 64)); + aOutputAmount -= 64; + } + this.addOutput(ItemUtils.getSimpleStack(currSapling, aOutputAmount)); + } + } + } int aOutputAmount = ((2 * (tTier * tTier)) - (2 * tTier) + 5)*(mMaxProgresstime/20) * aModifier; int aFullStacks = aOutputAmount / 64; for (int i = 0; i < aFullStacks; i++) { @@ -284,56 +306,78 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< } } - public void loadMapWoodFromSapling() { - - // minecraft - sLogCache.put("minecraft:sapling:0", new ItemStack(Blocks.log, 1, 0)); // oak - sLogCache.put("minecraft:sapling:1", new ItemStack(Blocks.log, 1, 1)); // spruce - sLogCache.put("minecraft:sapling:2", new ItemStack(Blocks.log, 1, 2)); // birch - sLogCache.put("minecraft:sapling:3", new ItemStack(Blocks.log, 1, 3)); // jungle - sLogCache.put("minecraft:sapling:4", new ItemStack(Blocks.log2, 1, 0)); // acacia - sLogCache.put("minecraft:sapling:5", new ItemStack(Blocks.log2, 1, 1)); // dark - // oak + public static void loadMapWoodFromSapling() { // galaxySpace - sLogCache.put("GalaxySpace:barnardaCsapling:0", GT_ModHandler.getModItem("GalaxySpace", "barnardaClog", 1)); // barnarda - // c - + mapSaplingToLog("GalaxySpace:barnardaCsapling:0", GT_ModHandler.getModItem("GalaxySpace", "barnardaClog", 1)); // barnarda c + + // minecraft + mapSaplingToLog("minecraft:sapling:0", new ItemStack(Blocks.log, 1, 0)); // oak + mapSaplingToLog("minecraft:sapling:1", new ItemStack(Blocks.log, 1, 1)); // spruce + mapSaplingToLog("minecraft:sapling:2", new ItemStack(Blocks.log, 1, 2)); // birch + mapSaplingToLog("minecraft:sapling:3", new ItemStack(Blocks.log, 1, 3)); // jungle + mapSaplingToLog("minecraft:sapling:4", new ItemStack(Blocks.log2, 1, 0)); // acacia + mapSaplingToLog("minecraft:sapling:5", new ItemStack(Blocks.log2, 1, 1)); // dark oak + + // ic2 - sLogCache.put("IC2:blockRubSapling:0", GT_ModHandler.getModItem("IC2", "blockRubWood", 1)); // rubber + mapSaplingToLog("IC2:blockRubSapling:0", GT_ModHandler.getModItem("IC2", "blockRubWood", 1)); // rubber // natura - sLogCache.put("Natura:florasapling:1", GT_ModHandler.getModItem("Natura", "tree", 1, 0)); // eucalyptus - sLogCache.put("Natura:florasapling:2", GT_ModHandler.getModItem("Natura", "tree", 1, 3)); // hopseed - sLogCache.put("Natura:florasapling:3", GT_ModHandler.getModItem("Natura", "tree", 1, 1)); // sakura - sLogCache.put("Natura:florasapling:4", GT_ModHandler.getModItem("Natura", "tree", 1, 2)); // ghostwood - sLogCache.put("Natura:florasapling:5", GT_ModHandler.getModItem("Natura", "bloodwood", 1, 0)); // bloodwood - sLogCache.put("Natura:florasapling:6", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 0)); // darkwood - sLogCache.put("Natura:florasapling:7", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 1)); // fusewood - - sLogCache.put("Natura:Rare Sapling:0", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 0)); // maple - sLogCache.put("Natura:Rare Sapling:1", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 1)); // silverbell - sLogCache.put("Natura:Rare Sapling:2", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 2)); // amaranth - sLogCache.put("Natura:Rare Sapling:3", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 3)); // tigerwood - sLogCache.put("Natura:Rare Sapling:4", GT_ModHandler.getModItem("Natura", "willow", 1, 0)); // willow - + mapSaplingToLog("Natura:florasapling:1", GT_ModHandler.getModItem("Natura", "tree", 1, 0)); // eucalyptus + mapSaplingToLog("Natura:florasapling:2", GT_ModHandler.getModItem("Natura", "tree", 1, 3)); // hopseed + mapSaplingToLog("Natura:florasapling:3", GT_ModHandler.getModItem("Natura", "tree", 1, 1)); // sakura + mapSaplingToLog("Natura:florasapling:4", GT_ModHandler.getModItem("Natura", "tree", 1, 2)); // ghostwood + mapSaplingToLog("Natura:florasapling:5", GT_ModHandler.getModItem("Natura", "bloodwood", 1, 0)); // bloodwood + mapSaplingToLog("Natura:florasapling:6", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 0)); // darkwood + mapSaplingToLog("Natura:florasapling:7", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 1)); // fusewood + + mapSaplingToLog("Natura:Rare Sapling:0", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 0)); // maple + mapSaplingToLog("Natura:Rare Sapling:1", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 1)); // silverbell + mapSaplingToLog("Natura:Rare Sapling:2", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 2)); // amaranth + mapSaplingToLog("Natura:Rare Sapling:3", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 3)); // tigerwood + mapSaplingToLog("Natura:Rare Sapling:4", GT_ModHandler.getModItem("Natura", "willow", 1, 0)); // willow + + // BOP + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 0)); // Sacred Oak + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:1", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 2)); // Mangrove + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 3)); // Palm + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:3", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 0)); // Redwood + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:4", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 1)); // Willow + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 0)); // Pine + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:6", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 3)); // Mahogany + mapSaplingToLog("BiomesOPlenty:saplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "bamboo", 1, 0)); // Bamboo + mapSaplingToLog("BiomesOPlenty:saplings:3", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 1)); // Magic + mapSaplingToLog("BiomesOPlenty:saplings:4", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 2)); // Dark + mapSaplingToLog("BiomesOPlenty:saplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 2)); // Dying/Dead + mapSaplingToLog("BiomesOPlenty:saplings:6", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 3)); // Fir + mapSaplingToLog("BiomesOPlenty:saplings:7", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 0)); // Ethereal + mapSaplingToLog("BiomesOPlenty:saplings:10", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // Pink Cherry + mapSaplingToLog("BiomesOPlenty:saplings:12", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // White Cherry + mapSaplingToLog("BiomesOPlenty:saplings:13", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 1)); // Hellbark + mapSaplingToLog("BiomesOPlenty:saplings:14", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 2)); // Jacaranda + mapSaplingToLog("minecraft:yellow_flower:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem + mapSaplingToLog("minecraft:red_flower:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem + + // Witchery + mapSaplingToLog("witchery:witchsapling:0", GT_ModHandler.getModItem("witchery", "witchlog", 1, 0)); // Rowan + mapSaplingToLog("witchery:witchsapling:1", GT_ModHandler.getModItem("witchery", "witchlog", 1, 1)); // Alder + mapSaplingToLog("witchery:witchsapling:2", GT_ModHandler.getModItem("witchery", "witchlog", 1, 2)); // Hawthorn + + // TConstruct - sLogCache.put("TConstruct:slime.sapling:0", GT_ModHandler.getModItem("TConstruct", "slime.gel", 1)); // green - // slime - // blocks + mapSaplingToLog("TConstruct:slime.sapling:0", GT_ModHandler.getModItem("TConstruct", "slime.gel", 1)); // green slime blocks // TaintedMagic - sLogCache.put("TaintedMagic:BlockWarpwoodSapling:0", GT_ModHandler.getModItem("TaintedMagic", "BlockWarpwoodLog", 1)); // warpwood + mapSaplingToLog("TaintedMagic:BlockWarpwoodSapling:0", GT_ModHandler.getModItem("TaintedMagic", "BlockWarpwoodLog", 1)); // warpwood // Thaumcraft - sLogCache.put("Thaumcraft:blockCustomPlant:0", GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 0)); // greatwood - sLogCache.put("Thaumcraft:blockCustomPlant:1", GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 1)); // silverwood + mapSaplingToLog("Thaumcraft:blockCustomPlant:0", GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 0)); // greatwood + mapSaplingToLog("Thaumcraft:blockCustomPlant:1", GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 1)); // silverwood // gt++ - sLogCache.put("miscutils:blockRainforestOakSapling:0", GT_ModHandler.getModItem("miscutils", "blockRainforestOakLog", 1)); // gt++ - // rainforest - sLogCache.put("miscutils:blockPineSapling:0", GT_ModHandler.getModItem("miscutils", "blockPineLogLog", 1)); // gt++ - // pine + mapSaplingToLog("miscutils:blockRainforestOakSapling:0", GT_ModHandler.getModItem("miscutils", "blockRainforestOakLog", 1)); // rainforest + mapSaplingToLog("miscutils:blockPineSapling:0", GT_ModHandler.getModItem("miscutils", "blockPineLogLog", 1)); // pine } public boolean tryDamageTool(ItemStack invItem) { @@ -376,4 +420,63 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< public void construct(ItemStack stackSize, boolean hintsOnly) { buildPiece(mName, stackSize, hintsOnly, 1, 1, 0); } + + public static void mapSaplingToLog(String aSapling, ItemStack aLog) { + ItemStack aSaplingStack = ItemUtils.getItemStackFromFQRN(aSapling, 1); + if (aSaplingStack != null && aLog != null) { + sLogCache.put(aSapling, aLog); + addFakeRecipeToNEI(aSaplingStack, aLog); + } + else { + Logger.INFO("Unable to add Tree Growth Simulation for "+aSapling); + } + } + + private static int sRecipeID = 0; + public static boolean addFakeRecipeToNEI(ItemStack aSapling, ItemStack aLog) { + if (sFertFluid == null) { + sFertFluid = gtPlusPlus.core.item.ModItems.fluidFertBasic; + } + int aRecipes = GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size(); + Logger.INFO("Adding Tree Growth Simulation for "+aSapling.getDisplayName()+" -> "+aLog.getDisplayName()); + ItemStack[] aOutput = new ItemStack[] {aLog, aSapling}; + GT_Recipe aRecipe = new GT_Recipe( + false, + new ItemStack[] {aSapling.copy()}, + aOutput, + null, + new int[] {10000, 1000}, + new FluidStack[] {FluidUtils.getFluidStack(sFertFluid, 1)}, + new FluidStack[] {}, + 1, + sRecipeID++, + 0); + aRecipe.mOutputs = aOutput; + String aOutputs = ItemUtils.getArrayStackNames(aRecipe.mOutputs); + Logger.INFO(""+aOutputs); + GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe(false, aRecipe); + return GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size() > aRecipes; + } + + private static Fluid sFertFluid; + + public int hasLiquidFert() { + if (sFertFluid == null) { + sFertFluid = gtPlusPlus.core.item.ModItems.fluidFertBasic; + } + ArrayList aFluids = this.getStoredFluids(); + for (FluidStack aFluid : aFluids) { + if (aFluid.getFluid() == sFertFluid) { + return aFluid.amount; + } + } + return 0; + } + + public boolean tryConsumeLiquidFert(int aFluidAmount) { + if (sFertFluid == null) { + sFertFluid = gtPlusPlus.core.item.ModItems.fluidFertBasic; + } + return this.depleteInput(FluidUtils.getFluidStack(sFertFluid, aFluidAmount)); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java index 20a8d7e964..02ae2b1b4f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java @@ -63,11 +63,12 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur } return 0; } - + + @Override public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { try { ArrayList aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies(); @@ -87,7 +88,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur } } } - //log("Found "+getFullTurbineAssemblies().size()+" Assemblies with a Turbine."); + log("Found "+getFullTurbineAssemblies().size()+" Assemblies with a Turbine."); if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) { log("BAD RETURN - 1"); @@ -95,7 +96,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur return false; } - //log("Running checkRecipeGeneric(0)"); + log("Running checkRecipeGeneric(0)"); ArrayList tFluids = getStoredFluids(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java index 4b2f60abd1..5524b1635c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java @@ -425,13 +425,15 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM @Override public boolean checkRecipe(final ItemStack aStack) { + log("1"); return checkRecipeGeneric(new ItemStack[] {}, getStoredFluids().toArray(new FluidStack[] {}), 1, 100, 100, 10000); } + @Override public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { try { ArrayList aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java index d2fb97010a..724f352975 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java @@ -18,6 +18,7 @@ public class Gregtech_Blocks { ModBlocks.blockSpecialMultiCasings = new GregtechMetaSpecialMultiCasings(); ModBlocks.blockSpecialMultiCasings2 = new GregtechMetaSpecialMultiCasings2(); ModBlocks.blockCustomMachineCasings = new GregtechMetaSpecialMachineCasings(); + ModBlocks.blockCustomPipeGearCasings = new GregtechMetaCasingBlocksPipeGearbox(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java new file mode 100644 index 0000000000..b32917482d --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java @@ -0,0 +1,22 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialFluidHeater; + +public class GregtechIndustrialFluidHeater { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Industrial Thermal Centrifuge Multiblock."); + run1(); + } + + } + + private static void run1() { + GregtechItemList.Controller_IndustrialFluidHeater.set(new GregtechMetaTileEntity_IndustrialFluidHeater(31077, + "industrialfluidheater.controller.tier.single", "Thermic Heating Device").getStackForm(1L)); + + } +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java index 47dd3c265f..11c4f4dae8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java @@ -10,8 +10,8 @@ public class GregtechIndustrialTreeFarm { public static void run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - Logger.INFO("Gregtech5u Content | Registering Tree Farm Multiblock."); if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer) { + Logger.INFO("Gregtech5u Content | Registering Tree Farm Multiblock."); run1(); } } @@ -19,10 +19,9 @@ public class GregtechIndustrialTreeFarm { } private static void run1() { - // Industrial Maceration Stack Multiblock GregtechItemList.Industrial_TreeFarm .set(new GregtechMetaTileEntityTreeFarm(836, "treefarm.controller.tier.single", "Tree Growth Simulator") .getStackForm(1L)); - + GregtechMetaTileEntityTreeFarm.loadMapWoodFromSapling(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java index 282ca1ffaa..0b3d90a079 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_HeatExchanger; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Gas; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Plasma; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_SHSteam; @@ -24,5 +25,6 @@ public class GregtechLargeTurbinesAndHeatExchanger { GregtechItemList.Large_Gas_Turbine.set(new GT_MTE_LargeTurbine_Gas(31073, "multimachine.largergasturbine", "XL Turbo Gas Turbine").getStackForm(1L)); GregtechItemList.Large_Plasma_Turbine.set(new GT_MTE_LargeTurbine_Plasma(31074, "multimachine.largerplasmaturbine", "XL Turbo Plasma Turbine").getStackForm(1L)); GregtechItemList.Hatch_Turbine_Rotor.set(new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L)); + GregtechItemList.XL_HeatExchanger.set(new GregtechMetaTileEntity_Adv_HeatExchanger(31079, "multimachine.reallybigheatexchanger", "Whakawhiti Wera XL").getStackForm(1L)); } -} \ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java index add0400d87..271396ad5b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java @@ -4,6 +4,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam.GregtechMetaTileEntity_SteamCompressor; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam.GregtechMetaTileEntity_SteamMacerator; public class GregtechSteamMultis { @@ -13,7 +14,8 @@ public class GregtechSteamMultis { Logger.INFO("Gregtech5u Content | Registering Steam Multiblocks."); GregtechItemList.Controller_SteamMaceratorMulti.set(new GregtechMetaTileEntity_SteamMacerator(31041, "gtpp.multimachine.steam.macerator", "Steam Grinder").getStackForm(1L)); - + GregtechItemList.Controller_SteamCompressorMulti.set(new GregtechMetaTileEntity_SteamCompressor(31078, "gtpp.multimachine.steam.compressor", "Steam Squasher").getStackForm(1L)); + GregtechItemList.Hatch_Input_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusInput(31046, "hatch.input_bus.tier.steam", "Input Bus (Steam)", 0).getStackForm(1L)); GregtechItemList.Hatch_Output_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusOutput(31047, "hatch.output_bus.tier.steam", "Output Bus (Steam)", 0).getStackForm(1L)); diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ABYSSAL.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ABYSSAL.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ABYSSAL.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_GENERIC.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_GENERIC.png new file mode 100644 index 0000000000..8b3142daf4 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_GENERIC.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCONEL_792.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCONEL_792.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_INCONEL_792.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_NITINOL_60.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_NITINOL_60.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_NITINOL_60.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ZERON_100.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ZERON_100.png new file mode 100644 index 0000000000..d680025de6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_GEARBOX_ZERON_100.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_ABYSSAL.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_ABYSSAL.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_ABYSSAL.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_CINOBITE.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_CINOBITE.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_CINOBITE.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_GENERIC.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_GENERIC.png new file mode 100644 index 0000000000..6d8c956606 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_GENERIC.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_INCONEL_690.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_INCONEL_690.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_INCONEL_690.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_LAFIUM.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_LAFIUM.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_LAFIUM.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_NITINOL_60.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_NITINOL_60.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_NITINOL_60.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_STELLITE.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_STELLITE.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_STELLITE.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_TITANSTEEL.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_TITANSTEEL.png new file mode 100644 index 0000000000..bb2f520e30 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/iconsets/MACHINE_CASING_PIPE_TITANSTEEL.png differ -- cgit