From eff844b6e222b578bc0baadbe84f94912cb819f7 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 21 Dec 2021 17:17:34 +0000 Subject: Add Multiblock Forge Hammer. Add base for Multiblock Molecular Transformer. --- .../common/blocks/GregtechMetaCasingBlocks5.java | 6 +- .../common/blocks/textures/TexturesGtBlock.java | 5 + ...egtechMetaTileEntity_IndustrialForgeHammer.java | 327 +++++++++++++++++++++ ...aTileEntity_IndustrialMolecularTransformer.java | 312 ++++++++++++++++++++ 4 files changed, 649 insertions(+), 1 deletion(-) create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common') 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 61c71ba552..841ea582ad 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -32,7 +32,8 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing + TAE.registerTexture(1, 11, new GT_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 @@ -48,6 +49,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2)); GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3)); GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_IndustrialForgeHammer.set(new ItemStack(this, 1, 6)); } @Override @@ -69,6 +71,8 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon(); case 4: return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); + case 6: + return TexturesGtBlock.TEXTURE_TECH_PANEL_H.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 518ffe0eae..59e4f2e4b3 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 @@ -494,6 +494,11 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_TECH_PANEL_B = new CustomIcon("metro/TEXTURE_TECH_PANEL_B"); public static final CustomIcon TEXTURE_TECH_PANEL_C = new CustomIcon("metro/TEXTURE_TECH_PANEL_C"); public static final CustomIcon TEXTURE_TECH_PANEL_D = new CustomIcon("metro/TEXTURE_TECH_PANEL_D"); + public static final CustomIcon TEXTURE_TECH_PANEL_E = new CustomIcon("metro/TEXTURE_TECH_PANEL_E"); + public static final CustomIcon TEXTURE_TECH_PANEL_F = new CustomIcon("metro/TEXTURE_TECH_PANEL_F"); + public static final CustomIcon TEXTURE_TECH_PANEL_G = new CustomIcon("metro/TEXTURE_TECH_PANEL_G"); + public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H"); + public static final CustomIcon TEXTURE_TECH_PANEL_I = new CustomIcon("metro/TEXTURE_TECH_PANEL_I"); public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon("TileEntities/DecayablesChest_bottom"); public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon("TileEntities/DecayablesChest_top"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java new file mode 100644 index 0000000000..03197c47ca --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java @@ -0,0 +1,327 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import java.util.ArrayList; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialForgeHammer extends GregtechMeta_MultiBlockBase { + + private int mCasing; + private IStructureDefinition STRUCTURE_DEFINITION = null; + + public GregtechMetaTileEntity_IndustrialForgeHammer(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialForgeHammer(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialForgeHammer(this.mName); + } + + @Override + public String getMachineType() { + return "Forge Hammer"; + } + + @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 Forge Hammer") + .addInfo("Speed: 100% x Anvil Tier | Eu Usage: 100% | Parallel: Tier x 8") + .addInfo("T1 - Vanilla Anvil"); + if (LoadedMods.Railcraft) { + tt.addInfo("T2 - Steel Anvil"); + } + if (LoadedMods.EnderIO) { + tt.addInfo("T3 - Dark Steel Anvil"); + } + if (LoadedMods.ThaumicBases) { + tt.addInfo("T3 - Thaumic Anvil"); + tt.addInfo("T4 - Void Anvil"); + } + tt.addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfo("Forge Casing", 10) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any 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[][]{ + {"CCC", "CCC", "CCC"}, + {"C~C", "CAC", "CCC"}, + {"CCC", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings5Misc, 6 + ) + ) + ) + ) + .addElement( + 'A', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings5Misc, 6 + ) + ) + ) + ) + + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch(); + } + + public final boolean addIndustrialForgeHammerList(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_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(1); + } + + @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(1, 11)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(1, 11))}; + } + + @Override + public boolean hasSlotInGUI() { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return "MaterialPress"; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sHammerRecipes; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + Block aAnvil = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getBackFacing()); + if (aAnvil != null) { + int aAnvilTier = getAnvilTier(aAnvil); + if (aAnvilTier > 0) { + for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { + ArrayList tBusItems = new ArrayList(); + tBus.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tBus)) { + for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) + tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), new FluidStack[]{}, getMaxParallelRecipes(), 100, 100 * aAnvilTier, 10000)) { + return true; + } + } + } + } + return false; + } + + @Override + public int getMaxParallelRecipes() { + return (8 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + + @Override + public int getEuDiscountForParallelism() { + return 100; + } + + @Override + public void startProcess() { + this.sendLoopStart((byte) 1); + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialForgeHammer; + } + + @Override + public int getAmountOfOutputs() { + return 1; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + private static Block sAnvil; + private static Block sSteelAnvil; + private static Block sDarkSteelAnvil; + private static Block sThaumiumAnvil; + private static Block sVoidAnvil; + + private static void setAnvilBlocks() { + if (sAnvil == null) { + sAnvil = Blocks.anvil; + if (LoadedMods.Railcraft) { + sSteelAnvil = GameRegistry.findBlock("Railcraft", "anvil"); + } + if (LoadedMods.EnderIO) { + sDarkSteelAnvil = GameRegistry.findBlock("EnderIO", "blockDarkSteelAnvil"); + } + if (LoadedMods.ThaumicBases) { + sThaumiumAnvil = GameRegistry.findBlock("thaumicbases", "thaumicAnvil"); + sVoidAnvil = GameRegistry.findBlock("thaumicbases", "voidAnvil"); + } + } + } + + public static boolean isBlockAnvil(Block aBlock) { + setAnvilBlocks(); + if (sAnvil == aBlock) { + return true; + } + if (LoadedMods.Railcraft) { + if (sSteelAnvil == aBlock) { + return true; + } + } + if (LoadedMods.EnderIO) { + if (sDarkSteelAnvil == aBlock) { + return true; + } + } + if (LoadedMods.ThaumicBases) { + if (sThaumiumAnvil == aBlock || sVoidAnvil == aBlock) { + return true; + } + } + return false; + } + + public static int getAnvilTier(Block aBlock) { + if (isBlockAnvil(aBlock)) { + if (sAnvil == aBlock) { + return 1; + } + if (LoadedMods.Railcraft) { + if (sSteelAnvil == aBlock) { + return 2; + } + } + if (LoadedMods.EnderIO) { + if (sDarkSteelAnvil == aBlock) { + return 3; + } + } + if (LoadedMods.ThaumicBases) { + if (sThaumiumAnvil == aBlock) { + return 3; + } + if (sVoidAnvil == aBlock) { + return 4; + } + } + } + return 0; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java new file mode 100644 index 0000000000..b8e8a904b7 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java @@ -0,0 +1,312 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +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.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialMolecularTransformer extends GregtechMeta_MultiBlockBase { + + public static int CASING_TEXTURE_ID; + private int mCasing; + private IStructureDefinition STRUCTURE_DEFINITION = null; + + + public GregtechMetaTileEntity_IndustrialMolecularTransformer(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); + } + + public GregtechMetaTileEntity_IndustrialMolecularTransformer(final String aName) { + super(aName); + CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); + } + + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialMolecularTransformer(this.mName); + } + + @Override + public String getMachineType() { + return "Molecular Transformer"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Advanced Vacuum Freezer") + .addInfo("Speed: 200% | Eu Usage: 100% | Parallel: 4") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfo("CASING", 10) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any 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[][]{ + {"CCC", "CCC", "CCC"}, + {"C~C", "C-C", "CCC"}, + {"CCC", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialMolecularTransformer::addIndustrialVacuumFreezerList, CASING_TEXTURE_ID, 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings3Misc, 10 + ) + ) + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch(); + } + + public final boolean addIndustrialVacuumFreezerList(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_OutputBus) { + 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); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + + 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(CASING_TEXTURE_ID), + new GT_RenderedTexture((IIconContainer) (aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced))}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID)}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "VacuumFreezer"; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GTPP_Recipe_Map.sMolecularTransformerRecipes; + } + + public boolean isCorrectMachinePart(final ItemStack aStack) { + return true; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + return this.checkRecipeGeneric(4, 100, 100); + } + + @Override + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + // Based on the Processing Array. A bit overkill, but very flexible. + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + ItemStack[] tInputs = getCompactedInputs(); + FluidStack[] tFluids = new FluidStack[] {}; + + if (tInputs.length <= 0) { + log("Error 1"); + return false; + } + + long tVoltage = getMaxInputVoltage(); + log("Voltage: "+tVoltage); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + log("Tier: "+tTier); + GT_Recipe tRecipe = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + log("Error 2"); + return false; + } + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + calculateOverclockedNessMulti(tRecipe.mEUt*tRecipe.mSpecialValue, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) { + log("Error 3"); + return false; + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + log("EU/t: "+this.mEUt); + this.mMaxProgresstime = Math.max(mMaxProgresstime/tRecipe.mSpecialValue, 1); + log("Total Time: "+this.mMaxProgresstime); + if (tRecipe.mOutputs.length > 0) { + this.mOutputItems = tRecipe.mOutputs.clone(); + } + updateSlots(); + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("Running"); + return true; + } + + @Override + public int getMaxParallelRecipes() { + return 1; + } + + @Override + public int getEuDiscountForParallelism() { + return 100; + } + + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialVacuumFreezer; + } + + public int getDamageToComponent(final ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public boolean drainEnergyInput(long aEU) { + if (aEU <= 0) { + return true; + } + for (GT_MetaTileEntity_Hatch tHatch : this.mAllEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) { + return true; + } + } + } + return false; + } + + @Override + public long getMaxInputVoltage() { + long rVoltage = 0; + for (GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + } + } + return rVoltage; + } + + /** + * Called every tick the Machine runs + */ + @Override + public boolean onRunningTick(ItemStack aStack) { + if (mEUt < 0) { + if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) { + criticalStopMachine(); + return false; + } + } + return true; + } + +} \ No newline at end of file -- cgit From 279e29333ea4b06bb6be052fc3ffde792aaa4b0e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Wed, 22 Dec 2021 05:11:18 +0000 Subject: Re-added XL Turbines. Added Xl Gas/Plasma Turbines. --- .../blocks/GregtechMetaSpecialMultiCasings.java | 70 +-- .../turbine/LargeTurbineTextureHandler.java | 350 ++++++------ ...egtechMetaTileEntity_IndustrialForgeHammer.java | 30 +- .../production/GregtechMTE_FrothFlotationCell.java | 2 +- .../turbines/GT_MTE_LargeTurbine_Gas.java | 165 ++++++ .../turbines/GT_MTE_LargeTurbine_Plasma.java | 155 ++++++ .../turbines/GT_MTE_LargeTurbine_SHSteam.java | 65 ++- .../turbines/GT_MTE_LargeTurbine_Steam.java | 66 ++- .../GregtechMetaTileEntity_LargerTurbineBase.java | 587 ++++++++++----------- 9 files changed, 896 insertions(+), 594 deletions(-) create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common') 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 5a5c923d10..0eccd75b66 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -2,21 +2,24 @@ package gtPlusPlus.xmod.gregtech.common.blocks; import java.util.List; +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.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbstract { - - - public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { + + public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { public SpecialCasingItemBlock(Block par1) { super(par1); @@ -67,36 +70,43 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GregtechItemList.Casing_Flotation_Cell.set(new ItemStack(this, 1, 9)); GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 10)); } - - public IIcon getIcon(int aSide, int aMeta) { - + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + return LargeTurbineTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, this); + } + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + return getStaticIcon((byte) aSide, (byte) aMeta); + } + + public static IIcon getStaticIcon(final byte aSide, final byte aMeta) { switch (aMeta) { + case 0: + return TexturesGtBlock.Casing_Redox_1.getIcon(); + case 1: + return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); + case 2: + return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 3: + return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); + case 4: + return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + case 5: + return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); + case 6: + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + case 7: + return TexturesGtBlock.Casing_Material_Stellite.getIcon(); + case 8: + return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + case 9: + return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon(); + case 10: + return TexturesGtBlock.Casing_Material_Talonite.getIcon(); - case 0: - return TexturesGtBlock.Casing_Redox_1.getIcon(); - case 1: - return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); - case 2: - return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); - case 3: - return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); - case 4: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); - case 5: - return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); - case 6: - return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); - case 7: - return TexturesGtBlock.Casing_Material_Stellite.getIcon(); - case 8: - return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); - case 9: - return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon(); - case 10: - return TexturesGtBlock.Casing_Material_Talonite.getIcon(); - } - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java index c3d6a655c3..ec93c4379d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java @@ -1,180 +1,237 @@ -/* package gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE9; +import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks4; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaSpecialMultiCasings; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; public class LargeTurbineTextureHandler { - */ -/** + /** * LP Turbines - *//* - - private static CustomIcon aTex1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_1"); - private static CustomIcon aTex1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_1"); - private static CustomIcon aTex2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_2"); - private static CustomIcon aTex2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_2"); - private static CustomIcon aTex3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_3"); - private static CustomIcon aTex3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_3"); - private static CustomIcon aTex4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_4"); - private static CustomIcon aTex4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_4"); - private static CustomIcon aTex5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_5"); - private static CustomIcon aTex5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_5"); - private static CustomIcon aTex6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_6"); - private static CustomIcon aTex6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_6"); - private static CustomIcon aTex7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_7"); - private static CustomIcon aTex7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_7"); - private static CustomIcon aTex8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_8"); - private static CustomIcon aTex8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_8"); - private static CustomIcon aTex9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_9"); - private static CustomIcon aTex9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_9"); - - private static CustomIcon frontFace_0 = (aTex1); - private static CustomIcon frontFaceActive_0 = (aTex1_Active); - private static CustomIcon frontFace_1 = (aTex2); - private static CustomIcon frontFaceActive_1 = (aTex2_Active); - private static CustomIcon frontFace_2 = (aTex3); - private static CustomIcon frontFaceActive_2 = (aTex3_Active); - private static CustomIcon frontFace_3 = (aTex4); - private static CustomIcon frontFaceActive_3 = (aTex4_Active); - public static CustomIcon frontFace_4 = (aTex5); - public static CustomIcon frontFaceActive_4 = (aTex5_Active); - private static CustomIcon frontFace_5 = (aTex6); - private static CustomIcon frontFaceActive_5 = (aTex6_Active); - private static CustomIcon frontFace_6 = (aTex7); - private static CustomIcon frontFaceActive_6 = (aTex7_Active); - private static CustomIcon frontFace_7 = (aTex8); - private static CustomIcon frontFaceActive_7 = (aTex8_Active); - private static CustomIcon frontFace_8 = (aTex9); - private static CustomIcon frontFaceActive_8 = (aTex9_Active); + */ - CustomIcon[] OVERLAY_LP_TURBINE = new CustomIcon[]{ - frontFace_0, - frontFace_1, - frontFace_2, - frontFace_3, - frontFace_4, - frontFace_5, - frontFace_6, - frontFace_7, - frontFace_8 + public static BlockIcons[] OVERLAY_LP_TURBINE = new BlockIcons[]{ + LARGETURBINE_ST1, + LARGETURBINE_ST2, + LARGETURBINE_ST3, + LARGETURBINE_ST4, + LARGETURBINE_ST5, + LARGETURBINE_ST6, + LARGETURBINE_ST7, + LARGETURBINE_ST8, + LARGETURBINE_ST9, }; - CustomIcon[] OVERLAY_LP_TURBINE_ACTIVE = new CustomIcon[]{ - frontFaceActive_0, - frontFaceActive_1, - frontFaceActive_2, - frontFaceActive_3, - frontFaceActive_4, - frontFaceActive_5, - frontFaceActive_6, - frontFaceActive_7, - frontFaceActive_8 + public static BlockIcons[] OVERLAY_LP_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_ST_ACTIVE1, + LARGETURBINE_ST_ACTIVE2, + LARGETURBINE_ST_ACTIVE3, + LARGETURBINE_ST_ACTIVE4, + LARGETURBINE_ST_ACTIVE5, + LARGETURBINE_ST_ACTIVE6, + LARGETURBINE_ST_ACTIVE7, + LARGETURBINE_ST_ACTIVE8, + LARGETURBINE_ST_ACTIVE9, }; - - */ -/** + /** * HP Turbines - *//* - - private static CustomIcon aTexHP1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_1"); - private static CustomIcon aTexHP1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_1"); - private static CustomIcon aTexHP2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_2"); - private static CustomIcon aTexHP2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_2"); - private static CustomIcon aTexHP3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_3"); - private static CustomIcon aTexHP3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_3"); - private static CustomIcon aTexHP4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_4"); - private static CustomIcon aTexHP4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_4"); - private static CustomIcon aTexHP5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_5"); - private static CustomIcon aTexHP5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_5"); - private static CustomIcon aTexHP6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_6"); - private static CustomIcon aTexHP6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_6"); - private static CustomIcon aTexHP7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_7"); - private static CustomIcon aTexHP7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_7"); - private static CustomIcon aTexHP8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_8"); - private static CustomIcon aTexHP8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_8"); - private static CustomIcon aTexHP9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_9"); - private static CustomIcon aTexHP9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_9"); + */ - private static CustomIcon frontFaceHP_0 = (aTexHP1); - private static CustomIcon frontFaceHPActive_0 = (aTexHP1_Active); - private static CustomIcon frontFaceHP_1 = (aTexHP2); - private static CustomIcon frontFaceHPActive_1 = (aTexHP2_Active); - private static CustomIcon frontFaceHP_2 = (aTexHP3); - private static CustomIcon frontFaceHPActive_2 = (aTexHP3_Active); - private static CustomIcon frontFaceHP_3 = (aTexHP4); - private static CustomIcon frontFaceHPActive_3 = (aTexHP4_Active); - public static CustomIcon frontFaceHP_4 = (aTexHP5); - public static CustomIcon frontFaceHPActive_4 = (aTexHP5_Active); - private static CustomIcon frontFaceHP_5 = (aTexHP6); - private static CustomIcon frontFaceHPActive_5 = (aTexHP6_Active); - private static CustomIcon frontFaceHP_6 = (aTexHP7); - private static CustomIcon frontFaceHPActive_6 = (aTexHP7_Active); - private static CustomIcon frontFaceHP_7 = (aTexHP8); - private static CustomIcon frontFaceHPActive_7 = (aTexHP8_Active); - private static CustomIcon frontFaceHP_8 = (aTexHP9); - private static CustomIcon frontFaceHPActive_8 = (aTexHP9_Active); - - CustomIcon[] OVERLAY_HP_TURBINE = new CustomIcon[]{ - frontFaceHP_0, - frontFaceHP_1, - frontFaceHP_2, - frontFaceHP_3, - frontFaceHP_4, - frontFaceHP_5, - frontFaceHP_6, - frontFaceHP_7, - frontFaceHP_8 + public static BlockIcons[] OVERLAY_HP_TURBINE = new BlockIcons[]{ + LARGETURBINE_TI1, + LARGETURBINE_TI2, + LARGETURBINE_TI3, + LARGETURBINE_TI4, + LARGETURBINE_TI5, + LARGETURBINE_TI6, + LARGETURBINE_TI7, + LARGETURBINE_TI8, + LARGETURBINE_TI9, }; - CustomIcon[] OVERLAY_HP_TURBINE_ACTIVE = new CustomIcon[]{ - frontFaceHPActive_0, - frontFaceHPActive_1, - frontFaceHPActive_2, - frontFaceHPActive_3, - frontFaceHPActive_4, - frontFaceHPActive_5, - frontFaceHPActive_6, - frontFaceHPActive_7, - frontFaceHPActive_8 + public static BlockIcons[] OVERLAY_HP_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_TI_ACTIVE1, + LARGETURBINE_TI_ACTIVE2, + LARGETURBINE_TI_ACTIVE3, + LARGETURBINE_TI_ACTIVE4, + LARGETURBINE_TI_ACTIVE5, + LARGETURBINE_TI_ACTIVE6, + LARGETURBINE_TI_ACTIVE7, + LARGETURBINE_TI_ACTIVE8, + LARGETURBINE_TI_ACTIVE9, + }; + + /** + * Gas Turbines + */ + + public static BlockIcons[] OVERLAY_GAS_TURBINE = new BlockIcons[]{ + LARGETURBINE_SS1, + LARGETURBINE_SS2, + LARGETURBINE_SS3, + LARGETURBINE_SS4, + LARGETURBINE_SS5, + LARGETURBINE_SS6, + LARGETURBINE_SS7, + LARGETURBINE_SS8, + LARGETURBINE_SS9, }; + public static BlockIcons[] OVERLAY_GAS_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_SS_ACTIVE1, + LARGETURBINE_SS_ACTIVE2, + LARGETURBINE_SS_ACTIVE3, + LARGETURBINE_SS_ACTIVE4, + LARGETURBINE_SS_ACTIVE5, + LARGETURBINE_SS_ACTIVE6, + LARGETURBINE_SS_ACTIVE7, + LARGETURBINE_SS_ACTIVE8, + LARGETURBINE_SS_ACTIVE9, + }; + + /** + * Plasma Turbines + */ + + public static BlockIcons[] OVERLAY_PLASMA_TURBINE = new BlockIcons[]{ + LARGETURBINE_TU1, + LARGETURBINE_TU2, + LARGETURBINE_TU3, + LARGETURBINE_TU4, + LARGETURBINE_TU5, + LARGETURBINE_TU6, + LARGETURBINE_TU7, + LARGETURBINE_TU8, + LARGETURBINE_TU9, + }; + public static BlockIcons[] OVERLAY_PLASMA_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_TU_ACTIVE1, + LARGETURBINE_TU_ACTIVE2, + LARGETURBINE_TU_ACTIVE3, + LARGETURBINE_TU_ACTIVE4, + LARGETURBINE_TU_ACTIVE5, + LARGETURBINE_TU_ACTIVE6, + LARGETURBINE_TU_ACTIVE7, + LARGETURBINE_TU_ACTIVE8, + LARGETURBINE_TU_ACTIVE9, + }; - public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks4 thisBlock) { + public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaSpecialMultiCasings i) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - //7 - shaft - //8 LP - //9 HP + //0 shaft + //1 LP + //2 HP + //3 Gas + //4 Plasma - CustomIcon[] mGetCurrentTextureSet = null, mGetCurrentTextureSet_ACTIVE = null; + BlockIcons[] mGetCurrentTextureSet = null; + BlockIcons[] mGetCurrentTextureSet_ACTIVE = null; - if (tMeta <= 6 || tMeta >= 10) { - return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + if (tMeta <= 0 || tMeta >= 5) { + return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta); } else { - if (tMeta == 8) { + if (tMeta == 1) { mGetCurrentTextureSet = OVERLAY_LP_TURBINE; mGetCurrentTextureSet_ACTIVE = OVERLAY_LP_TURBINE_ACTIVE; } - else if (tMeta == 9) { + else if (tMeta == 2) { mGetCurrentTextureSet = OVERLAY_HP_TURBINE; mGetCurrentTextureSet_ACTIVE = OVERLAY_HP_TURBINE_ACTIVE; } + else if (tMeta == 3) { + mGetCurrentTextureSet = OVERLAY_GAS_TURBINE; + mGetCurrentTextureSet_ACTIVE = OVERLAY_GAS_TURBINE_ACTIVE; + } + else if (tMeta == 4) { + mGetCurrentTextureSet = OVERLAY_PLASMA_TURBINE; + mGetCurrentTextureSet_ACTIVE = OVERLAY_PLASMA_TURBINE_ACTIVE; + } if (mGetCurrentTextureSet == null || mGetCurrentTextureSet_ACTIVE == null) { - return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta); } @@ -283,28 +340,26 @@ public class LargeTurbineTextureHandler { } } } - return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta); } - public boolean isUsingAnimatedTexture(TileEntity tTileEntity) { + public static boolean isUsingAnimatedTexture(TileEntity tTileEntity) { boolean aVal = true; - */ -/*IGregTechTileEntity aTile; + IGregTechTileEntity aTile; if (tTileEntity instanceof IGregTechTileEntity) { aTile = (IGregTechTileEntity) tTileEntity; if (aTile != null) { final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).isControllerActive(); - Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); + //Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); } } - } *//* - + } return aVal; } - public GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) { + public static GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) { if (aTileEntity != null) { final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { @@ -315,4 +370,3 @@ public class LargeTurbineTextureHandler { } } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java index 03197c47ca..89e1e303a8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java @@ -100,34 +100,14 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer extends GregtechMeta_M {"C~C", "CAC", "CCC"}, {"CCC", "CCC", "CCC"}, })) - .addElement( - 'C', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 - ), - onElementPass( - x -> ++x.mCasing, - ofBlock( - ModBlocks.blockCasings5Misc, 6 - ) - ) - ) - ) - .addElement( - 'A', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 - ), - onElementPass( - x -> ++x.mCasing, - ofBlock( - ModBlocks.blockCasings5Misc, 6 - ) + .addElement('C', ofChain( + ofHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 ), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6) ) ) ) + + //.addElement('A', ofBlockAdder(GregtechMetaTileEntity_IndustrialForgeHammer::isBlockAnvil, Blocks.anvil, 1)) .build(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 8a936525f0..5ff8330372 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -222,7 +222,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); // Fix GT bug - if (this.getBaseMetaTileEntity().getFrontFacing() == 0 && this.getBaseMetaTileEntity().getBackFacing() == 1) { + if (this.getBaseMetaTileEntity().getFrontFacing() != 1) { log("Fixing Bad Facing. (GT Bug)"); this.getBaseMetaTileEntity().setFrontFacing((byte) 1); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java new file mode 100644 index 0000000000..53b3f491cc --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java @@ -0,0 +1,165 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; + +import static gtPlusPlus.core.lib.CORE.RANDOM; + +import java.util.ArrayList; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + +@SuppressWarnings("deprecation") +public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbineBase { + + public GT_MTE_LargeTurbine_Gas(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + + public GT_MTE_LargeTurbine_Gas(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MTE_LargeTurbine_Gas(mName); + } + + @Override + public int getCasingMeta() { + return 3; + } + + @Override + public byte getCasingTextureIndex() { + return 58; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 15; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null) return 0; + GT_Recipe tFuel = GT_Recipe_Map.sTurbineFuels.findFuel(aLiquid); + if (tFuel != null) return tFuel.mSpecialValue; + return 0; + } + + @Override + int fluidIntoPower(ArrayList aFluids, int aOptFlow, int aBaseEff) { + if (aFluids.size() >= 1) { + int tEU = 0; + int actualOptimalFlow = 0; + + FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + int fuelValue = getFuelValue(firstFuelType); + + if (aOptFlow < fuelValue) { + // turbine too weak and/or fuel too powerful + // at least consume 1L + this.realOptFlow = 1; + // wastes the extra fuel and generate aOptFlow directly + depleteInput(new FluidStack(firstFuelType, 1)); + this.storedFluid += 1; + return GT_Utility.safeInt((long) aOptFlow * (long) aBaseEff / 10000L); + } + + actualOptimalFlow = GT_Utility.safeInt((long) aOptFlow / fuelValue); + this.realOptFlow = actualOptimalFlow; + + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int flow = 0; + int totalFlow = 0; + + storedFluid = 0; + for (FluidStack aFluid : aFluids) { + if (aFluid.isFluidEqual(firstFuelType)) { + flow = Math.min(aFluid.amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluid, flow)); // deplete that amount + this.storedFluid += aFluid.amount; + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used + } + } + if (totalFlow <= 0) return 0; + tEU = GT_Utility.safeInt((long) totalFlow * fuelValue); + + if (totalFlow == actualOptimalFlow) { + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); + } else { + float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); + tEU *= efficiency; + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); + } + + return tEU; + + } + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return (looseFit && RANDOM.nextInt(4)==0)?0:1; + } + + + @Override + public String[] getExtraInfoData() { + super.looseFit = looseFit; + return super.getInfoData(); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("turbineFitting",looseFit); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + looseFit=aNBT.getBoolean("turbineFitting"); + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + + @Override + public String getMachineType() { + return "Large Steam Turbine"; + } + + @Override + protected String getTurbineType() { + return "Steam"; + } + + @Override + protected String getCasingName() { + return "Reinforced Steam Turbine Casing"; + } + + @Override + protected ITexture getTextureFrontFace() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5); + } + + @Override + protected ITexture getTextureFrontFaceActive() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5); + } + +} 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 new file mode 100644 index 0000000000..f815811ece --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java @@ -0,0 +1,155 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; + +import java.util.ArrayList; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +@SuppressWarnings("deprecation") +public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTurbineBase { + + public GT_MTE_LargeTurbine_Plasma(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + + public GT_MTE_LargeTurbine_Plasma(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MTE_LargeTurbine_Plasma(mName); + } + + @Override + public int getCasingMeta() { + return 4; + } + + @Override + public byte getCasingTextureIndex() { + return 60; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null) return 0; + GT_Recipe tFuel = GT_Recipe_Map.sPlasmaFuels.findFuel(aLiquid); + if (tFuel != null) return tFuel.mSpecialValue; + return 0; + } + + @Override + int fluidIntoPower(ArrayList aFluids, int aOptFlow, int aBaseEff) { + if (aFluids.size() >= 1) { + aOptFlow *= 800;//CHANGED THINGS HERE, check recipe runs once per 20 ticks + int tEU = 0; + + int actualOptimalFlow = 0; + + FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + int fuelValue = getFuelValue(firstFuelType); + actualOptimalFlow = GT_Utility.safeInt((long) Math.ceil((double) aOptFlow / (double) fuelValue)); + this.realOptFlow = actualOptimalFlow; // For scanner info + + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int flow = 0; + int totalFlow = 0; + + storedFluid = 0; + for (FluidStack aFluid : aFlu