aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines/multi
diff options
context:
space:
mode:
authorJohannes Gäßler <updrn@student.kit.edu>2017-06-18 17:26:04 +0200
committerJohannes Gäßler <updrn@student.kit.edu>2017-06-18 17:26:04 +0200
commit668ca431a8039f920414f296e00194a164ce5f4e (patch)
treec808e407ae3f0c950bd201e735ce5bb99c34abe3 /src/main/java/gregtech/common/tileentities/machines/multi
parenta739167c7f28c65b6f66960150791eb9d1181e29 (diff)
parent337b6fc66d25361095ad4eddd86992d92668be03 (diff)
downloadGT5-Unofficial-668ca431a8039f920414f296e00194a164ce5f4e.tar.gz
GT5-Unofficial-668ca431a8039f920414f296e00194a164ce5f4e.tar.bz2
GT5-Unofficial-668ca431a8039f920414f296e00194a164ce5f4e.zip
Merge remote-tracking branch 'origin/unstable' into OilRefining
Conflicts: src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java342
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java16
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java21
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java20
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java8
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java394
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java51
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java51
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java51
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java51
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java425
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java32
21 files changed, 928 insertions, 563 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
deleted file mode 100644
index 08d889b7e4..0000000000
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
+++ /dev/null
@@ -1,342 +0,0 @@
-package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-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_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.blocks.GT_Block_Ores_Abstract;
-import gregtech.common.blocks.GT_TileEntity_Ores;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.ChunkPosition;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-
-import java.util.ArrayList;
-
-public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBase {
-
- private final ArrayList<ChunkPosition> mMineList = new ArrayList();
-
- public GT_MetaTileEntity_AdvMiner2(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_AdvMiner2(String aName) {
- super(aName);
- }
-
- public String[] getDescription() {
- return new String[]{
- "Controller Block for the Advanced Miner II",
- "Size(WxHxD): 3x7x3, Controller (Front middle bottom)",
- "3x1x3 Base of Solid Steel Casings",
- "1x3x1 Solid Steel Casing pillar (Center of base)",
- "1x3x1 Steel Frame Boxes (Each Steel pillar side and on top)",
- "1x Input Hatch (Any bottom layer casing)",
- "1x Output Bus (Any bottom layer casing)",
- "1x Maintenance Hatch (Any bottom layer casing)",
- "1x MV+ Energy Hatch (Any bottom layer casing)"};
- }
-
- 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_ADVMINER2_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ADVMINER2)};
- }
- 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(), "AdvMiner2.png");
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- if (mInventory[1] == null || (mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize < mInventory[1].getMaxStackSize())) {
- ArrayList<ItemStack> tItems = getStoredInputs();
- for (ItemStack tStack : tItems) {
- if (tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- tStack.stackSize--;
- if (tStack.stackSize < 1) {
- tStack = null;
- }
- if (mInventory[1] == null) {
- mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L);
- } else {
- mInventory[1].stackSize++;
- }
- }
-
- }
- }
- if (mInputHatches == null || mInputHatches.get(0).mFluid == null || mInputHatches.get(0).mFluid.getFluid().getID() != ItemList.sDrillingFluid.getID()) {
- return false;
- }
- FluidStack tFluid = mInputHatches.get(0).mFluid.copy();
- if (tFluid == null) {
- return false;
- }
- if (tFluid.amount < 100) {
- return false;
- }
- tFluid.amount = 100;
- depleteInput(tFluid);
- long tVoltage = getMaxInputVoltage();
- if (getBaseMetaTileEntity().getRandomNumber(20) == 0) {
- if (mMineList.isEmpty()) {
- int yLevel = getYOfPumpHead();
- for (int i = -48; i < 49; i++) {
- for (int f = -48; f < 49; f++) {
- Block tBlock = getBaseMetaTileEntity().getBlockOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f);
- int tMetaID = getBaseMetaTileEntity().getMetaIDOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f);
- if (tBlock instanceof GT_Block_Ores_Abstract) {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f);
- if ((tTileEntity!=null) && (tTileEntity instanceof GT_TileEntity_Ores) && ((GT_TileEntity_Ores) tTileEntity).mNatural == true && !mMineList.contains(new ChunkPosition(i, yLevel - getBaseMetaTileEntity().getYCoord(), f))) {
- mMineList.add(new ChunkPosition(i, yLevel - getBaseMetaTileEntity().getYCoord(), f));
- }
- }
- else {
- ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- ChunkPosition cp = new ChunkPosition(i, yLevel - getBaseMetaTileEntity().getYCoord(), f);
- if (!mMineList.contains(cp)) {
- mMineList.add(cp);
- }
- }
- }
- }
- }
- }
- if (mMineList.isEmpty()) {
- if(getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock){
- if (mEnergyHatches.size() > 0 && mEnergyHatches.get(0).getEUVar() > (512 + getMaxInputVoltage() * 4)) {
- if (!moveOneDown())
- return false;
- }
- }else{
- stopMachine();
- return false;
- }
- }
- ArrayList<ItemStack> tDrops = new ArrayList();
- Block tMineBlock = null;
- ChunkPosition mle = null;
- int posX, posY, posZ, offX, offY, offZ;
- while ((tMineBlock==null || tMineBlock == Blocks.air) && !mMineList.isEmpty()) {
- mle = mMineList.get(0);
- mMineList.remove(0);
- tMineBlock = getBaseMetaTileEntity().getBlockOffset(mle.chunkPosX, mle.chunkPosY, mle.chunkPosZ);
- }
-
- if (tMineBlock!=null && tMineBlock!=Blocks.air) {
- posX = mle.chunkPosX + getBaseMetaTileEntity().getXCoord();
- posY = mle.chunkPosY + getBaseMetaTileEntity().getYCoord();
- posZ = mle.chunkPosZ + getBaseMetaTileEntity().getZCoord();
- offX = mle.chunkPosX;
- offY = mle.chunkPosY;
- offZ = mle.chunkPosZ;
-
- int metadata = getBaseMetaTileEntity().getMetaIDOffset(offX, offY, offZ);
- boolean silkTouch = tMineBlock.canSilkHarvest(getBaseMetaTileEntity().getWorld(), null, posX, posY, posZ, metadata);
- if (silkTouch){
- ItemStack IS = new ItemStack(tMineBlock);
- IS.setItemDamage(metadata);
- IS.stackSize=1;
- tDrops.add(IS);
- }
- else{
- tDrops = tMineBlock.getDrops(getBaseMetaTileEntity().getWorld(), posX, posY, posZ, metadata, 1);
- }
-
- getBaseMetaTileEntity().getWorld().setBlockToAir(posX, posY, posZ);
- if (!tDrops.isEmpty()) {
- ItemData tData = GT_OreDictUnificator.getItemData(tDrops.get(0).copy());
- if (tData.mPrefix != OrePrefixes.crushed && tData.mMaterial.mMaterial != Materials.Oilsands) {
-
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, tVoltage, null, tDrops.get(0).copy());
- if (tRecipe != null) {
- this.mOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int g = 0; g < mOutputItems.length; g++) {
- mOutputItems[g] = tRecipe.mOutputs[g].copy();
- if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(g)) {
- mOutputItems[g].stackSize *= getBaseMetaTileEntity().getRandomNumber(4) + 1;
- }
- }
- } else {
- this.mOutputItems = new ItemStack[tDrops.size()];
- for (int g = 0; g < mOutputItems.length; g++) {
- mOutputItems[g] = tDrops.get(g).copy();
- }
- }
- } else {
- this.mOutputItems = null;
- ItemStack[] tStack = new ItemStack[tDrops.size()];
- for (int j = 0; j < tDrops.size(); j++) {
- tStack[j] = tDrops.get(j).copy();
- tStack[j].stackSize = tStack[j].stackSize * (getBaseMetaTileEntity().getRandomNumber(4) + 1);
- }
- mOutputItems = tStack;
- }
- }
-
- }
- }
-
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- int tEU = 48;
- int tDuration = 24;
- if (tEU <= 16) {
- this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tDuration / (1 << tTier - 1));
- } else {
- this.mEUt = tEU;
- this.mMaxProgresstime = tDuration;
- 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);
- return true;
- }
-
- private boolean moveOneDown() {
- if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1)
- || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
- stopMachine();
- return false;
- }
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- int yHead = getYOfPumpHead();
- if (yHead <= 0) {
- stopMachine();
- return false;
- }
- if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir) == Blocks.bedrock) {
- stopMachine();
- return false;
- }
- if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
- stopMachine();
- return false;
- }
- if (yHead != getBaseMetaTileEntity().getYCoord()) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));
- }
- getBaseMetaTileEntity().decrStackSize(1, 1);
- return true;
- }
-
- private int getYOfPumpHead() {
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- int y = getBaseMetaTileEntity().getYCoord() - 1;
- while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- y--;
- }
- if (y == getBaseMetaTileEntity().getYCoord() - 1) {
- if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) {
- return y + 1;
- }
- } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility
- .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)) && this.mInventory[1] != null && this.mInventory[1].stackSize > 0 && GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir,
- GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)));
- getBaseMetaTileEntity().decrStackSize(0, 1);
- }
- return y;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- 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, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) {
- return false;
- }
- }
- }
- }
- }
- for (int y = 1; y < 4; y++) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir - 1, y, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir + 1) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir - 1) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 3, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @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 boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_AdvMiner2(this.mName);
- }
-
-}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java
index 3f619102b4..aee44e4cae 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java
@@ -1,6 +1,7 @@
package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
@@ -68,8 +69,10 @@ public class GT_MetaTileEntity_AssemblyLine
}
public boolean checkRecipe(ItemStack aStack) {
+ if(GT_Values.D1)System.out.println("Start ALine recipe check");
if (!GT_Utility.isStackValid(mInventory[1]) || !ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true))
return false;
+ if(GT_Values.D1)System.out.println("Stick accepted");
NBTTagCompound tTag = mInventory[1].getTagCompound();
if (tTag == null) return false;
@@ -79,24 +82,30 @@ public class GT_MetaTileEntity_AssemblyLine
if (mInputBusses.get(i) == null) return false;
tStack[i] = GT_Utility.loadItem(tTag, "" + i);
if (tStack[i] == null) continue;
+ if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName());
ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
if (!GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) || tStack[i].stackSize > stackInSlot.stackSize) {
+ if(GT_Values.D1)System.out.println(i +" not accepted");
return false;
}
+ if(GT_Values.D1)System.out.println(i+" accepted");
}
-
+ if(GT_Values.D1)System.out.println("All Items done, start fluid check");
FluidStack[] tFluids = new FluidStack[4];
for (int i = 0; i < 4; i++) {
if (!tTag.hasKey("f" + i)) continue;
tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i);
if (tFluids[i] == null) continue;
+ if(GT_Values.D1)System.out.println("Fluid "+i+" "+tFluids[i].getUnlocalizedName());
if (mInputHatches.get(i) == null) return false;
FluidStack fluidInHatch = mInputHatches.get(i).mFluid;
if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) {
+ if(GT_Values.D1)System.out.println(i+" not accepted");
return false;
}
+ if(GT_Values.D1)System.out.println(i+" accepted");
}
-
+ if(GT_Values.D1)System.out.println("Input accepted, check other values");
if (!tTag.hasKey("output")) return false;
mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")};
if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0]))
@@ -108,6 +117,7 @@ public class GT_MetaTileEntity_AssemblyLine
if (!tTag.hasKey("eu")) return false;
mEUt = tTag.getInteger("eu");
+ if(GT_Values.D1)System.out.println("All checked start consuming inputs");
for (int i = 0; i < 15; i++) {
if (tStack[i] == null) continue;
ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
@@ -121,6 +131,7 @@ public class GT_MetaTileEntity_AssemblyLine
mInputHatches.get(i).mFluid = null;
}
}
+ if(GT_Values.D1)System.out.println("Check overclock");
byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
@@ -139,6 +150,7 @@ public class GT_MetaTileEntity_AssemblyLine
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
updateSlots();
+ if(GT_Values.D1)System.out.println("Recipe sucessfull");
return true;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
index ea8eb2f7ba..3b287d9ca4 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
@@ -23,6 +23,7 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.ChunkPosition;
+import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_BronzeBlastFurnace
@@ -187,10 +188,6 @@ public class GT_MetaTileEntity_BronzeBlastFurnace
}
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if ((aBaseMetaTileEntity.isClientSide()) &&
- (aBaseMetaTileEntity.isActive())) {
- aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D);
- }
if (aBaseMetaTileEntity.isServerSide()) {
if (this.mUpdate-- == 0) {
this.mMachine = checkMachine();
@@ -210,7 +207,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace
}
}
if(this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){
- GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 50);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), 50);
}
aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
@@ -233,8 +230,20 @@ public class GT_MetaTileEntity_BronzeBlastFurnace
this.mUpdate = 1;
}
}
+ }else if(aBaseMetaTileEntity.isActive()){
+ World aWorld=aBaseMetaTileEntity.getWorld();
+ double xPos=aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1);
+ double yPos=aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1)+0.05F;
+ double zPos=aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1);
+ XSTR floatGen=new XSTR();
+ aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.3D, 0.0D);
+ //Pollution particles intensify
+ if(GT_Pollution.getPollution(getBaseMetaTileEntity())>GT_Mod.gregtechproxy.mPollutionSmogLimit){
+ aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.45D, 0.0D);
+ aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.6D, 0.0D);
+ }
}
- }
+}
private void addOutputProducts() {
if (this.mOutputItem1 != null) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java
index 11c0fd109a..ff3af18e53 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java
@@ -87,7 +87,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock
this.mEfficiency = 10000;
this.mEfficiencyIncrease = 10000;
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), mMaxProgresstime*5);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime*5);
return true;
} else {
this.mEfficiency = 0;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
index ac7f7729d0..d68383272c 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
@@ -33,12 +33,13 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas
public String[] getDescription() {
return new String[]{
"Controller Block for the Cleanroom",
- "Min(WxHxD): 3x3x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)",
- "Controller (Top center), Walls Plascrete",
+ "Min(WxHxD): 3x4x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)",
+ "Controller (Top center)",
"Top besides contoller and edges Filter Machine Casings",
- "1x Reinforced Door",
+ "1 Reinforced Door (keep closed for 100% efficency",
"1x MV+ Energy Hatch, 1x Maintainance Hatch",
- "up to 10 Machine Hulls to transfer Items & Energy inside"};
+ "Up to 10 Machine Hulls to transfer Items & Energy through walls",
+ "Remaining Blocks Plascrete"};
}
public boolean checkRecipe(ItemStack aStack) {
@@ -148,9 +149,18 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas
if (doorState) {
mEfficiency = Math.max(0, mEfficiency - 200);
}
-
+ for(byte i = 0 ; i<6 ; i++){
+ byte t = (byte) Math.max(1, (byte)(15/(10000f / mEfficiency)));
+ aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t);
+ }
+
return true;
}
+
+ @Override
+ public boolean allowGeneralRedstoneOutput(){
+ return true;
+ }
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == 0 || aSide == 1) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
index c7309ef836..018dcb6282 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
@@ -95,7 +95,7 @@ public class GT_MetaTileEntity_DistillationTower
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size());
+ FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
if (tFluids.length > 0) {
for(int i = 0;i<tFluids.length;i++){
GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
index e0d0ee46d1..0f07a3e743 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
@@ -91,7 +91,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
}
}
- ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]);
ArrayList<FluidStack> tFluidList = getStoredFluids();
int tFluidList_sS = tFluidList.size();
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
index 118a04091a..d91b7efcb5 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
@@ -83,7 +83,7 @@ public class GT_MetaTileEntity_ImplosionCompressor
}
}
}
- ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]);
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))) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
index ed7100f30a..1c49f4fd9f 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
@@ -41,9 +41,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler
"Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s",
"A programmed circuit in the main block throttles the boiler (-1000L/s per config)",
"Size(WxHxD): 3x5x3, Controller (Front middle in Fireboxes)",
- "3x1x3 of Firebox Casings (Bottom layer, Min 3)",
- "3x4x3 of Machine Casings/Plated Bricks (Above Fireboxes, hollow, Min 24!)",
- "1x3x1 of Pipe Casings (Inside the Hollow Machine Casings/Plated Bricks)",
+ "3x1x3 of " +getCasingMaterial()+ " Firebox Casings (Bottom layer, Min 3)",
+ "3x4x3 of " +getCasingMaterial()+ " Machine Casings/Plated Bricks (Above Fireboxes, hollow, Min 24!)",
+ "1x3x1 of " +getCasingMaterial()+ " Pipe Casings (Inside the Hollow Machine Casings/Plated Bricks)",
"1x Fuel Input Hatch/Bus (Any Firebox)",
"1x Water Input Hatch (Any Firebox)",
"1x Steam Output Hatch (Any Casing)",
@@ -53,6 +53,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler
String.format("Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()),
"Causes up to " + 20 * getPollutionPerTick(null) + " Pollution per second"};
}
+
+ public abstract String getCasingMaterial();
public abstract Block getCasingBlock();
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
index 7c5dad3c96..cc494498da 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
@@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName);
}
+
+ public String getCasingMaterial(){
+ return "Bronze";
+ }
public Block getCasingBlock() {
return GregTech_API.sBlockCasings1;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
index a68c0e6212..984290a3c6 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
@@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_Steel
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName);
}
+
+ public String getCasingMaterial(){
+ return "Steel";
+ }
public Block getCasingBlock() {
return GregTech_API.sBlockCasings2;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
index 6fc32f8c34..144c44aeed 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
@@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName);
}
+
+ public String getCasingMaterial(){
+ return "Titanium";
+ }
public Block getCasingBlock() {
return GregTech_API.sBlockCasings4;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
index 997a176e34..b69bac2f94 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
@@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName);
}
+
+ public String getCasingMaterial(){
+ return "TungstenSteel";
+ }
public Block getCasingBlock() {
return GregTech_API.sBlockCasings4;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java
index 3262d4eee7..1a7b444b54 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java
@@ -1,195 +1,199 @@
-package gregtech.common.tileentities.machines.multi;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-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.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_MultiBlockBase {
-
- private static final int CASING_INDEX = 62;
-
- public GT_MetaTileEntity_LargeChemicalReactor(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeChemicalReactor(String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_LargeChemicalReactor(this.mName);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller block for the Large Chemical Reactor",
- "Has the same recipes as the Chemical Reactor",
- "Does not lose efficiency when overclocked",
- "Accepts fluids instead of fluid cells",
- "Size(WxHxD): 3x3x3",
- "3x3x3 of Chemically Inert Machine Casings (hollow, min 24!)",
- "Controller (Front centered)",
- "1x Cupronickel Coil Block (Bottom centered)",
- "1x PTFE Pipe Machine Casing (inside the hollow casings)",
- "1x Input Bus/Hatch (Any inert casing)",
- "1x Output Bus/Hatch (Any inert casing)",
- "1x Maintenance Hatch (Any inert casing)",
- "1x Energy Hatch (Any inert casing)"};
- }
-
- @Override
- 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[CASING_INDEX],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX] };
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- int tInputList_sS = tInputList.size();
- for (int i = 0; i < tInputList_sS - 1; i++) {
- for (int j = i + 1; j < tInputList_sS; 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--);
- tInputList_sS = tInputList.size();
- } else {
- tInputList.remove(i--);
- tInputList_sS = tInputList.size();
- break;
- }
- }
- }
- }
- ItemStack[] inputs = tInputList.toArray(new ItemStack[tInputList.size()]);
-
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- int tFluidList_sS = tFluidList.size();
- for (int i = 0; i < tFluidList_sS - 1; i++) {
- for (int j = i + 1; j < tFluidList_sS; j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- tFluidList_sS = tFluidList.size();
- } else {
- tFluidList.remove(i--);
- tFluidList_sS = tFluidList.size();
- break;
- }
- }
- }
- }
- FluidStack[] fluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
-
- if (inputs.length > 0 || fluids.length > 0) {
- long voltage = getMaxInputVoltage();
- byte tier = (byte) Math.max(1, GT_Utility.getTier(voltage));
- GT_Recipe recipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false,
- gregtech.api.enums.GT_Values.V[tier], fluids, inputs);
- if (recipe != null && recipe.isRecipeInputEqual(true, fluids, inputs)) {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- int EUt = recipe.mEUt;
- int maxProgresstime = recipe.mDuration;
-
- while (EUt <= gregtech.api.enums.GT_Values.V[tier - 1] && maxProgresstime > 1) {
- EUt *= 4;
- maxProgresstime /= 4;
- }
-
- this.mEUt = -EUt;
- this.mMaxProgresstime = maxProgresstime;
- this.mOutputItems = recipe.mOutputs;
- this.mOutputFluids = recipe.mFluidOutputs;
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- int casingAmount = 0;
- // x=width, z=depth, y=height
- for (int x = -1 + xDir; x <= xDir + 1; x++) {
- for (int z = -1 + zDir; z <= zDir + 1; z++) {
- for (int y = -1; y <= 1; y++) {
- IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z);
- Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z);
- if (x == xDir && z == zDir && y <= 0) {
- if ((y == -1)
- && (block != GregTech_API.sBlockCasings5 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 0)) {
- return false;
- } else if (y == 0 && (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 15)) {
- return false;
- }
- } else if (x != 0 || y != 0 || z != 0) {
- if (!addInputToMachineList(tileEntity, CASING_INDEX) && !addOutputToMachineList(tileEntity, CASING_INDEX)
- && !addMaintenanceToMachineList(tileEntity, CASING_INDEX)
- && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) {
- if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 14) {
- casingAmount++;
- } else {
- return false;
- }
- }
- }
-
- }
- }
-
- }
- return casingAmount >= 8;
- }
-
- @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 boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
-}
+package gregtech.common.tileentities.machines.multi;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+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.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_MultiBlockBase {
+
+ private static final int CASING_INDEX = 52;
+
+ public GT_MetaTileEntity_LargeChemicalReactor(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeChemicalReactor(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeChemicalReactor(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Controller block for the Large Chemical Reactor",
+ "Has the same recipes as the Chemical Reactor",
+ "Does not lose efficiency when overclocked",
+ "Accepts fluids instead of fluid cells",
+ "Size(WxHxD): 3x3x3",
+ "3x3x3 of Chemically Inert Machine Casings (hollow, min 8!)",
+ "Controller (Front centered)",
+ "1x Cupronickel Coil Block (Bottom centered)",
+ "1x PTFE Pipe Machine Casing (inside the hollow casings)",
+ "1x Input Bus/Hatch (Any inert casing)",
+ "1x Output Bus/Hatch (Any inert casing)",
+ "1x Maintenance Hatch (Any inert casing)",
+ "1x Energy Hatch (Any inert casing)"};
+ }
+
+ @Override
+ 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[CASING_INDEX],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE
+ : Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX] };
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ int tInputList_sS = tInputList.size();
+ for (int i = 0; i < tInputList_sS - 1; i++) {
+ for (int j = i + 1; j < tInputList_sS; 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--);
+ tInputList_sS = tInputList.size();
+ } else {
+ tInputList.remove(i--);
+ tInputList_sS = tInputList.size();
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] inputs = tInputList.toArray(new ItemStack[tInputList.size()]);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ int tFluidList_sS = tFluidList.size();
+ for (int i = 0; i < tFluidList_sS - 1; i++) {
+ for (int j = i + 1; j < tFluidList_sS; j++) {
+ if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
+ if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ tFluidList.remove(j--);
+ tFluidList_sS = tFluidList.size();
+ } else {
+ tFluidList.remove(i--);
+ tFluidList_sS = tFluidList.size();
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] fluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
+
+ if (inputs.length > 0 || fluids.length > 0) {
+ long voltage = getMaxInputVoltage();
+ byte tier = (byte) Math.max(1, GT_Utility.getTier(voltage));
+ GT_Recipe recipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false,
+ gregtech.api.enums.GT_Values.V[tier], fluids, inputs);
+ if (recipe != null && recipe.isRecipeInputEqual(true, fluids, inputs)) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ int EUt = recipe.mEUt;
+ int maxProgresstime = recipe.mDuration;
+
+ while (EUt <= gregtech.api.enums.GT_Values.V[tier - 1] && maxProgresstime > 2) {
+ EUt *= 4;
+ maxProgresstime /= 4;
+ }
+ if (maxProgresstime < 2) {
+ maxProgresstime = 2;
+ EUt = recipe.mEUt * recipe.mDuration / 2;
+ }
+
+ this.mEUt = -EUt;
+ this.mMaxProgresstime = maxProgresstime;
+ this.mOutputItems = recipe.mOutputs;
+ this.mOutputFluids = recipe.mFluidOutputs;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int casingAmount = 0;
+ // x=width, z=depth, y=height
+ for (int x = -1 + xDir; x <= xDir + 1; x++) {
+ for (int z = -1 + zDir; z <= zDir + 1; z++) {
+ for (int y = -1; y <= 1; y++) {
+ IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z);
+ Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z);
+ if (x == xDir && z == zDir && y <= 0) {
+ if ((y == -1)
+ && (block != GregTech_API.sBlockCasings5 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 0)) {
+ return false;
+ } else if (y == 0 && (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 5)) {
+ return false;
+ }
+ } else if (x != 0 || y != 0 || z != 0) {
+ if (!addInputToMachineList(tileEntity, CASING_INDEX) && !addOutputToMachineList(tileEntity, CASING_INDEX)
+ && !addMaintenanceToMachineList(tileEntity, CASING_INDEX)
+ && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) {
+ if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 4) {
+ casingAmount++;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ }
+ }
+
+ }
+ return casingAmount >= 8;
+ }
+
+ @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 boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java
index ec901e0dfc..7d6fe5935c 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java
@@ -18,6 +18,8 @@ import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
+import static gregtech.common.GT_UndergroundOil.undergroundOil;
+
public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase {
private boolean completedCycle = false;
@@ -73,12 +75,13 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase
}
}
}
- FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), true);
+ FluidStack tFluid = undergroundOil(getBaseMetaTileEntity(),.5F+(getInputTier()*.25F));
if (tFluid == null) {
stopMachine();
return false;
}
if (getYOfPumpHead() > 0 && getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) {
+
if (completedCycle) {
moveOneDown();
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
new file mode 100644
index 0000000000..25e4e3eb5d
--- /dev/null
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
@@ -0,0 +1,51 @@
+package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class GT_MetaTileEntity_OreDrillingPlant1 extends GT_MetaTileEntity_OreDrillingPlantBase {
+ public GT_MetaTileEntity_OreDrillingPlant1(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_OreDrillingPlant1(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return getDescriptionInternal("I");
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_OreDrillingPlant1(mName);
+ }
+
+ @Override
+ protected ItemList getCasingBlockItem() {
+ return ItemList.Casing_SolidSteel;
+ }
+
+ @Override
+ protected Materials getFrameMaterial() {
+ return Materials.Steel;
+ }
+
+ @Override
+ protected int getCasingTextureIndex() {
+ return 16;
+ }
+
+ @Override
+ protected int getRadiusInChunks() {
+ return 3;
+ }
+
+ @Override
+ protected int getMinTier() {
+ return 2;
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
new file mode 100644
index 0000000000..2b161fe471
--- /dev/null
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
@@ -0,0 +1,51 @@
+package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class GT_MetaTileEntity_OreDrillingPlant2 extends GT_MetaTileEntity_OreDrillingPlantBase {
+ public GT_MetaTileEntity_OreDrillingPlant2(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_OreDrillingPlant2(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return getDescriptionInternal("II");
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_OreDrillingPlant2(mName);
+ }
+
+ @Override
+ protected ItemList getCasingBlockItem() {
+ return ItemList.Casing_StableTitanium;
+ }
+
+ @Override
+ protected Materials getFrameMaterial() {
+ return Materials.Titanium;
+ }
+
+ @Override
+ protected int getCasingTextureIndex() {
+ return 50;
+ }
+
+ @Override
+ protected int getRadiusInChunks() {
+ return 4;
+ }
+
+ @Override
+ protected int getMinTier() {
+ return 3;
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
new file mode 100644
index 0000000000..1be6391f7a
--- /dev/null
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
@@ -0,0 +1,51 @@
+package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class GT_MetaTileEntity_OreDrillingPlant3 extends GT_MetaTileEntity_OreDrillingPlantBase {
+ public GT_MetaTileEntity_OreDrillingPlant3(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_OreDrillingPlant3(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return getDescriptionInternal("III");
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_OreDrillingPlant3(mName);
+ }
+
+ @Override
+ protected ItemList getCasingBlockItem() {
+ return ItemList.Casing_RobustTungstenSteel;
+ }
+
+ @Override
+ protected Materials getFrameMaterial() {
+ return Materials.TungstenSteel;
+ }
+
+ @Override
+ protected int getCasingTextureIndex() {
+ return 48;
+ }
+
+ @Override
+ protected int getRadiusInChunks() {
+ return 6;
+ }
+
+ @Override
+ protected int getMinTier() {
+ return 4;
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
new file mode 100644
index 0000000000..55fc1ef7e0
--- /dev/null
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
@@ -0,0 +1,51 @@
+package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class GT_MetaTileEntity_OreDrillingPlant4 extends GT_MetaTileEntity_OreDrillingPlantBase {
+ public GT_MetaTileEntity_OreDrillingPlant4(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_OreDrillingPlant4(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return getDescriptionInternal("IV");
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_OreDrillingPlant4(mName);
+ }
+
+ @Override
+ protected ItemList getCasingBlockItem() {
+ return ItemList.Casing_MiningOsmiridium;
+ }
+
+ @Override
+ protected Materials getFrameMaterial() {
+ return Materials.Osmiridium;
+ }
+
+ @Override
+ protected int getCasingTextureIndex() {
+ return 62;
+ }
+
+ @Override
+ protected int getRadiusInChunks() {
+ return 9;
+ }
+
+ @Override
+ protected int getMinTier() {
+ return 5;
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
new file mode 100644
index 0000000000..f25d2d304c
--- /dev/null
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
@@ -0,0 +1,425 @@
+package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures;
+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_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.ItemData;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.blocks.GT_Block_Ores_Abstract;
+import gregtech.common.blocks.GT_TileEntity_Ores;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.ChunkPosition;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+
+import static gregtech.api.enums.GT_Values.*;
+
+public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTileEntity_MultiBlockBase {
+ private static final ItemStack miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0);
+ private static final ItemStack miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0);
+ private static final Block miningPipeBlock = GT_Utility.getBlockFromStack(miningPipe);
+ private static final Block miningPipeTipBlock = GT_Utility.getBlockFromStack(miningPipeTip);
+
+ private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>();
+
+ private Block casingBlock;
+ private int casingMeta;
+ private int frameMeta;
+ private int casingTextureIndex;
+
+ private ForgeDirection back;
+ private int xDrill, yDrill, zDrill, xCenter, zCenter, yHead;
+
+ private boolean isPickingPipes;
+
+ public GT_MetaTileEntity_OreDrillingPlantBase(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ initFields();
+ }
+
+ public GT_MetaTileEntity_OreDrillingPlantBase(String aName) {
+ super(aName);
+ initFields();
+ }
+
+ private void initFields() {
+ casingBlock = getCasingBlockItem().getBlock();
+ casingMeta = getCasingBlockItem().get(0).getItemDamage();
+ int frameId = 4096 + getFrameMaterial().mMetaItemSubID;
+ frameMeta = GregTech_API.METATILEENTITIES[frameId] != null ? GregTech_API.METATILEENTITIES[frameId].getTileEntityBaseType() : W;
+ casingTextureIndex = getCasingTextureIndex();
+ isPickingPipes = 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[casingTextureIndex],new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL)};
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[casingTextureIndex]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OreDrillingPlant.png");
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("isPickingPipe", isPickingPipes);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ isPickingPipes = aNBT.getBoolean("isPickingPipes");
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ setElectricityStats();
+ int oldYHead = yHead;
+ if (!checkPipesAndSetYHead() || !isEnergyEnough()) {
+ stopMachine();
+ return false;
+ }
+ if (yHead != oldYHead) oreBlockPositions.clear();
+ if (isPickingPipes) {
+ if (tryPickPipe()) {
+ mOutputItems = new ItemStack[] {GT_Utility.copyAmount(1, miningPipe)};
+ return true;
+ } else {
+ isPickingPipes = false;
+ stopMachine();
+ return false;
+ }
+ }
+
+ putMiningPipesFromInputsInController();
+ if (!tryConsumeDrillingFluid()) return false;
+
+ fillMineListIfEmpty();
+ if (oreBlockPositions.isEmpty()) {
+ if (!tryLowerPipe()) {
+ isPickingPipes = true;
+ return true;
+ }
+ //new layer - fill again
+ fillMineListIfEmpty();
+ }
+
+ ChunkPosition oreBlockPos = null;
+ Block oreBlock = null;
+
+ while ((oreBlock == null || oreBlock == Blocks.air) && !oreBlockPositions.isEmpty()) {
+ oreBlockPos = oreBlockPositions.remove(0);
+ oreBlock = getBaseMetaTileEntity().getBlock(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ);
+ }
+
+ if (oreBlock != null && oreBlock != Blocks.air) {
+ ArrayList<ItemStack> oreBlockDrops = getBlockDrops(oreBlock, oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ);
+ getBaseMetaTileEntity().getWorld().setBlockToAir(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ);
+ mOutputItems = getOutputByDrops(oreBlockDrops);
+ }
+
+ return true;
+ }
+
+ private boolean isEnergyEnough() {
+ long requiredEnergy = 512 + getMaxInputVoltage() * 4;
+ for (GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) {
+ requiredEnergy -= energyHatch.getEUVar();
+ if (requiredEnergy <= 0) return true;
+ }
+ return false;
+ }
+
+ private boolean tryPickPipe() {
+ if (yHead == yDrill) return false;
+ if (checkBlockAndMeta(xCenter, yHead + 1, zCenter, miningPipeBlock, W))
+ getBaseMetaTileEntity().getWorld().setBlock(xCenter, yHead + 1, zCenter, miningPipeTipBlock);
+ getBaseMetaTileEntity().getWorld().setBlockToAir(xCenter, yHead, zCenter);
+ return true;
+ }
+
+ private void setElectricityStats() {
+ this.mEfficiency = getCurrentEfficiency(null);
+ this.mEfficiencyIncrease = 10000;
+ //T1 = 12; T2 = 48; T3 = 192; T4 = 768
+ this.mEUt = 3 * (1 << (getMinTier() << 1));
+ //T1 = 960; T2 = 480; T3 = 240; T4 = 120
+ this.mMaxProgresstime = (isPickingPipes ? 80 : 1920) / (1 << getMinTier());
+
+ long voltage = getMaxInputVoltage();
+ long overclockEu = V[Math.max(1, GT_Utility.getTier(voltage)) - 1];
+ while (this.mEUt <= overclockEu) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+
+ this.mEUt = -this.mEUt;
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ }
+
+ private ItemStack[] getOutputByDrops(ArrayList<ItemStack> oreBlockDrops) {
+ long voltage = getMaxInputVoltage();
+ ArrayList<ItemStack> outputItems = new ArrayList<>();
+ while (!oreBlockDrops.isEmpty()) {
+ ItemStack currentItem = oreBlockDrops.remove(0).copy();
+ if (!doUseMaceratorRecipe(currentItem)) {
+ multiplyStackSize(currentItem);
+ outputItems.add(currentItem);
+ continue;
+ }
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, voltage, null, currentItem);
+ if (tRecipe == null) {
+ outputItems.add(currentItem);
+ continue;
+ }
+
+ for (int i = 0; i < tRecipe.mOutputs.length; i++) {
+ ItemStack recipeOutput = tRecipe.mOutputs[i].copy();
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
+ multiplyStackSize(recipeOutput);
+ outputItems.add(recipeOutput);
+ }
+ }
+ return outputItems.toArray(new ItemStack[0]);
+ }
+
+ private boolean doUseMaceratorRecipe(ItemStack currentItem) {
+ ItemData itemData = GT_OreDictUnificator.getItemData(currentItem);
+ return itemData == null
+ || itemData.mPrefix != OrePrefixes.crushed
+ && itemData.mPrefix != OrePrefixes.dustImpure
+ && itemData.mPrefix != OrePrefixes.dust
+ && itemData.mMaterial.mMaterial != Materials.Oilsands;
+ }
+
+ private void multiplyStackSize(ItemStack itemStack) {
+ itemStack.stackSize *= getBaseMetaTileEntity().getRandomNumber(4) + 1;
+ }
+
+ private ArrayList<ItemStack> getBlockDrops(final Block oreBlock, int posX, int posY, int posZ) {
+ final int blockMeta = getBaseMetaTileEntity().getMetaID(posX, posY, posZ);
+ if (oreBlock.canSilkHarvest(getBaseMetaTileEntity().getWorld(), null, posX, posY, posZ, blockMeta)) {
+ return new ArrayList<ItemStack>() {{
+ add(new ItemStack(oreBlock, 1, blockMeta));
+ }};
+ } else return oreBlock.getDrops(getBaseMetaTileEntity().getWorld(), posX, posY, posZ, blockMeta, 1);
+ }
+
+ private boolean tryConsumeDrillingFluid() {
+ return depleteInput(new FluidStack(ItemList.sDrillingFluid, 2000));
+ }
+
+ private void putMiningPipesFromInputsInController() {
+ int maxPipes = miningPipe.getMaxStackSize();
+ if (isHasMiningPipes(maxPipes)) return;
+
+ ItemStack pipes = getStackInSlot(1);
+ for (ItemStack storedItem : getStoredInputs()) {
+ if (!storedItem.isItemEqual(miningPipe)) continue;
+
+ if (pipes == null) {
+ setInventorySlotContents(1, GT_Utility.copy(miningPipe));
+ pipes = getStackInSlot(1);
+ }
+
+ if (pipes.stackSize == maxPipes) break;
+
+ int needPipes = maxPipes - pipes.stackSize;
+ int transferPipes = storedItem.stackSize < needPipes ? storedItem.stackSize : needPipes;
+
+ pipes.stackSize += transferPipes;
+ storedItem.stackSize -= transferPipes;
+ }
+ updateSlots();
+ }
+
+ private void fillMineListIfEmpty() {
+ if (!oreBlockPositions.isEmpty()) return;
+
+ tryAddOreBlockToMineList(xCenter, yHead - 1, zCenter);
+ if (yHead == yDrill) return; //skip controller block layer
+
+ int radius = getRadiusInChunks() << 4;
+ for (int xOff = -radius; xOff <= radius; xOff++)
+ for (int zOff = -radius; zOff <= radius; zOff++)
+ tryAddOreBlockToMineList(xDrill + xOff, yHead, zDrill + zOff);
+ }
+
+ private void tryAddOreBlockToMineList(int x, int y, int z) {
+ Block block = getBaseMetaTileEntity().getBlock(x, y, z);
+ int blockMeta = getBaseMetaTileEntity().getMetaID(x, y, z);
+ ChunkPosition blockPos = new ChunkPosition(x, y, z);
+ if (oreBlockPositions.contains(blockPos)) return;
+ if (block instanceof GT_Block_Ores_Abstract) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntity(x, y, z);
+ if (tTileEntity != null && tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural)
+ oreBlockPositions.add(blockPos);
+ } else {
+ ItemData association = GT_OreDictUnificator.getAssociation(new ItemStack(block, 1, blockMeta));
+ if (association != null && association.mPrefix.toString().startsWith("ore"))
+ oreBlockPositions.add(blockPos);
+ }
+ }
+
+ private boolean tryLowerPipe() {
+ if (!isHasMiningPipes()) return false;
+
+ if (yHead <= 0) return false;
+ if (checkBlockAndMeta(xCenter, yHead - 1, zCenter, Blocks.bedrock, W)) return false;
+
+ getBaseMetaTileEntity().getWorld().setBlock(xCenter, yHead - 1, zCenter, miningPipeTipBlock);
+ if (yHead != yDrill) getBaseMetaTileEntity().getWorld().setBlock(xCenter, yHead, zCenter, miningPipeBlock);
+
+ getBaseMetaTileEntity().decrStackSize(1, 1);
+ return true;
+ }
+
+ private boolean isHasMiningPipes() {
+ return isHasMiningPipes(1);
+ }
+
+ private boolean isHasMiningPipes(int minCount) {
+ ItemStack pipe = getStackInSlot(1);
+ return pipe != null && pipe.stackSize > minCount - 1 && pipe.isItemEqual(miningPipe);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ updateCoordinates();
+ //check base layer
+ for (int xOff = -1 + back.offsetX; xOff <= 1 + back.offsetX; xOff++) {
+ for (int zOff = -1 + back.offsetZ; zOff <= 1 + back.offsetZ; zOff++) {
+ if (xOff == 0 && zOff == 0) continue;
+
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xOff, 0, zOff);
+ if (!checkCasingBlock(xOff, 0, zOff)
+ && !addMaintenanceToMachineList(tTileEntity, casingTextureIndex)
+ && !addInputToMachineList(tTileEntity, casingTextureIndex)
+ && !addOutputToMachineList(tTileEntity, casingTextureIndex)
+ && !addEnergyInputToMachineList(tTileEntity, casingTextureIndex))
+ return false;
+ }
+ }
+ if (mMaintenanceHatches.isEmpty() || mInputHatches.isEmpty() || mOutputBusses.isEmpty() || mEnergyHatches.isEmpty()) return false;
+ if (GT_Utility.getTier(getMaxInputVoltage()) < getMinTier()) return false;
+ //check tower
+ for (int yOff = 1; yOff < 4; yOff++) {
+ if (!checkCasingBlock(back.offsetX, yOff, back.offsetZ)
+ || !checkFrameBlock(back.offsetX + 1, yOff, back.offsetZ)
+ || !checkFrameBlock(back.offsetX - 1, yOff, back.offsetZ)
+ || !checkFrameBlock(back.offsetX, yOff, back.offsetZ + 1)
+ || !checkFrameBlock(back.offsetX, yOff, back.offsetZ - 1)
+ || !checkFrameBlock(back.offsetX, yOff + 3, back.offsetZ))
+ return false;
+ }
+ return true;
+ }
+
+ private void updateCoordinates() {
+ xDrill = getBaseMetaTileEntity().getXCoord();
+ yDrill = getBaseMetaTileEntity().getYCoord();
+ zDrill = getBaseMetaTileEntity().getZCoord();
+ back = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing());
+ xCenter = xDrill + back.offsetX;
+ zCenter = zDrill + back.offsetZ;
+ }
+
+ private boolean checkPipesAndSetYHead() {
+ yHead = yDrill - 1;
+ while (checkBlockAndMeta(xCenter, yHead, zCenter, miningPipeBlock, W)) yHead--; //skip pipes
+ //is pipe tip OR is controller layer
+ if (checkBlockAndMeta(xCenter, yHead, zCenter, miningPipeTipBlock, W) || ++yHead == yDrill) return true;
+ //pipe column is broken - try fix
+ getBaseMetaTileEntity().getWorld().setBlock(xCenter, yHead, zCenter, miningPipeTipBlock);
+ return true;
+ }
+
+ private boolean checkCasingBlock(int xOff, int yOff, int zOff) {
+ return checkBlockAndMetaOffset(xOff, yOff, zOff, casingBlock, casingMeta);
+ }
+ //meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight operation)
+ private boolean checkFrameBlock(int xOff, int yOff, int zOff) {
+ return checkBlockAndMetaOffset(xOff, yOff, zOff, GregTech_API.sBlockMachines, frameMeta);
+ }
+
+ private boolean checkBlockAndMetaOffset(int xOff, int yOff, int zOff, Block block, int meta) {
+ return checkBlockAndMeta(xDrill + xOff, yDrill + yOff, zDrill + zOff, block, meta);
+ }
+
+ private boolean checkBlockAndMeta(int x, int y, int z, Block block, int meta) {
+ return (meta == W || getBaseMetaTileEntity().getMetaID(x, y, z) == meta)
+ && getBaseMetaTileEntity().getBlock(x, y, z) == block;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @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 boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ protected abstract ItemList getCasingBlockItem();
+
+ protected abstract Materials getFrameMaterial();
+
+ protected abstract int getCasingTextureIndex();
+
+ protected abstract int getRadiusInChunks();
+
+ protected abstract int getMinTier();
+
+ protected String[] getDescriptionInternal(String tierSuffix) {
+ String casings = getCasingBlockItem().get(0).getDisplayName();
+ return new String[]{
+ "Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : ""),
+ "Size(WxHxD): 3x7x3, Controller (Front middle bottom)",
+ "3x1x3 Base of " + casings,
+ "1x3x1 " + casings + " pillar (Center of base)",
+ "1x3x1 " + getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)",
+ "1x Input Hatch for drilling fluid (Any bottom layer casing)",
+ "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)",
+ "1x Output Bus (Any bottom layer casing)",
+ "1x Maintenance Hatch (Any bottom layer casing)",
+ "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)",
+ "Radius is " + (getRadiusInChunks() << 4) + " blocks"};
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
index 318d700195..5811743432 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
@@ -1,5 +1,6 @@
package gregtech.common.tileentities.machines.multi;
+import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
@@ -22,6 +23,8 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity;
+
public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase {
GT_Recipe mLastRecipe;
@@ -64,7 +67,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
if (mInventory[1] == null) return null;
- String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", "");
+ 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")) {
@@ -131,8 +134,25 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
return GT_Recipe.GT_Recipe_Map.sPolarizerRecipes;
} else if(tmp.startsWith("press")){
return GT_Recipe.GT_Recipe_Map.sPressRecipes;
+ } else if (tmp.startsWith("plasmaarcfurnace")) {
+ return GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes;
+ } else if (tmp.startsWith("printer")) {
+ return GT_Recipe.GT_Recipe_Map.sPrinterRecipes;
+ } else if (tmp.startsWith("press")) {
+ return GT_Recipe.GT_Recipe_Map.sPressRecipes;
+ } else if (tmp.startsWith("fluidcanner")) {
+ return GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes;
+ } else if (tmp.startsWith("fluidheater")) {
+ return GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes;
+ } else if (tmp.startsWith("distillery")) {
+ return GT_Recipe.GT_Recipe_Map.sDistilleryRecipes;
+ } else if (tmp.startsWith("slicer")) {
+ return GT_Recipe.GT_Recipe_Map.sSlicerRecipes;
+ } else if (tmp.startsWith("amplifier")) {
+ return GT_Recipe.GT_Recipe_Map.sAmplifiers;
+ } else if (tmp.startsWith("circuitassembler")) {
+ return GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes;
}
-
return null;
}
@@ -153,9 +173,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
return false;
}
GT_Recipe.GT_Recipe_Map map = getRecipeMap();
- if (map == null) {
- return false;
- }
+ if (map == null) return false;
ArrayList<ItemStack> tInputList = getStoredInputs();
int tTier = 0;
if (mInventory[1].getUnlocalizedName().endsWith("1")) {
@@ -186,6 +204,10 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
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 (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 &&
+ !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId))
+ return false;
+
mLastRecipe = tRecipe;
this.mEUt = 0;
this.mOutputItems = null;