diff options
author | Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> | 2021-12-24 22:05:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-24 15:05:25 +0100 |
commit | 9b7d225b93fb15efc958786fb90c923b20d8752f (patch) | |
tree | 831c5d31af8d3ac9446ea006a8578dcf02972b92 /src/main/java/gregtech/common/blocks/GT_Block_Casings4.java | |
parent | b4068fcfbaae154a1f55b84b19a2c474bb7796ef (diff) | |
download | GT5-Unofficial-9b7d225b93fb15efc958786fb90c923b20d8752f.tar.gz GT5-Unofficial-9b7d225b93fb15efc958786fb90c923b20d8752f.tar.bz2 GT5-Unofficial-9b7d225b93fb15efc958786fb90c923b20d8752f.zip |
add more turbine texture (#835)
Diffstat (limited to 'src/main/java/gregtech/common/blocks/GT_Block_Casings4.java')
-rw-r--r-- | src/main/java/gregtech/common/blocks/GT_Block_Casings4.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index d217064d30..2bd94c6ccb 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -107,6 +107,7 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } + @Deprecated public IIcon getTurbineCasing(int meta, int iconIndex, boolean active) { switch (meta) { case 10: @@ -120,12 +121,27 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { } } + public IIcon getTurbineCasing(int meta, int iconIndex, boolean active, boolean hasTurbine) { + switch (meta) { + case 10: + return active ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE1[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY1[iconIndex].getIcon(); + case 11: + return active ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE2[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY2[iconIndex].getIcon(); + case 12: + return active ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE3[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY3[iconIndex].getIcon(); + default: + return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); + } + } + private static int isTurbineControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (!(tTileEntity instanceof IGregTechTileEntity)) return 0; IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity; - if (tTile.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine && tTile.getFrontFacing() == aSide) - return tTile.isActive() ? 1 : 2; + if (tTile.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine && tTile.getFrontFacing() == aSide) { + if (tTile.isActive()) return 1; + return ((GT_MetaTileEntity_LargeTurbine) tTile.getMetaTileEntity()).hasTurbine() ? 2 : 3; + } return 0; } @@ -146,7 +162,7 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { continue; int tState; if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide)) != 0) { - return getTurbineCasing(tMeta, 4 - i * 3 - j, tState == 1); + return getTurbineCasing(tMeta, 4 - i * 3 - j, tState == 1, tState == 2); } } } @@ -158,7 +174,7 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { continue; int tState; if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide)) != 0) { - return getTurbineCasing(tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1); + return getTurbineCasing(tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); } } } @@ -170,7 +186,7 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { continue; int tState; if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide)) != 0) { - return getTurbineCasing(tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1); + return getTurbineCasing(tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); } } } |