aboutsummaryrefslogtreecommitdiff
path: root/main/java/gregtech/common/tileentities/machines/multi
diff options
context:
space:
mode:
Diffstat (limited to 'main/java/gregtech/common/tileentities/machines/multi')
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java402
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java192
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java243
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java445
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java53
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java52
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java54
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java303
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java174
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java259
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java75
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java75
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java75
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java75
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java192
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java116
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java96
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java115
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java105
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java189
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java298
-rw-r--r--main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java169
22 files changed, 0 insertions, 3757 deletions
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
deleted file mode 100644
index f510d064bb..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
+++ /dev/null
@@ -1,402 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.gui.GT_Container_BronzeBlastFurnace;
-import gregtech.common.gui.GT_GUIContainer_BronzeBlastFurnace;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class GT_MetaTileEntity_BronzeBlastFurnace
- extends MetaTileEntity
-{
- public int mMaxProgresstime = 0;
- public int mUpdate = 5;
- public int mProgresstime = 0;
- public boolean mMachine = false;
- private static final ITexture[] FACING_SIDE = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS) };
- private static final ITexture[] FACING_FRONT = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE) };
- private static final ITexture[] FACING_ACTIVE = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE) };
- public ItemStack mOutputItem1;
- public ItemStack mOutputItem2;
-
- public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, 4);
- }
-
- public GT_MetaTileEntity_BronzeBlastFurnace(String aName)
- {
- super(aName, 4);
- }
-
- public String[] getDescription()
- {
- return new String[] { "To get your first Steel", "Multiblock: 3x3x4 hollow with opening on top", "32 Bronze Plated Bricks required" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return aActive ? FACING_ACTIVE : FACING_FRONT;
- }
- return FACING_SIDE;
- }
-
- public boolean isSteampowered()
- {
- return false;
- }
-
- public boolean isElectric()
- {
- return false;
- }
-
- public boolean isPneumatic()
- {
- return false;
- }
-
- public boolean isEnetInput()
- {
- return false;
- }
-
- public boolean isEnetOutput()
- {
- return false;
- }
-
- public boolean isInputFacing(byte aSide)
- {
- return false;
- }
-
- public boolean isOutputFacing(byte aSide)
- {
- return false;
- }
-
- public boolean isTeleporterCompatible()
- {
- return false;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer)
- {
- return true;
- }
-
- public int getProgresstime()
- {
- return this.mProgresstime;
- }
-
- public int maxProgresstime()
- {
- return this.mMaxProgresstime;
- }
-
- public int increaseProgress(int aProgress)
- {
- this.mProgresstime += aProgress;return this.mMaxProgresstime - this.mProgresstime;
- }
-
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID)
- {
- return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID));
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName);
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- if (this.mOutputItem1 != null)
- {
- NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem1.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem1", tNBT);
- }
- if (this.mOutputItem2 != null)
- {
- NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem2.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem2", tNBT);
- }
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- this.mUpdate = 5;
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
- this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer)
- {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- private boolean checkMachine()
- {
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 3; j++) {
- for (int k = -1; k < 2; k++) {
- if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) {
- if ((i != 0) || (j == -1) || (k != 0))
- {
- if ((getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != GregTech_API.sBlockCasings1) || (getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
- return false;
- }
- }
- else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[] { Blocks.lava, Blocks.flowing_lava, null })) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
- public void onMachineBlockUpdate()
- {
- this.mUpdate = 5;
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer)
- {
- if ((aBaseMetaTileEntity.isClientSide()) &&
- (aBaseMetaTileEntity.isActive())) {
- aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D, 0.0D);
- }
- if (aBaseMetaTileEntity.isServerSide())
- {
- if (this.mUpdate-- == 0) {
- this.mMachine = checkMachine();
- }
- if (this.mMachine) {
- if (this.mMaxProgresstime > 0)
- {
- if (++this.mProgresstime >= this.mMaxProgresstime)
- {
- addOutputProducts();
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- try{GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");}catch(Exception e){}
- }
- }
- else if (aBaseMetaTileEntity.isAllowedToWork()) {
- checkRecipe();
- }
- }
- aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
- if (aBaseMetaTileEntity.isActive())
- {
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)))
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
- }
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)))
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
- }
- }
- else
- {
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava)
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
- }
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava)
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
- }
- }
- }
- }
-
- private void addOutputProducts()
- {
- if (this.mOutputItem1 != null) {
- if (this.mInventory[2] == null) {
- this.mInventory[2] = GT_Utility.copy(new Object[] { this.mOutputItem1 });
- } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
- this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
- }
- }
- if (this.mOutputItem2 != null) {
- if (this.mInventory[3] == null) {
- this.mInventory[3] = GT_Utility.copy(new Object[] { this.mOutputItem2 });
- } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
- this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
- }
- }
- }
-
- private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2)
- {
- if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
- (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
- return true;
- }
- return false;
- }
-
- private boolean checkRecipe()
- {
- if (!this.mMachine) {
- return false;
- }
- if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron")))
- {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 4);
- this.mMaxProgresstime = 7200;
- return true;
- }
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 2);
- this.mMaxProgresstime = 4800;
- return true;
- }
- if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 9);
- getBaseMetaTileEntity().decrStackSize(1, 4);
- this.mMaxProgresstime = 64800;
- return true;
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel"))
- {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 2);
- this.mMaxProgresstime = 3600;
- return true;
- }
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 1);
- this.mMaxProgresstime = 2400;
- return true;
- }
- if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 9);
- getBaseMetaTileEntity().decrStackSize(1, 2);
- this.mMaxProgresstime = 32400;
- return true;
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron"))
- {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 36);
- this.mMaxProgresstime = 64800;
- return true;
- }
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 18);
- this.mMaxProgresstime = 43200;
- return true;
- }
- if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 4);
- this.mMaxProgresstime = 64800;
- return true;
- }
- }
- }
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- return false;
- }
-
- public boolean isGivingInformation()
- {
- return false;
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return aIndex > 1;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (aIndex < 2) {}
- return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
- }
-
- public byte getTileEntityBaseType()
- {
- return 0;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
deleted file mode 100644
index 632cdcbd6f..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
+++ /dev/null
@@ -1,192 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-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.GT_MetaTileEntity_Hatch_Output;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-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 java.util.ArrayList;
-
-import scala.actors.threadpool.Arrays;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_MetaTileEntity_DistillationTower
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_DistillationTower(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_DistillationTower(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_DistillationTower(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Distillation Tower", "Size: 3x6x3 (Hollow)", "Controller (front bottom)", "1x Input Hatch (bottom)", "5x Output Hatch (one each height level besides botton)","1x Output Bus (Botton)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Clean Stainless Steel Casings for the rest (26 at least!)" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sDistillationRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
- if(this.mInputHatches.size()>0&&this.mInputHatches.get(0)!=null&&this.mInputHatches.get(0).mFluid!=null&&this.mInputHatches.get(0).mFluid.amount>0){
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[] {});
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[] {}))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
- this.mOutputFluids = tRecipe.mFluidOutputs;
- updateSlots();
- return true;
- }
- }}
-
- return false;
- }
- private static boolean controller;
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- int tAmount = 0;
- controller=false;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = 0; h < 6; h++) {
- if (!(i==0&&j==0&&(h>0&&h<5)))//((h > 0)&&(h<5)) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) && (!addOutputToMachineList(tTileEntity, 49)) && (!addEnergyInputToMachineList(tTileEntity, 49))&&(!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- if(this.mInputHatches.size()!=1||this.mOutputBusses.size()!=1||this.mInputBusses.size()!=0||this.mOutputHatches.size()!=5){return false;}
- int height = this.getBaseMetaTileEntity().getYCoord();
- if(this.mInputHatches.get(0).getBaseMetaTileEntity().getYCoord()!=height||this.mOutputBusses.get(0).getBaseMetaTileEntity().getYCoord()!=height){return false;}
- GT_MetaTileEntity_Hatch_Output[] tmpHatches = new GT_MetaTileEntity_Hatch_Output[5];
- for(int i=0;i< this.mOutputHatches.size();i++){
- int hatchNumber = this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()-1-height;
- if(tmpHatches[hatchNumber]==null){
- tmpHatches[hatchNumber]=this.mOutputHatches.get(i);
- }else{return false;}
- }
- this.mOutputHatches.clear();
- for(int i=0;i< tmpHatches.length;i++){
- this.mOutputHatches.add(tmpHatches[i]);
- }
- return tAmount >= 26;
- }
-
- public boolean ignoreController(Block tTileEntity){
- if(!controller&&tTileEntity == GregTech_API.sBlockMachines){return true;}
- return false;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-} \ No newline at end of file
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
deleted file mode 100644
index 8e77293c43..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
+++ /dev/null
@@ -1,243 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-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.GT_MetaTileEntity_MultiBlockBase;
-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 java.util.ArrayList;
-import java.util.Arrays;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_MetaTileEntity_ElectricBlastFurnace
- extends GT_MetaTileEntity_MultiBlockBase
-{
- private int mHeatingCapacity = 0;
-
- public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_ElectricBlastFurnace(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ElectricBlastFurnace(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Blast Furnace", "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)", "16x Heating Coils (two middle Layers, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
- if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
- {
- tInputList.remove(j--);
- }
- else
- {
- tInputList.remove(i--); break;
- }
- }
- }
- }
- ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack)tFluidList.get(i), (FluidStack)tFluidList.get(j))) {
- if (((FluidStack)tFluidList.get(i)).amount >= ((FluidStack)tFluidList.get(j)).amount)
- {
- tFluidList.remove(j--);
- }
- else
- {
- tFluidList.remove(i--); break;
- }
- }
- }
- }
- FluidStack[] tFluids = (FluidStack[])Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
- if (tInputList.size() > 0)
- {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs)))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
- updateSlots();
- return true;
- }
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- this.mHeatingCapacity = 0;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
- return false;
- }
- addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11);
-
- byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
- switch (tUsedMeta)
- {
- case 12:
- this.mHeatingCapacity = 1800; break;
- case 13:
- this.mHeatingCapacity = 2700; break;
- case 14:
- this.mHeatingCapacity = 3600; break;
- default:
- return false;
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
- return false;
- }
- }
- }
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
- return false;
- }
- }
- }
- }
- }
- this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
- return true;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 10;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 2;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
deleted file mode 100644
index 8a5a1d6b84..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
+++ /dev/null
@@ -1,445 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_Container_MultiMachine;
-import gregtech.api.gui.GT_GUIContainer_MultiMachine;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-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_Maintenance;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.metatileentity.implementations.*;
-import gregtech.common.gui.GT_GUIContainer_FusionReactor;
-import net.minecraft.block.Block;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldType;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-
-public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_MultiBlockBase {
-
- public GT_Recipe mLastRecipe;
- public int mEUStore;
-
- public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_FusionComputer(String aName) {
- super(aName);
- }
-
- public abstract int tier();
-
- public abstract long maxEUStore();
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName);
- }
-
- public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity);
-
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
-
- return aSide != getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xCenter = getBaseMetaTileEntity().getXCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX * 5;
- int yCenter = getBaseMetaTileEntity().getYCoord();
- int zCenter = getBaseMetaTileEntity().getZCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ * 5;
- if (((isAdvancedMachineCasing(xCenter + 5, yCenter, zCenter)) || (xCenter + 5 == getBaseMetaTileEntity().getXCoord()))
- && ((isAdvancedMachineCasing(xCenter - 5, yCenter, zCenter)) || (xCenter - 5 == getBaseMetaTileEntity().getXCoord()))
- && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter + 5)) || (zCenter + 5 == getBaseMetaTileEntity().getZCoord()))
- && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter - 5)) || (zCenter - 5 == getBaseMetaTileEntity().getZCoord())) && (checkCoils(xCenter, yCenter, zCenter))
- && (checkHulls(xCenter, yCenter, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter + 1, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter - 1, zCenter))
- && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 3, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 5, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 3, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 5, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter + 4, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter + 4, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter - 4, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter - 4, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 5, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 5, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 7, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 7, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 5, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 5, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 7, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 7, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter + 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter + 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity))
- && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) {
- if (this.mEnergyHatches != null) {
- for (int i = 0; i < this.mEnergyHatches.size(); i++) {
- if (this.mEnergyHatches.get(i).mTier < tier())
- return false;
- }
- }
- if (this.mOutputHatches != null) {
- for (int i = 0; i < this.mOutputHatches.size(); i++) {
- if (this.mOutputHatches.get(i).mTier < tier())
- return false;
- }
- }
- if (this.mInputHatches != null) {
- for (int i = 0; i < this.mInputHatches.size(); i++) {
- if (this.mInputHatches.get(i).mTier < tier())
- return false;
- }
- }
- mWrench = true;
- mScrewdriver = true;
- mSoftHammer = true;
- mHardHammer = true;
- mSolderingTool = true;
- mCrowbar = true;
- return true;
- }
- return false;
- }
-
- private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) {
- if (list != null) {
- for (int i = 0; i < list.size(); i++) {
- if (list.get(i).mTier < tier) {
- return false;
- }
- }
- }
- return true;
- }
-
- private boolean checkCoils(int aX, int aY, int aZ) {
- return (isFusionCoil(aX + 6, aY, aZ - 1)) && (isFusionCoil(aX + 6, aY, aZ)) && (isFusionCoil(aX + 6, aY, aZ + 1)) && (isFusionCoil(aX + 5, aY, aZ - 3)) && (isFusionCoil(aX + 5, aY, aZ - 2))
- && (isFusionCoil(aX + 5, aY, aZ + 2)) && (isFusionCoil(aX + 5, aY, aZ + 3)) && (isFusionCoil(aX + 4, aY, aZ - 4)) && (isFusionCoil(aX + 4, aY, aZ + 4))
- && (isFusionCoil(aX + 3, aY, aZ - 5)) && (isFusionCoil(aX + 3, aY, aZ + 5)) && (isFusionCoil(aX + 2, aY, aZ - 5)) && (isFusionCoil(aX + 2, aY, aZ + 5))
- && (isFusionCoil(aX + 1, aY, aZ - 6)) && (isFusionCoil(aX + 1, aY, aZ + 6)) && (isFusionCoil(aX, aY, aZ - 6)) && (isFusionCoil(aX, aY, aZ + 6)) && (isFusionCoil(aX - 1, aY, aZ - 6))
- && (isFusionCoil(aX - 1, aY, aZ + 6)) && (isFusionCoil(aX - 2, aY, aZ - 5)) && (isFusionCoil(aX - 2, aY, aZ + 5)) && (isFusionCoil(aX - 3, aY, aZ - 5))
- && (isFusionCoil(aX - 3, aY, aZ + 5)) && (isFusionCoil(aX - 4, aY, aZ - 4)) && (isFusionCoil(aX - 4, aY, aZ + 4)) && (isFusionCoil(aX - 5, aY, aZ - 3))
- && (isFusionCoil(aX - 5, aY, aZ - 2)) && (isFusionCoil(aX - 5, aY, aZ + 2)) && (isFusionCoil(aX - 5, aY, aZ + 3)) && (isFusionCoil(aX - 6, aY, aZ - 1))
- && (isFusionCoil(aX - 6, aY, aZ)) && (isFusionCoil(aX - 6, aY, aZ + 1));
- }
-
- private boolean checkUpperOrLowerHulls(int aX, int aY, int aZ) {
- return (isAdvancedMachineCasing(aX + 6, aY, aZ)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 2))
- && (isAdvancedMachineCasing(aX + 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX + 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 4, aY, aZ - 4))
- && (isAdvancedMachineCasing(aX + 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 5))
- && (isAdvancedMachineCasing(aX + 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 5)) && (isAdvancedMachineCasing(aX, aY, aZ - 6))
- && (isAdvancedMachineCasing(aX, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 2, aY, aZ + 5))
- && (isAdvancedMachineCasing(aX - 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 5)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 4))
- && (isAdvancedMachineCasing(aX - 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 2))
- && (isAdvancedMachineCasing(aX - 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ));
- }
-
- private boolean checkHulls(int aX, int aY, int aZ) {
- return (isAdvancedMachineCasing(aX + 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 6, aY, aZ + 2))
- && (isAdvancedMachineCasing(aX + 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 6))
- && (isAdvancedMachineCasing(aX + 2, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 6))
- && (isAdvancedMachineCasing(aX - 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 6))
- && (isAdvancedMachineCasing(aX - 7, aY, aZ)) && (isAdvancedMachineCasing(aX + 7, aY, aZ)) && (isAdvancedMachineCasing(aX, aY, aZ - 7)) && (isAdvancedMachineCasing(aX, aY, aZ + 7))
- && (isAdvancedMachineCasing(aX - 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 6, aY, aZ + 2))
- && (isAdvancedMachineCasing(aX - 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 4, aY, aZ + 2))
- && (isAdvancedMachineCasing(aX + 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 4, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 4))
- && (isAdvancedMachineCasing(aX - 2, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ - 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 4));
- }
-
- private boolean addIfEnergyInjector(int aX, int aY, int aZ, IGregTechTileEntity aBaseMetaTileEntity) {
- if (addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
- return true;
- }
- return isAdvancedMachineCasing(aX, aY, aZ);
- }
-
- private boolean addIfInjector(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) {
- if (addInputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
- return true;
- }
- return isAdvancedMachineCasing(aX, aY, aZ);
- }
-
- private boolean addIfExtractor(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) {
- if (addOutputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
- return true;
- }
- return isAdvancedMachineCasing(aX, aY, aZ);
- }
-
- private boolean isAdvancedMachineCasing(int aX, int aY, int aZ) {
- return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasing()) && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta());
- }
-
- public abstract Block getCasing();
-
- public abstract int getCasingMeta();
-
- private boolean isFusionCoil(int aX, int aY, int aZ) {
- return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getFusionCoil() && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getFusionCoilMeta()));
- }
-
- public abstract Block getFusionCoil();
-
- public abstract int getFusionCoilMeta();
-
- public abstract String[] getDescription();
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- ITexture[] sTexture;
- if (aSide == aFacing) {
- sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)), new GT_RenderedTexture(getIconOverlay()) };
- } else {
- if (!aActive) {
- sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) };
- } else {
- sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) };
- }
- }
- return sTexture;
- }
-
- public abstract IIconContainer getIconOverlay();
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- public int overclock(int mStartEnergy) {
- if (tierOverclock() == 1) {
- return 1;
- }
- if (tierOverclock() == 2) {
- return mStartEnergy < 160000000 ? 2 : 1;
- }
- return mStartEnergy < 160000000 ? 4 : mStartEnergy > 320000000 ? 2 : 1;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
- if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
- tFluidList.remove(j--);
- } else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
- if (tFluidList.size() > 1) {
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[] {});
- if (tRecipe == null&&!mRunningOnLoad) {
- turnCasingActive(false);
- this.mLastRecipe = null;
- return false;
- }
- if (mRunningOnLoad||tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
- this.mLastRecipe = tRecipe;
- this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue));
- this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue);
- this.mEfficiencyIncrease = 10000;
- this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
- turnCasingActive(true);
- mRunningOnLoad=false;
- return true;
- }
- }
- return false;
- }
-
- public abstract int tierOverclock();
-
- public boolean turnCasingActive(boolean status) {
- if (this.mEnergyHatches != null) {
- for (GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) {
- hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
- }
- }
- if (this.mOutputHatches != null) {
- for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
- hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
- }
- }
- if (this.mInputHatches != null) {
- for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) {
- hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
- }
- }
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (mEfficiency < 0)
- mEfficiency = 0;
- if(mRunningOnLoad&&checkMachine(aBaseMetaTileEntity, mInventory[1])){
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- checkRecipe(mInventory[1]);}
- if (--mUpdate == 0 || --mStartUpCheck == 0) {
- mInputHatches.clear();
- mInputBusses.clear();
- mOutputHatches.clear();
- mOutputBusses.clear();
- mDynamoHatches.clear();
- mEnergyHatches.clear();
- mMufflerHatches.clear();
- mMaintenanceHatches.clear();
- mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]);
- }
- if (mStartUpCheck < 0) {
- if (mMachine) {
- if (this.mEnergyHatches != null) {
- for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch)) {
- if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()
- && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048 * tierOverclock(), false)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true);
- }
- }
- }
- if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
- stopMachine();
- }
- if (getRepairStatus() > 0) {
- if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {
- this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
- if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
- if (mOutputItems != null)for (ItemStack tStack : mOutputItems )if (tStack != null)addOutput(tStack);
- if (mOutputFluids != null)for (FluidStack tStack : mOutputFluids)if (tStack != null)addOutput(tStack);
- mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
- mOutputItems = null;
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mEfficiencyIncrease = 0;
- if (mOutputFluids != null && mOutputFluids.length > 0) {
- GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]);
- }
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (aBaseMetaTileEntity.isAllowedToWork())
- checkRecipe(mInventory[1]);
- }
- } else {
- if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
- turnCasingActive(mMaxProgresstime > 0);
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (checkRecipe(mInventory[1]) && aBaseMetaTileEntity.getStoredEU() >= this.mLastRecipe.mSpecialValue) {
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
- }
- }
- if (mMaxProgresstime <= 0)
- mEfficiency = Math.max(0, mEfficiency - 1000);
- }
- }
- } else {
- this.mLastRecipe = null;
- stopMachine();
- }
- } else {
- turnCasingActive(false);
- this.mLastRecipe = null;
- stopMachine();
- }
- }
- aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8)
- | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
- aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
- }
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- if (mEUt < 0) {
- if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
- this.mLastRecipe = null;
- stopMachine();
- return false;
- }
- }
- if (this.mEUStore <= 0) {
- this.mLastRecipe = null;
- stopMachine();
- return false;
- }
- return true;
- }
-
- public boolean drainEnergyInput(long aEU) {
- return false;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-} \ No newline at end of file
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
deleted file mode 100644
index 3c23afcbb5..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer{
-
- public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- }
-
- public GT_MetaTileEntity_FusionComputer1(String aName) {super(aName);}
-
- @Override
- public int tier() {return 6;}
-
- @Override
- public long maxEUStore() {return 160000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;}
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_FusionComputer1(mName);
- }
- @Override
- public int getCasingMeta() {return 6;}
-
- @Override
- public Block getFusionCoil() {return GregTech_API.sBlockCasings1;}
-
- @Override
- public int getFusionCoilMeta() {return 15;}
-
- public String[] getDescription()
- {return new String[] { "It's over 9000!!!","LuV Casings around Superconducting Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be LuV or better","2048EU/t and 10mio EU Cap per Energy Hatch" };}
-
- @Override
- public int tierOverclock() {return 1;}
-
- @Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings1;
- }
-
- @Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION1;
- }
-
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
deleted file mode 100644
index d101875ba2..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer{
-
- public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- }
-
- public GT_MetaTileEntity_FusionComputer2(String aName) {super(aName);}
-
- @Override
- public int tier() {return 7;}
-
- @Override
- public long maxEUStore() {return 320000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;}
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_FusionComputer2(mName);
- }
- @Override
- public int getCasingMeta() {return 6;}
-
- @Override
- public Block getFusionCoil() {return GregTech_API.sBlockCasings4;}
-
- @Override
- public int getFusionCoilMeta() {return 7;}
-
- public String[] getDescription()
- {return new String[] { "It's over 9000!!!","Fusion Casings around Fusion Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be ZPMV or better","4096EU/t and 20mio EU Cap per Energy Hatch" };}
-
- @Override
- public int tierOverclock() {return 2;}
-
- @Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings4;
- }
-
- @Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION2;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
deleted file mode 100644
index b7334bd449..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer{
-
- public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- }
-
- public GT_MetaTileEntity_FusionComputer3(String aName) {super(aName);}
-
- @Override
- public int tier() {return 8;}
-
- @Override
- public long maxEUStore() {return 640000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;}
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_FusionComputer3(mName);
- }
- @Override
- public int getCasingMeta() {return 8;}
-
- @Override
- public Block getFusionCoil() {return GregTech_API.sBlockCasings4;}
-
- @Override
- public int getFusionCoilMeta() {return 7;}
-
- public String[] getDescription()
- {return new String[] { "A SUN DOWN ON EARTH","Fusion Casings MK II around Fusion Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be UV or better","8192EU/t and 40mio EU Cap per Energy Hatch" };}
-
- @Override
- public int tierOverclock() {return 4;}
-
- @Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings4;
- }
-
- @Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION3;
- }
-
-}
-
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
deleted file mode 100644
index 3a6a51fa46..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
+++ /dev/null
@@ -1,303 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-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.GT_MetaTileEntity_Hatch;
-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_Output;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-
-public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase{
- public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_HeatExchanger(String aName)
- {
- super(aName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Heat Exchanger", "Size: 3x3x4", "Controller (front middle at bottom)", "3x3x4 of Stable Titanium Casing (hollow, Min 24!)", "2 Titanium Pipe Casing Blocks inside the Hollow Casing", "1x Distillated Water Input (one of the Casings)","min 1 Steam Output (one of the Casings)", "1x Maintenance Hatch (one of the Casings)", "1x Hot Fluid Input (botton Center)", "1x Cold Fluid Output (top Center)" };
- }
-
- @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 GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch;
- public GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch;
- public boolean superheated=false;
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[50] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png");
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack) {
- if (mInputHotFluidHatch.getFluid() == null)
- return true;
-
- int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch
-
- int 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
- float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25)
- int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25)
- float steam_output_multiplier = 4f; // default: multiply output by 4
- 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())) {
- superheated_threshold /= 4;
- do_lava = true;
- } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) {
- steam_output_multiplier = 0.5f;
- } else {
- // If we're working with neither, fail out
- 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);
- this.mEfficiencyIncrease = 80;
- } else {
- mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true);
- this.mEfficiencyIncrease = 80;
- }
- return true;
- }
-
- private float water;
- private int useWater(float input) {
- water = water + input;
- int usage = (int) water;
- water = water - (int) usage;
- return usage;
- }
-
- 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 {
- explodeMultiblock(); // Generate crater
- }
- }
- return true;
- }
- return true;
- }
- private static boolean controller;
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- int tCasingAmount = 0;int tFireboxAmount = 0;controller=false;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- for (int k = 0; k <= 3; k++) {
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
- }
- }
- }else{
- if(!addHotFluidInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j), 50)){
- return false;
- }
- if(!addColdFluidOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 50)){
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != getPipeMeta()) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != getPipeMeta()) {
- return false;
- }
- }
- }
- }
- return (tCasingAmount >= 24);
- }
-
- public boolean ignoreController(Block tTileEntity){
- if(!controller&&tTileEntity == GregTech_API.sBlockMachines){return true;}
- return false;
- }
-
- 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).mMachineBlock = (byte)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).mMachineBlock = (byte)aBaseCasingIndex;
- ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = getRecipeMap();
- mInputHotFluidHatch = (GT_MetaTileEntity_Hatch_Input)aMetaTileEntity;
- return true;
- }
- return false;
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta()
- {
- return 2;
- }
-
- public byte getCasingTextureIndex()
- {
- return 50;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 14;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_HeatExchanger(this.mName);
- }
- }
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
deleted file mode 100644
index fdc206b3f9..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-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.GT_MetaTileEntity_MultiBlockBase;
-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 java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Map;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class GT_MetaTileEntity_ImplosionCompressor
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_ImplosionCompressor(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ImplosionCompressor(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Implosion Compressor", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "1x Muffler Hatch (anywhere)", "Solid Steel Casings for the rest (16 at least!)" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sImplosionRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
- if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
- {
- tInputList.remove(j--);
- }
- else
- {
- tInputList.remove(i--); break;
- }
- }
- }
- }
- ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
- if (tInputList.size() > 0)
- {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs);
- if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs)))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- this.mEUt = (-tRecipe.mEUt);
- this.mMaxProgresstime = Math.max(1, tRecipe.mDuration);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
- sendLoopStart((byte)20);
- updateSlots();
- return true;
- }
- }
- return false;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 20) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addMufflerToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16)))
- {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (((tBlock != GregTech_API.sBlockCasings2) || (tMeta != 0)) && ((tBlock != GregTech_API.sBlockCasings3) || (tMeta != 4))) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- return tAmount >= 16;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 1000;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 2;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
deleted file mode 100644
index 3a30fc43bc..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
+++ /dev/null
@@ -1,259 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.GT_Mod;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.gui.GT_GUIContainer_MultiMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map_Fuel;
-import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-
-public abstract class GT_MetaTileEntity_LargeBoiler
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler(String aName)
- {
- super(aName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Large Boiler", "Size: 3x3x5", "Controller (front middle in Fireboxes)", "3x3 of Fire Boxes (bottom Layer, Min 3!)", "3x3x4 of Casing (above Fireboxes, hollow, Min 24!)", "3 Pipe Casing Blocks inside the Hollow Casing", "1x Input (one of Fireboxes)", "1x Maintenance Hatch (one of Fireboxes)", "1x Muffler Hatch (one of Fireboxes)", "1x Fluid Output (one of Main Casing)" };
- }
-
- public abstract Block getCasingBlock();
-
- public abstract byte getCasingMeta();
-
- public abstract byte getCasingTextureIndex();
-
- public abstract Block getPipeBlock();
-
- public abstract byte getPipeMeta();
-
- public abstract Block getFireboxBlock();
-
- public abstract byte getFireboxMeta();
-
- public abstract byte getFireboxTextureIndex();
-
- public abstract int getEUt();
-
- public abstract int getEfficiencyIncrease();
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png");
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList)
- {
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
- if ((tFluid != null) && (tRecipe.mSpecialValue > 1))
- {
- tFluid.amount = 1000;
- if (depleteInput(tFluid))
- {
- this.mMaxProgresstime = (tRecipe.mSpecialValue / 2);
- this.mEUt = getEUt();
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
- return true;
- }
- }
- }
- for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList)
- {
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
- if (tFluid != null)
- {
- tFluid.amount = 1000;
- if (depleteInput(tFluid))
- {
- this.mMaxProgresstime = Math.max(1, tRecipe.mSpecialValue * 2);
- this.mEUt = getEUt();
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
- return true;
- }
- }
- }
- ArrayList<ItemStack> tInputList = getStoredInputs();
- if (!tInputList.isEmpty()) {
- for (ItemStack tInput : tInputList) {
- if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0))
- {
- this.mEUt = getEUt();
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
- this.mOutputItems = new ItemStack[] { GT_Utility.getContainerItem(tInput, true) };
- tInput.stackSize -= 1;
- updateSlots();
- return true;
- }
- }
- }
- this.mMaxProgresstime = 0;
- this.mEUt = 0;
- return false;
- }
-
- public boolean onRunningTick(ItemStack aStack)
- {
- if (this.mEUt > 0)
- {
- int tGeneratedEU = (int)(this.mEUt * 2L * this.mEfficiency / 10000L);
- if (tGeneratedEU > 0) {
- long amount = (tGeneratedEU + 160) / 160;
- if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
- addOutput(GT_ModHandler.getSteam(tGeneratedEU));
- } else {
- explodeMultiblock();
- }
- }
- return true;
- }
- return true;
- }
-
-private boolean firstRun = true;
-
-@Override
-public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (mProgresstime>0&&firstRun) {firstRun = false;try{
- GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure");}catch (Exception e){}
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
-}
-
-
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- int tCasingAmount = 0;int tFireboxAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- for (int k = 1; k <= 4; k++) {
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), getCasingTextureIndex()))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
- }
- }
- }
- else
- {
- for (int k = 1; k <= 3; k++)
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getPipeMeta()) {
- return false;
- }
- }
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j), getCasingTextureIndex()))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
- }
- }
- }
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addInputToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addMufflerToMachineList(tTileEntity, getFireboxTextureIndex())))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != getFireboxBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != getFireboxMeta()) {
- return false;
- }
- tFireboxAmount++;
- }
- }
- }
- }
- return (tCasingAmount >= 24) && (tFireboxAmount >= 3);
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 10;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
deleted file mode 100644
index 2df675ef41..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_LargeBoiler_Bronze
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_Bronze(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings1;
- }
-
- public byte getCasingMeta()
- {
- return 10;
- }
-
- public byte getCasingTextureIndex()
- {
- return 10;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 12;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings3;
- }
-
- public byte getFireboxMeta()
- {
- return 13;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 45;
- }
-
- public int getEUt()
- {
- return 400;
- }
-
- public int getEfficiencyIncrease()
- {
- return 16;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
deleted file mode 100644
index 29f0901eae..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_LargeBoiler_Steel
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_Steel(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getCasingMeta()
- {
- return 0;
- }
-
- public byte getCasingTextureIndex()
- {
- return 16;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 13;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings3;
- }
-
- public byte getFireboxMeta()
- {
- return 14;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 46;
- }
-
- public int getEUt()
- {
- return 600;
- }
-
- public int getEfficiencyIncrease()
- {
- return 12;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
deleted file mode 100644
index 7d11836a19..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_LargeBoiler_Titanium
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_Titanium(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta()
- {
- return 2;
- }
-
- public byte getCasingTextureIndex()
- {
- return 50;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 14;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getFireboxMeta()
- {
- return 3;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 51;
- }
-
- public int getEUt()
- {
- return 800;
- }
-
- public int getEfficiencyIncrease()
- {
- return 8;
- }
-} \ No newline at end of file
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
deleted file mode 100644
index c3c3cbecfe..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_LargeBoiler_TungstenSteel
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_TungstenSteel(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta()
- {
- return 0;
- }
-
- public byte getCasingTextureIndex()
- {
- return 48;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 15;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings3;
- }
-
- public byte getFireboxMeta()
- {
- return 15;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 47;
- }
-
- public int getEUt()
- {
- return 1000;
- }
-
- public int getEfficiencyIncrease()
- {
- return 4;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java
deleted file mode 100644
index d8b765c82a..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java
+++ /dev/null
@@ -1,192 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ItemList;
-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.items.GT_MetaGenerated_Tool;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.items.GT_MetaGenerated_Tool_01;
-
-public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_MultiBlockBase{
-
- public GT_MetaTileEntity_LargeTurbine(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine(String aName){super(aName);}
-
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return getMaxEfficiency(aStack) > 0;
- }
-
- protected int baseEff=0;
- protected int optFlow=0;
- protected int counter=0;
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- byte tSide = getBaseMetaTileEntity().getBackFacing();
- if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2)))
- {
- int tAirCount = 0;
- for (byte i = -1; i < 2; i = (byte)(i + 1)) {
- for (byte j = -1; j < 2; j = (byte)(j + 1)) {
- for (byte k = -1; k < 2; k = (byte)(k + 1)) {
- if (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
- tAirCount++;
- }
- }
- }
- }
- if (tAirCount != 10) {
- return false;
- }
- for (byte i = 2; i < 6; i = (byte)(i + 1))
- {
- IGregTechTileEntity tTileEntity;
- if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
- (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
- ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine))) {
- return false;
- }
- }
- int tX = getBaseMetaTileEntity().getXCoord();int tY = getBaseMetaTileEntity().getYCoord();int tZ = getBaseMetaTileEntity().getZCoord();
- for (byte i = -1; i < 2; i = (byte)(i + 1)) {
- for (byte j = -1; j < 2; j = (byte)(j + 1)) {
- if ((i != 0) || (j != 0)) {
- for (byte k = 0; k < 4; k = (byte)(k + 1)) {
- if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2)))
- {
- if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta())
- {}else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))) {
- return false;
- }
- }
- else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock()&& getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta())
- {}else {return false;
- }
- }
- }
- }
- }
- this.mDynamoHatches.clear();
- IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3);
- if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
- if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) {
- this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)tTileEntity.getMetaTileEntity());
- ((GT_MetaTileEntity_Hatch)tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
- } else {
- return false;
- }
- }
- }
- else
- {
- return false;
- }
- return true;
- }
-
- public abstract Block getCasingBlock();
-
- public abstract byte getCasingMeta();
-
- public abstract byte getCasingTextureIndex();
-
- private boolean addToMachineList(IGregTechTileEntity tTileEntity){
- return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex()))|| (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
- }
-
-
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tFluids = getStoredFluids();
- if (tFluids.size() > 0) {
- if (baseEff == 0 || optFlow == 0 || counter >= 1000 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
- || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
- counter = 0;
- baseEff = (int) ((50.0F
- + (10.0F * ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))) * 100);
- optFlow = (int) Math.max(Float.MIN_NORMAL,
- ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier()
- * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed
- * 50);
- } else {
- counter++;
- }
- }
-
- int newPower = fluidIntoPower(tFluids, optFlow, baseEff); // How much the turbine should be producing with this flow
- int difference = newPower - this.mEUt; // difference between current output and new output
-
- // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick)
- // This is how much the turbine can actually change during this tick
- int maxChangeAllowed = Math.max(10, (int) Math.ceil(Math.abs(difference) * 0.01));
-
- if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change
- int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative.
- this.mEUt += change; // Apply the change
- }
- else
- this.mEUt = newPower;
-
- if (mEUt <= 0) {
-
-// this.mEfficiencyIncrease = (-10);
- this.mEfficiency = 0;
- //stopMachine();
- return false;
- } else {
- this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = (10);
- return true;
- }
- }
-
- abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff);
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 1;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- if (GT_Utility.isStackInvalid(aStack)) {
- return 0;
- }
- if (aStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
- return 10000;
- }
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {return 0;}
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {return true;}
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
deleted file mode 100644
index 2f750ab914..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.api.GregTech_API;
-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.items.GT_MetaGenerated_Tool;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-
-public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_Gas(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_Gas(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large Gas Turbine",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "1x Muffler Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)"};
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0;
- FluidStack tLiquid;
- Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList;
- if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue;
- return 0;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Gas(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 10;
- }
-
- @Override
- int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
- int tEU = 0;
-
- int actualOptimalFlow = 0;
-
- if (aFluids.size() >= 1) {
- 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 = (int) (aOptFlow / fuelValue);
-
- int remainingFlow = (int) (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;
-
- for (int i = 0; i < aFluids.size(); i++) {
- if (aFluids.get(i).isFluidEqual(firstFuelType)) {
- flow = aFluids.get(i).amount; // Get all (steam) in hatch
- flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
- depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount
- remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
- totalFlow += flow; // track total input used
- }
- }
-
- tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue);
-
- if (totalFlow != actualOptimalFlow) {
- float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow));
- if (efficiency < 0)
- efficiency = 0; // Can happen with really ludicrously poor inefficiency.
- tEU *= efficiency;
- tEU = Math.max(1, tEU * aBaseEff / 10000);
- } else {
- tEU = tEU * aBaseEff / 10000;
- }
-
- return tEU;
-
- }
- return 0;
- }
-
-
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
deleted file mode 100644
index d57aa52db8..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-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.items.GT_MetaGenerated_Tool;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-
-public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_HPSteam(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_HPSteam(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large High Pressure Steam Turbine",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)", "1x Output Hatch(side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)" };
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_HPSteam(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
- public boolean achievement=false;
-
- @Override
- int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
- int tEU = 0;
- int totalFlow = 0; // Byproducts are based on actual flow
- int flow = 0;
- int remainingFlow = (int) (aOptFlow * 1.25f); // Allowed to use up to 125% of optimal flow
-
- for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) {
- if (aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)).equals("ic2.fluidSuperheatedSteam")) {
- flow = aFluids.get(i).amount; // Get all (steam) in hatch
- flow = Math.min(flow, Math.min(remainingFlow, (int) (aOptFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
- depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount
- remainingFlow -= flow; // track amount we're allowed to keep depleting from hatches
- totalFlow += flow; // track total used
- if(!achievement){
- try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam");}catch(Exception e){}
- achievement=true;
- }
- }
- }
-
- tEU = (int) (Math.min((float) aOptFlow, totalFlow));
- addOutput(GT_ModHandler.getSteam(totalFlow));
- if (totalFlow > 0 && totalFlow != aOptFlow) {
- float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow));
- tEU *= efficiency;
- tEU = Math.max(1, tEU * aBaseEff / 10000);
- } else {
- tEU = tEU * aBaseEff / 10000;
- }
-
- return tEU;
- }
-
-
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
deleted file mode 100644
index 5b7ea5c362..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-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.items.GT_MetaGenerated_Tool;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-
-public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_Plasma(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_Plasma(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large Plasma Generator",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)" };
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0;
- FluidStack tLiquid;
- Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sPlasmaFuels.mRecipeList;
- if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue;
- return 0;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Plasma(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- @Override
- int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
- aOptFlow *= 20;
- int tEU = 0;
-
- int actualOptimalFlow = 0;
-
- if (aFluids.size() >= 1) {
- 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 = (int) ((aOptFlow + fuelValue -1 )/ fuelValue);
- int remainingFlow = (int) (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;
-
- for (int i = 0; i < aFluids.size(); i++) {
- if (aFluids.get(i).isFluidEqual(firstFuelType)) {
- flow = aFluids.get(i).amount; // Get all (steam) in hatch
- flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
- depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount
- remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
- totalFlow += flow; // track total input used
- }
- }
-
- tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue);
-
- if (totalFlow != actualOptimalFlow) {
- float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow));
- if (efficiency < 0)
- efficiency = 0; // Can happen with really ludicrously poor inefficiency.
- tEU *= efficiency;
- tEU = Math.max(1, tEU * aBaseEff / 10000);
- } else {
- tEU = tEU * aBaseEff / 10000;
- }
- return tEU;
-
- }
- return 0;
- }
-
-
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
deleted file mode 100644
index 7a3f45037a..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-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.items.GT_MetaGenerated_Tool;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-
-public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_Steam(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_Steam(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large Steam Turbine",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)", "1x Output Hatch(side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)" };
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Steam(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- private float water;
- private int useWater(float input){
- water = water + input;
- int usage = (int)water;
- water = water - (int)usage;
- return usage;
- }
-
- private boolean achievement = false;
-
- @Override
- int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
- int tEU = 0;
- int totalFlow = 0; // Byproducts are based on actual flow
- int flow = 0;
- int remainingFlow = (int) (aOptFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
-
- for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and track totals.
- String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i));
- if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) {
- flow = aFluids.get(i).amount; // Get all (steam) in hatch
- flow = Math.min(flow, Math.min(remainingFlow, (int) (aOptFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
- depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount
- remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
- totalFlow += flow; // track total input used
- if(!achievement){
- try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam");}catch(Exception e){}
- achievement=true;
- }
- }
- }
-
- tEU = (int) (Math.min((float) aOptFlow, totalFlow));
- int waterToOutput = useWater(totalFlow / 160.0f);
- addOutput(GT_ModHandler.getDistilledWater(waterToOutput));
- if (totalFlow > 0 && totalFlow != aOptFlow) {
- float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow));
- tEU *= efficiency;
- tEU = Math.max(1, tEU * aBaseEff / 20000);
- } else {
- tEU = tEU * aBaseEff / 20000;
- }
-
- return tEU;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
deleted file mode 100644
index fc2a8a908b..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
+++ /dev/null
@@ -1,189 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-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.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class GT_MetaTileEntity_MultiFurnace
- extends GT_MetaTileEntity_MultiBlockBase
-{
- private int mLevel = 0;
-
- public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_MultiFurnace(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_MultiFurnace(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Smelts up to 6-18 Items at once", "Controller Block for the Multi Smelter", "Size: 3x3x3 (Hollow)", "Controller (front middle at bottom)", "8x Heating Coils (middle Layer, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- if (!tInputList.isEmpty())
- {
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
-
- int j = 0;
- this.mOutputItems = new ItemStack[6 * this.mLevel];
- for (int i = 0; (i < 100) && (j < this.mOutputItems.length); i++) {
- if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack)tInputList.get(i % tInputList.size()), true, null))) {
- j++;
- }
- }
- if (j > 0)
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel);
- this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1));
- }
- updateSlots();
- return true;
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- this.mLevel = 0;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 11);
-
- byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
- switch (tUsedMeta)
- {
- case 12:
- this.mLevel = 1; break;
- case 13:
- this.mLevel = 2; break;
- case 14:
- this.mLevel = 3; break;
- default:
- return false;
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 11) {
- return false;
- }
- }
- }
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 20;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 18;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-}
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
deleted file mode 100644
index a3478adce8..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
+++ /dev/null
@@ -1,298 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.commons.lang3.ArrayUtils;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.api.GregTech_API;
-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.GT_MetaTileEntity_BasicMachine_GT_Recipe;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-
-public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase{
-
- public GT_MetaTileEntity_ProcessingArray(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_ProcessingArray(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ProcessingArray(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Processing Array",
- "Size: 3x3x3 (Hollow)",
- "Controller (front centered)",
- "1x Input (anywhere)",
- "1x Output (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "Robust Tungstensteel Casings for the rest (16 at least!)",
- "Place up to 16 Single Block GT Machines into the GUI Inventory",
- "They will work the same way as placed directly in world"};
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[48], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[48] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- if(mInventory[1]==null)return null;
- String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", "");
- if(tmp.startsWith("centrifuge")){
- return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
- }else if(tmp.startsWith("electrolyzer")){
- return GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes;
- }else if(tmp.startsWith("alloysmelter")){
- return GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes;
- }else if(tmp.startsWith("assembler")){
- return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
- }else if(tmp.startsWith("compressor")){
- return GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
- }else if(tmp.startsWith("extractor")){
- return GT_Recipe.GT_Recipe_Map.sExtractorRecipes;
- }else if(tmp.startsWith("macerator")){
- return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
- }else if(tmp.startsWith("recycler")){
- return GT_Recipe.GT_Recipe_Map.sRecyclerRecipes;
- }else if(tmp.startsWith("thermalcentrifuge")){
- return GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes;
- }else if(tmp.startsWith("orewasher")){
- return GT_Recipe.GT_Recipe_Map.sOreWasherRecipes;
- }else if(tmp.startsWith("chemicalreactor")){
- return GT_Recipe.GT_Recipe_Map.sChemicalRecipes;
- }else if(tmp.startsWith("chemicalbath")){
- return GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes;
- }else if(tmp.startsWith("electromagneticseparator")){
- return GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes;
- }else if(tmp.startsWith("autoclave")){
- return GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes;
- }else if(tmp.startsWith("mixer")){
- return GT_Recipe.GT_Recipe_Map.sMixerRecipes;
- }else if(tmp.startsWith("hammer")){
- return GT_Recipe.GT_Recipe_Map.sHammerRecipes;
- }else if(tmp.startsWith("sifter")){
- return GT_Recipe.GT_Recipe_Map.sSifterRecipes;
- }else if(tmp.startsWith("extruder")){
- return GT_Recipe.GT_Recipe_Map.sExtruderRecipes;
- }else if(tmp.startsWith("laserengraver")){
- return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes;
- }else if(tmp.startsWith("bender")){
- return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
- }else if(tmp.startsWith("wiremill")){
- return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
- }else if(tmp.startsWith("arcfurnace")){
- return GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes;
- }
- return null;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- if(aStack!=null&&aStack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")){
- return true;}
- return false;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- GT_Recipe mLastRecipe;
- public boolean checkRecipe(ItemStack aStack){
- if(!isCorrectMachinePart(mInventory[1])){return false;}
- GT_Recipe.GT_Recipe_Map map = getRecipeMap();
- if(map==null){return false;}
- ArrayList<ItemStack> tInputList = getStoredInputs();
- int tTier = 0;
- if(mInventory[1].getUnlocalizedName().endsWith("1")){tTier=1;}
- if(mInventory[1].getUnlocalizedName().endsWith("2")){tTier=2;}
- if(mInventory[1].getUnlocalizedName().endsWith("3")){tTier=3;}
- if(mInventory[1].getUnlocalizedName().endsWith("4")){tTier=4;}
- if(mInventory[1].getUnlocalizedName().endsWith("5")){tTier=5;}
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
- if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
- {
- tInputList.remove(j--);
- }
- else
- {
- tInputList.remove(i--); break;
- }
- }
- }
- }
- ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack)tFluidList.get(i), (FluidStack)tFluidList.get(j))) {
- if (((FluidStack)tFluidList.get(i)).amount >= ((FluidStack)tFluidList.get(j)).amount)
- {
- tFluidList.remove(j--);
- }
- else
- {
- tFluidList.remove(i--); break;
- }
- }
- }
- }
- FluidStack[] tFluids = (FluidStack[])Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
- if(tInputList.size() > 0 || tFluids.length>0){
- GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if (tRecipe != null) {
- if(tRecipe.mFluidInputs!=null){
-
- }
- mLastRecipe = tRecipe;
- this.mEUt = 0;
- this.mOutputItems = null;
- this.mOutputFluids = null;
- int machines = Math.min(16,mInventory[1].stackSize);
- int i = 0;
- for(;i<machines;i++){
- if(!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)){if(i==0){return false;}
- break;}
- }
- this.mMaxProgresstime = tRecipe.mDuration;
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- this.mEUt*=i;
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
- for(int h = 0;h<tRecipe.mOutputs.length;h++){
- tOut[h] = tRecipe.getOutput(h).copy();
- tOut[h].stackSize =0;
- }FluidStack tFOut=null;
- if(tRecipe.getFluidOutput(0)!=null) tFOut = tRecipe.getFluidOutput(0).copy();
- for(int f =0; f < tOut.length ; f++){
- if(tRecipe.mOutputs[f]!=null&&tOut[f]!=null){
- for(int g =0;g<i;g++){
- if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
- if(tFOut!=null){
- int tSize = tFOut.amount;
- tFOut.amount = tSize * i;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- List<ItemStack> overStacks = new ArrayList<ItemStack>();
- for(int f =0; f < tOut.length ; f++){
- if(tOut[f].getMaxStackSize()<tOut[f].stackSize){
- while(tOut[f].getMaxStackSize()<tOut[f].stackSize){
- ItemStack tmp = tOut[f].copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
- overStacks.add(tmp);
- }
- }
- }
- if(overStacks.size()>0){
- ItemStack[] tmp = new ItemStack[overStacks.size()];
- tmp = overStacks.toArray(tmp);
- tOut = ArrayUtils.addAll(tOut, tmp);
- }
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for(ItemStack tS : tOut){
- if(tS.stackSize>0)tSList.add(tS);
- }
- tOut = tSList.toArray(new ItemStack[tSList.size()]);
- this.mOutputItems = tOut;
- this.mOutputFluids = new FluidStack[]{tFOut};
- updateSlots();
- return true;
- }
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 48)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addEnergyInputToMachineList(tTileEntity, 48)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- return tAmount >= 16;
- }
-
- public int getMaxEfficiency(ItemStack aStack){return 10000;}
- public int getPollutionPerTick(ItemStack aStack){return 0;}
- public int getDamageToComponent(ItemStack aStack){return 0;}
- public int getAmountOfOutputs(){return 1;}
- public boolean explodesOnComponentBreak(ItemStack aStack){return false;}
- } \ No newline at end of file
diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java
deleted file mode 100644
index c0d4af2582..0000000000
--- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-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.GT_MetaTileEntity_MultiBlockBase;
-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 java.util.ArrayList;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class GT_MetaTileEntity_VacuumFreezer
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_VacuumFreezer(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_VacuumFreezer(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Vacuum Freezer", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Frost Proof Casings for the rest (16 at least!)" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[17], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[17] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sVacuumRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (ItemStack tInput : tInputList)
- {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
-
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[] { tInput });
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[] { tInput }))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
- updateSlots();
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- return tAmount >= 16;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-}