diff options
author | OneEyeMaker <oneeyemaker@gmail.com> | 2016-07-27 15:26:14 +0300 |
---|---|---|
committer | OneEyeMaker <oneeyemaker@gmail.com> | 2016-07-27 15:26:14 +0300 |
commit | be79f288a8e058677d09c40e11524282d27dc313 (patch) | |
tree | 57af31fbd16ec599f0bd4d65d35c07166fab6cf3 /src/main/java/gregtech/common/tileentities/machines | |
parent | 078a3bedde7d6cd0318e53792a5ca1c2338de407 (diff) | |
download | GT5-Unofficial-be79f288a8e058677d09c40e11524282d27dc313.tar.gz GT5-Unofficial-be79f288a8e058677d09c40e11524282d27dc313.tar.bz2 GT5-Unofficial-be79f288a8e058677d09c40e11524282d27dc313.zip |
Added code for Pyrolyse Oven to smoothly replace deprecated coils.
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 4e323439bb..e8b838256f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -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); + } + } + } + } } |