aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines/multi
diff options
context:
space:
mode:
authorTechlone <techlone.mc@gmail.com>2017-05-27 20:45:19 +0500
committerTechlone <techlone.mc@gmail.com>2017-05-27 20:45:19 +0500
commita391c6fca8d42ea3eaea0de35f807b04f84bb78a (patch)
tree3d5d812cc079bd076e8a55ea450faec46bfa0bcd /src/main/java/gregtech/common/tileentities/machines/multi
parenta3de198ba0b9a9d545600f499f7a719c8733e4cd (diff)
parent6398c0650694dca192281e4f2bbe9dcd9d5546e7 (diff)
downloadGT5-Unofficial-a391c6fca8d42ea3eaea0de35f807b04f84bb78a.tar.gz
GT5-Unofficial-a391c6fca8d42ea3eaea0de35f807b04f84bb78a.tar.bz2
GT5-Unofficial-a391c6fca8d42ea3eaea0de35f807b04f84bb78a.zip
Merge branch 'unstable' of https://github.com/Blood-Asp/GT5-Unofficial into unstable
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java245
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java366
-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_LargeBoiler.java86
4 files changed, 376 insertions, 323 deletions
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 88558b53cc..c3ab282906 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
@@ -67,58 +67,61 @@ public class GT_MetaTileEntity_AssemblyLine
}
public boolean checkRecipe(ItemStack aStack) {
- if(!GT_Utility.isStackValid(mInventory[1]) && !ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true))return false;
- NBTTagCompound tTag = mInventory[1].getTagCompound();
- if(tTag==null)return false;
- ItemStack tStack[] = new ItemStack[15];
- for(int i = 0;i<15;i++){
- if(tTag.hasKey(""+i)){
- tStack[i] = GT_Utility.loadItem(tTag, ""+i);
- if(tStack[i]!=null){
- if(mInputBusses.get(i)==null)return false;
- if(GT_Utility.areStacksEqual(tStack[i],mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0),true) && tStack[i].stackSize <= mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0).stackSize){
- }else{return false;}
- }}
- }
- FluidStack[] tFluids = new FluidStack[4];
- for(int i = 0;i<4;i++){
- if(tTag.hasKey("f"+i)){
- tFluids[i] = GT_Utility.loadFluid(tTag, "f"+i);
- if(tFluids[i]!=null){
- if(mInputHatches.get(i)==null)return false;
- if(mInputHatches.get(i).mFluid!=null && GT_Utility.areFluidsEqual(mInputHatches.get(i).mFluid, tFluids[i], true) && mInputHatches.get(i).mFluid.amount>=tFluids[i].amount){
- }else{return false;}
- }
- }
- }
- if(tTag.hasKey("output")){
- mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")};
- if(mOutputItems==null||mOutputItems[0]==null||!GT_Utility.isStackValid(mOutputItems[0]))return false;
- }else{return false;}
- if(tTag.hasKey("time")){
- mMaxProgresstime = tTag.getInteger("time");
- if(mMaxProgresstime<=0)return false;
- }else{return false;}
- if(tTag.hasKey("eu")){
- mEUt = tTag.getInteger("eu");
- }else{return false;}
- for(int i = 0;i<15;i++){
- if(tStack[i]!=null){
- mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0).stackSize -= tStack[i].stackSize;
- if(mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0).stackSize <= 0){
- }
- }
- }
-
- for(int i = 0;i<4;i++){
- if(tFluids[i]!=null){
- mInputHatches.get(i).mFluid.amount -= tFluids[i].amount;
- if(mInputHatches.get(i).mFluid.amount<=0){
- mInputHatches.get(i).mFluid = null;
- }
- }
- }
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
+ if (!GT_Utility.isStackValid(mInventory[1]) || !ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true))
+ return false;
+
+ NBTTagCompound tTag = mInventory[1].getTagCompound();
+ if (tTag == null) return false;
+ ItemStack tStack[] = new ItemStack[15];
+ for (int i = 0; i < 15; i++) {
+ if (!tTag.hasKey("" + i)) continue;
+ if (mInputBusses.get(i) == null) return false;
+ tStack[i] = GT_Utility.loadItem(tTag, "" + i);
+ if (tStack[i] == null) continue;
+ ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
+ if (!GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) || tStack[i].stackSize > stackInSlot.stackSize) {
+ return false;
+ }
+ }
+
+ 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 (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) {
+ return false;
+ }
+ }
+
+ if (!tTag.hasKey("output")) return false;
+ mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")};
+ if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0]))
+ return false;
+
+ if (!tTag.hasKey("time")) return false;
+ mMaxProgresstime = tTag.getInteger("time");
+ if (mMaxProgresstime <= 0) return false;
+
+ if (!tTag.hasKey("eu")) return false;
+ mEUt = tTag.getInteger("eu");
+ for (int i = 0; i < 15; i++) {
+ if (tStack[i] == null) continue;
+ ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
+ stackInSlot.stackSize -= tStack[i].stackSize;
+ }
+
+ for (int i = 0; i < 4; i++) {
+ if (tFluids[i] == null) continue;
+ mInputHatches.get(i).mFluid.amount -= tFluids[i].amount;
+ if (mInputHatches.get(i).mFluid.amount <= 0) {
+ mInputHatches.get(i).mFluid = null;
+ }
+ }
+
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
if (mEUt <= 16) {
@@ -130,6 +133,9 @@ public class GT_MetaTileEntity_AssemblyLine
this.mMaxProgresstime /= 2;
}
}
+ if (this.mEUt > 0) {
+ this.mEUt = -this.mEUt;
+ }
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
updateSlots();
return true;
@@ -138,7 +144,7 @@ public class GT_MetaTileEntity_AssemblyLine
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(212), 10, 1.0F, aX, aY, aZ);
+ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ);
}
}
@@ -146,71 +152,117 @@ public class GT_MetaTileEntity_AssemblyLine
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
if (xDir != 0) {
- for(int r = 0; r <= 16; r++){
- int i = r*xDir;
+ for (int r = 0; r <= 16; r++) {
+ int i = r * xDir;
- if(i!=0&& !(aBaseMetaTileEntity.getBlockOffset(0, 0, i)==GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(0, 0, i)==10)){return false;}
- if(!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")){return false;}
+ if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(0, 0, i) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) == 10)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) {
+ return false;
+ }
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){
- if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2) {return false;}
- if (aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) {return false;}
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))) {
+ if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) {
+ return false;
+ }
}
tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 1, i);
- if (!addEnergyInputToMachineList(tTileEntity, 16)){
- if (aBaseMetaTileEntity.getBlockOffset(xDir, 1, i) != GregTech_API.sBlockCasings2) {return false;}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir, 1, i) != 0) {return false;}
+ if (!addEnergyInputToMachineList(tTileEntity, 16)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, 1, i) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir, 1, i) != 0) {
+ return false;
+ }
+ }
+ if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(xDir, 0, i) == GregTech_API.sBlockCasings2 && aBaseMetaTileEntity.getMetaIDOffset(xDir, 0, i) == 9)) {
+ return false;
+ }
+ if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(xDir, -1, i) == GregTech_API.sBlockCasings2 && aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, i) == 5)) {
+ return false;
}
- if(i!=0&& !(aBaseMetaTileEntity.getBlockOffset(xDir, 0, i)==GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(xDir, 0, i)==9)){return false;}
- if(i!=0&& !(aBaseMetaTileEntity.getBlockOffset(xDir,-1, i)==GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(xDir,-1, i)==5)){return false;}
- if(!(aBaseMetaTileEntity.getBlockOffset(xDir*2, 0, i)==GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(xDir*2, 0, i)==10)){return false;}
- if(!aBaseMetaTileEntity.getBlockOffset(xDir*2, -1, i).getUnlocalizedName().equals("blockAlloyGlass")){return false;}
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir*2, -2, i);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){
- if (aBaseMetaTileEntity.getBlockOffset(xDir*2, -2, i) != GregTech_API.sBlockCasings2) {return false;}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir*2, -2, i) != 0) {return false;}
+ if (!(aBaseMetaTileEntity.getBlockOffset(xDir * 2, 0, i) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, 0, i) == 10)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getBlockOffset(xDir * 2, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) {
+ return false;
+ }
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir * 2, -2, i);
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -2, i) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -2, i) != 0) {
+ return false;
+ }
}
tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i);
- if (!addInputToMachineList(tTileEntity, 16)){
- if (!addOutputToMachineList(tTileEntity, 16)){
- }else{if(r>0){return mEnergyHatches.size()>0;}else{return false;}}
+ if (!addInputToMachineList(tTileEntity, 16) && addOutputToMachineList(tTileEntity, 16)) {
+ return r > 0 && mEnergyHatches.size() > 0;
}
}
- }else{
- for(int r = 0; r <= 16; r++){
- int i = r*-zDir;
+ } else {
+ for (int r = 0; r <= 16; r++) {
+ int i = r * -zDir;
- if(i!=0 && !(aBaseMetaTileEntity.getBlockOffset(i, 0, 0)==GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0)==10)){return false;}
- if(!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")){return false;}
+ if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(i, 0, 0) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) == 10)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")) {
+ return false;
+ }
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){
- if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2) {return false;}
- if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) {return false;}
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))) {
+ if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) {
+ return false;
+ }
}
tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 1, zDir);
- if (!addEnergyInputToMachineList(tTileEntity, 16)){
- if (aBaseMetaTileEntity.getBlockOffset(i, 1, zDir) != GregTech_API.sBlockCasings2) {return false;}
- if (aBaseMetaTileEntity.getMetaIDOffset(i, 1, zDir) != 0) {return false;}
+ if (!addEnergyInputToMachineList(tTileEntity, 16)) {
+ if (aBaseMetaTileEntity.getBlockOffset(i, 1, zDir) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(i, 1, zDir) != 0) {
+ return false;
+ }
+ }
+ if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(i, 0, zDir) == GregTech_API.sBlockCasings2 && aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir) == 9)) {
+ return false;
+ }
+ if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(i, -1, zDir) == GregTech_API.sBlockCasings2 && aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir) == 5)) {
+ return false;
}
- if(i!=0&& !(aBaseMetaTileEntity.getBlockOffset(i, 0, zDir)==GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir)==9)){return false;}
- if(i!=0&& !(aBaseMetaTileEntity.getBlockOffset(i,-1, zDir)==GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(i,-1, zDir)==5)){return false;}
- if(!(aBaseMetaTileEntity.getBlockOffset(i, 0, zDir*2)==GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir*2)==10)){return false;}
- if(!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir*2).getUnlocalizedName().equals("blockAlloyGlass")){return false;}
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir*2);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){
- if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir*2) != GregTech_API.sBlockCasings2) {return false;}
- if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir*2) != 0) {return false;}
+ if (!(aBaseMetaTileEntity.getBlockOffset(i, 0, zDir * 2) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir * 2) == 10)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir * 2).getUnlocalizedName().equals("blockAlloyGlass")) {
+ return false;
+ }
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir * 2);
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))) {
+ if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir * 2) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir * 2) != 0) {
+ return false;
+ }
}
tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir);
- if (!addInputToMachineList(tTileEntity, 16)){
- if (!addOutputToMachineList(tTileEntity, 16)){
- }else{if(r>0){return mEnergyHatches.size()>0;}else{return false;}}
+ if (!addInputToMachineList(tTileEntity, 16) && addOutputToMachineList(tTileEntity, 16)) {
+ return r > 0 && mEnergyHatches.size() > 0;
}
}
}
@@ -228,6 +280,7 @@ public class GT_MetaTileEntity_AssemblyLine
public int getDamageToComponent(ItemStack aStack) {
return 0;
}
+
public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
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 484195a2cd..015670cb02 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
@@ -16,188 +16,184 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase {
- private int mHeatingCapacity = 0;
-
- public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_Cleanroom(String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Cleanroom(this.mName);
- }
-
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Cleanroom",
- "Min(WxHxD): 3x3x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)",
- "Controller (Top center), Walls Plascrete",
- "Top besides contoller and corners filter casings",
- "1 Reinforced Door",
- "1x Energy Hatch, 1x Maintainance Hatch",
- "up to 10 Machine Hull to transfer Items & Energy inside"};
- }
-
- public boolean checkRecipe(ItemStack aStack) {
- this.mEfficiencyIncrease = 100;
- this.mMaxProgresstime = 100;
- this.mEUt = -4;
- return true;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int x = 1;
- int z = 1;
- int y = 1;
- int mDoorCount = 0;
- int mHullCount = 0;
- int mPlascreteCount = 0;
- boolean doorState = false;
- mUpdate = 100;
- for (int i = 1; i < 8; i++) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0);
- int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0);
- if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) {
- if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) {
- x = i;
- z = i;
- break;
- } else {
- return false;
- }
- }
- }
- for (int i = -1; i > -16; i--) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z);
- int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z);
- if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) {
- y = i + 1;
- break;
- }
- }
- if (y > -2) {
- return false;
- }
- for (int dX = -x; dX <= x; dX++) {
- for (int dZ = -z; dZ <= z; dZ++) {
- for (int dY = 0; dY >= y; dY--) {
- if (dX == -x || dX == x || dY == -y || dY == y || dZ == -z || dZ == z) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ);
- int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ);
- if (y == 0) {
- if (dX == -x || dX == x || dZ == -z || dZ == z) {
- if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) {
- return false;
- }
- } else if (dX == 0 && dZ == 0) {
- } else {
- if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) {
- return false;
- }
- }
- } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) {
- mPlascreteCount++;
- } else {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ);
- if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) {
- if (tBlock instanceof ic2.core.block.BlockIC2Door) {
- if ((tMeta & 8) == 0) {
- doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0);
- }
- mDoorCount++;
- } else {
- if (tTileEntity == null) {
- {
- return false;
- }
- }
- IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) {
- mHullCount++;
- } else {
- return false;
- }
- }
- }
- }
- } else {
-
- }
- }
- }
- }
- if (mMaintenanceHatches.size() != 1 || mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) {
- return false;
- }
- for (int dX = -x + 1; dX <= x - 1; dX++) {
- for (int dZ = -z + 1; dZ <= z - 1; dZ++) {
- for (int dY = -1; dY >= y + 1; dY--) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ);
- if (tTileEntity != null) {
- IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity();
- if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe) {
- ((GT_MetaTileEntity_BasicMachine_GT_Recipe) aMetaTileEntity).mCleanroom = this;
- }
- }
- }
- }
- }
-
- if (doorState) {
- mEfficiency = Math.max(0, mEfficiency - 200);
- }
-
- return true;
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == 0 || aSide == 1) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE),
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE : Textures.BlockIcons.OVERLAY_TOP_CLEANROOM) };
-
- }
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE) };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
- }
-
- 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 0;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-} \ No newline at end of file
+ private int mHeatingCapacity = 0;
+
+ public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_Cleanroom(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Cleanroom(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Cleanroom",
+ "Min(WxHxD): 3x3x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)",
+ "Controller (Top center), Walls Plascrete",
+ "Top besides contoller and corners filter casings",
+ "1 Reinforced Door",
+ "1x Energy Hatch, 1x Maintainance Hatch",
+ "up to 10 Machine Hull to transfer Items & Energy inside"};
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ this.mEfficiencyIncrease = 100;
+ this.mMaxProgresstime = 100;
+ this.mEUt = -4;
+ return true;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int x = 1;
+ int z = 1;
+ int y = 1;
+ int mDoorCount = 0;
+ int mHullCount = 0;
+ int mPlascreteCount = 0;
+ boolean doorState = false;
+ mUpdate = 100;
+ for (int i = 1; i < 8; i++) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0);
+ int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0);
+ if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) {
+ if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) {
+ x = i;
+ z = i;
+ break;
+ } else {
+ return false;
+ }
+ }
+ }
+ for (int i = -1; i > -16; i--) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z);
+ int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z);
+ if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) {
+ y = i + 1;
+ break;
+ }
+ }
+ if (y > -2) {
+ return false;
+ }
+ for (int dX = -x; dX <= x; dX++) {
+ for (int dZ = -z; dZ <= z; dZ++) {
+ for (int dY = 0; dY >= y; dY--) {
+ if (dX == -x || dX == x || dY == -y || dY == y || dZ == -z || dZ == z) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ);
+ int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ);
+ if (y == 0) {
+ if (dX == -x || dX == x || dZ == -z || dZ == z) {
+ if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) {
+ return false;
+ }
+ } else if (dX == 0 && dZ == 0) {
+ } else {
+ if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) {
+ return false;
+ }
+ }
+ } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) {
+ mPlascreteCount++;
+ } else {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ);
+ if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) {
+ if (tBlock instanceof ic2.core.block.BlockIC2Door) {
+ if ((tMeta & 8) == 0) {
+ doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0);
+ }
+ mDoorCount++;
+ } else {
+ if (tTileEntity == null) {
+ return false;
+ }
+ IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) {
+ mHullCount++;
+ } else {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (mMaintenanceHatches.size() != 1 || mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) {
+ return false;
+ }
+ for (int dX = -x + 1; dX <= x - 1; dX++) {
+ for (int dZ = -z + 1; dZ <= z - 1; dZ++) {
+ for (int dY = -1; dY >= y + 1; dY--) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ);
+ if (tTileEntity != null) {
+ IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe) {
+ ((GT_MetaTileEntity_BasicMachine_GT_Recipe) aMetaTileEntity).mCleanroom = this;
+ }
+ }
+ }
+ }
+ }
+
+ if (doorState) {
+ mEfficiency = Math.max(0, mEfficiency - 200);
+ }
+
+ return true;
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == 0 || aSide == 1) {
+ return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE),
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE : Textures.BlockIcons.OVERLAY_TOP_CLEANROOM)};
+
+ }
+ return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE)};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ 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 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
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 e82fa34fa0..e0d0ee46d1 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
@@ -109,7 +109,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
}
}
- FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
if (tInputList.size() > 0) {
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
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 b3c0e8ce31..04922c0a03 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
@@ -38,7 +38,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
public String[] getDescription() {
return new String[]{
"Controller Block for the Large Boiler",
- "Produces "+(getEUt()*40)*(runtimeBoost(20)/20f)+"L of Steam with 1 Coal at "+getEUt()* 40+"L/s",
+ "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 Fire Boxes (Bottom layer, Min 3)",
@@ -94,27 +94,27 @@ public abstract class GT_MetaTileEntity_LargeBoiler
}
public boolean checkRecipe(ItemStack aStack) {
- //Do we have an integrated circuit with a valid configuration?
- if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
+ //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, overwrite the current config
- this.integratedCircuitConfig = circuit_config;
- }
+ this.integratedCircuitConfig = circuit_config;
+ }
} else {
- //If not, set the config to zero
- this.integratedCircuitConfig = 0;
+ //If not, set the config to zero
+ this.integratedCircuitConfig = 0;
}
-
- this.mSuperEfficencyIncrease=0;
+
+ this.mSuperEfficencyIncrease = 0;
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)) {
+ if (tFluid != null && tRecipe.mSpecialValue > 1) {
tFluid.amount = 1000;
if (depleteInput(tFluid)) {
this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(tRecipe.mSpecialValue / 2));
this.mEUt = adjustEUtForConfig(getEUt());
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
+ this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease() * 4;
return true;
}
}
@@ -126,7 +126,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
if (depleteInput(tFluid)) {