Changed the Distillation Tower so that any height from 3 to 12 is
considered valid.
This commit is contained in:
parent
359e7e5905
commit
6bcdc3d157
1 changed files with 55 additions and 55 deletions
|
@ -23,6 +23,7 @@ import java.util.Arrays;
|
||||||
|
|
||||||
public class GT_MetaTileEntity_DistillationTower
|
public class GT_MetaTileEntity_DistillationTower
|
||||||
extends GT_MetaTileEntity_MultiBlockBase {
|
extends GT_MetaTileEntity_MultiBlockBase {
|
||||||
|
private static final int CASING_INDEX = 49;
|
||||||
private static boolean controller;
|
private static boolean controller;
|
||||||
|
|
||||||
public GT_MetaTileEntity_DistillationTower(int aID, String aName, String aNameRegional) {
|
public GT_MetaTileEntity_DistillationTower(int aID, String aName, String aNameRegional) {
|
||||||
|
@ -51,9 +52,9 @@ public class GT_MetaTileEntity_DistillationTower
|
||||||
|
|
||||||
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
|
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
|
||||||
if (aSide == aFacing) {
|
if (aSide == aFacing) {
|
||||||
return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)};
|
return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)};
|
||||||
}
|
}
|
||||||
return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49]};
|
return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX]};
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
|
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
|
||||||
|
@ -129,60 +130,59 @@ public class GT_MetaTileEntity_DistillationTower
|
||||||
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
|
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
|
||||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||||
if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
|
int y = 0; //height
|
||||||
return false;
|
int casingAmount = 0;
|
||||||
}
|
boolean reachedTop = false;
|
||||||
int tAmount = 0;
|
|
||||||
controller = false;
|
for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width
|
||||||
for (int i = -1; i < 2; i++) {
|
for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth
|
||||||
for (int j = -1; j < 2; j++) {
|
if (x != 0 || z != 0) {
|
||||||
for (int h = 0; h < 6; h++) {
|
IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z);
|
||||||
if (!(i == 0 && j == 0 && (h > 0 && h < 5)))//((h > 0)&&(h<5)) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))
|
Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z);
|
||||||
{
|
if (!addInputToMachineList(tileEntity, CASING_INDEX)
|
||||||
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
|
&& !addOutputToMachineList(tileEntity, CASING_INDEX)
|
||||||
if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) && (!addOutputToMachineList(tTileEntity, 49)) && (!addEnergyInputToMachineList(tTileEntity, 49)) && (!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)))) {
|
&& !addMaintenanceToMachineList(tileEntity, CASING_INDEX)
|
||||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
|
&& !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) {
|
||||||
return false;
|
if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) {
|
||||||
}
|
casingAmount++;
|
||||||
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
tAmount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.mOutputBusses.size() != 1 || this.mInputBusses.size() != 0 || this.mOutputHatches.size() != 5) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
int height = this.getBaseMetaTileEntity().getYCoord();
|
|
||||||
if (this.mInputHatches.get(0).getBaseMetaTileEntity().getYCoord() != height || this.mOutputBusses.get(0).getBaseMetaTileEntity().getYCoord() != height) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
GT_MetaTileEntity_Hatch_Output[] tmpHatches = new GT_MetaTileEntity_Hatch_Output[5];
|
|
||||||
int mOutputHatches_sS=this.mOutputHatches.size();
|
|
||||||
for (int i = 0; i < mOutputHatches_sS; i++) {
|
|
||||||
int hatchNumber = this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height;
|
|
||||||
if (tmpHatches[hatchNumber] == null) {
|
|
||||||
tmpHatches[hatchNumber] = this.mOutputHatches.get(i);
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.mOutputHatches.clear();
|
|
||||||
for (int i = 0; i < tmpHatches.length; i++) {
|
|
||||||
this.mOutputHatches.add(tmpHatches[i]);
|
|
||||||
}
|
}
|
||||||
if(this.mMaintenanceHatches.size()!=1)return false;
|
}
|
||||||
return tAmount >= 36;
|
}
|
||||||
|
y++;
|
||||||
|
|
||||||
|
while (y < 12 && !reachedTop) {
|
||||||
|
for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width
|
||||||
|
for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth
|
||||||
|
IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z);
|
||||||
|
Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z);
|
||||||
|
if (aBaseMetaTileEntity.getAirOffset(x, y, z)) {
|
||||||
|
if (x != xDir || z != zDir) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (x == xDir && z == zDir) {
|
||||||
|
reachedTop = true;
|
||||||
|
}
|
||||||
|
if (!addOutputToMachineList(tileEntity, CASING_INDEX)
|
||||||
|
&& !addMaintenanceToMachineList(tileEntity, CASING_INDEX)
|
||||||
|
&& !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) {
|
||||||
|
if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) {
|
||||||
|
casingAmount++;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
y++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean ignoreController(Block tTileEntity) {
|
return casingAmount >= 7 * y - 5 && y >= 3 && y <= 12 && reachedTop;
|
||||||
if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxEfficiency(ItemStack aStack) {
|
public int getMaxEfficiency(ItemStack aStack) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue