Merge pull request #584 from OneEyeMaker/SmoothTransition
More work on deprecated heating coils.
This commit is contained in:
commit
c8cca6390b
4 changed files with 83 additions and 4 deletions
|
@ -142,7 +142,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
|
|||
return false;
|
||||
}
|
||||
addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11);
|
||||
|
||||
replaceDeprecatedCoils(aBaseMetaTileEntity);
|
||||
byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
|
||||
switch (tUsedMeta) {
|
||||
case 0:
|
||||
|
@ -231,4 +231,26 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
|
|||
public boolean explodesOnComponentBreak(ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void replaceDeprecatedCoils(IGregTechTileEntity aBaseMetaTileEntity) {
|
||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||
int tX = aBaseMetaTileEntity.getXCoord() + xDir;
|
||||
int tY = (int) aBaseMetaTileEntity.getYCoord();
|
||||
int tZ = aBaseMetaTileEntity.getZCoord() + zDir;
|
||||
int tUsedMeta;
|
||||
for (int xPos = tX - 1; xPos <= tX + 1; xPos++) {
|
||||
for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) {
|
||||
if ((xPos == tX) && (zPos == tZ)) {
|
||||
continue;
|
||||
}
|
||||
for (int yPos = tY + 1; yPos <= tY + 2; yPos++) {
|
||||
tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos);
|
||||
if (tUsedMeta >= 12 && tUsedMeta <= 14 && aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) == GregTech_API.sBlockCasings1) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public class GT_MetaTileEntity_MultiFurnace
|
|||
return false;
|
||||
}
|
||||
addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 11);
|
||||
|
||||
replaceDeprecatedCoils(aBaseMetaTileEntity);
|
||||
byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
|
||||
switch (tUsedMeta) {
|
||||
case 0:
|
||||
|
@ -195,4 +195,24 @@ public class GT_MetaTileEntity_MultiFurnace
|
|||
public boolean explodesOnComponentBreak(ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void replaceDeprecatedCoils(IGregTechTileEntity aBaseMetaTileEntity) {
|
||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||
int tX = aBaseMetaTileEntity.getXCoord() + xDir;
|
||||
int tY = (int) aBaseMetaTileEntity.getYCoord();
|
||||
int tZ = aBaseMetaTileEntity.getZCoord() + zDir;
|
||||
int tUsedMeta;
|
||||
for (int xPos = tX - 1; xPos <= tX + 1; xPos++) {
|
||||
for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) {
|
||||
if ((xPos == tX) && (zPos == tZ)) {
|
||||
continue;
|
||||
}
|
||||
tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, tY + 1, zPos);
|
||||
if (tUsedMeta >= 12 && tUsedMeta <= 14 && aBaseMetaTileEntity.getBlock(xPos, tY + 1, zPos) == GregTech_API.sBlockCasings1) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,13 +113,13 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa
|
|||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||
int amount = 0;
|
||||
replaceDeprecatedCoils(aBaseMetaTileEntity);
|
||||
if (xDir != 0) {
|
||||
for (int i = -1; i < 2; i++) {// xDirection
|
||||
for (int j = -1; j < 2; j++) {// height
|
||||
for (int h = -2; h < 3; h++) {
|
||||
if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) {
|
||||
if (h == 1 || h == -1) {
|
||||
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir);
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings5) {
|
||||
return false;
|
||||
}
|
||||
|
@ -166,7 +166,6 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa
|
|||
for (int h = -2; h < 3; h++) {
|
||||
if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) {
|
||||
if (h == 1 || h == -1) {
|
||||
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir);
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings5) {
|
||||
return false;
|
||||
}
|
||||
|
@ -246,4 +245,25 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa
|
|||
return new GT_MetaTileEntity_OilCracker(this.mName);
|
||||
}
|
||||
|
||||
private void replaceDeprecatedCoils(IGregTechTileEntity aBaseMetaTileEntity) {
|
||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||
int tX = aBaseMetaTileEntity.getXCoord() + xDir;
|
||||
int tY = (int) aBaseMetaTileEntity.getYCoord();
|
||||
int tZ = aBaseMetaTileEntity.getZCoord() + zDir;
|
||||
for (int xPos = tX - 1; xPos <= tX + 1; xPos += (xDir != 0 ? 1 : 2)) {
|
||||
for (int yPos = tY - 1; yPos <= tY + 1; yPos++) {
|
||||
for (int zPos = tZ - 1; zPos <= tZ + 1; zPos += (xDir != 0 ? 2 : 1)) {
|
||||
if ((yPos == tY) && (xPos == tX || zPos == tZ)) {
|
||||
continue;
|
||||
}
|
||||
if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) == GregTech_API.sBlockCasings1 &&
|
||||
aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos) == 12)
|
||||
{
|
||||
aBaseMetaTileEntity.getWorld().setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, 0, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock
|
|||
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
|
||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
|
||||
replaceDeprecatedCoils(aBaseMetaTileEntity);
|
||||
for (int i = -2; i < 3; i++) {
|
||||
for (int j = -2; j < 3; j++) {
|
||||
for (int h = 0; h < 4; h++) {
|
||||
|
@ -186,4 +187,20 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock
|
|||
return new GT_MetaTileEntity_PyrolyseOven(this.mName);
|
||||
}
|
||||
|
||||
private void replaceDeprecatedCoils(IGregTechTileEntity aBaseMetaTileEntity) {
|
||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||
int tX = aBaseMetaTileEntity.getXCoord() + xDir * 2;
|
||||
int tY = (int) aBaseMetaTileEntity.getYCoord();
|
||||
int tZ = aBaseMetaTileEntity.getZCoord() + zDir * 2;
|
||||
for (int xPos = tX - 1; xPos <= tX + 1; xPos++) {
|
||||
for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) {
|
||||
if (aBaseMetaTileEntity.getBlock(xPos, tY, zPos) == GregTech_API.sBlockCasings1 &&
|
||||
aBaseMetaTileEntity.getMetaID(xPos, tY, zPos) == 13)
|
||||
{
|
||||
aBaseMetaTileEntity.getWorld().setBlock(xPos, tY, zPos, GregTech_API.sBlockCasings5, 1, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue