aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java
diff options
context:
space:
mode:
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.java44
1 files changed, 28 insertions, 16 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 5b1972b59e..023f97d5b1 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java
@@ -86,12 +86,12 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract {
}
@Override
- public IIcon getIcon(int aSide, int aMeta) {
+ public IIcon getIcon(int ordinalSide, int aMeta) {
return switch (aMeta) {
case 0, 12 -> Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
case 1, 10 -> Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon();
case 2, 11 -> Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
- case 3 -> aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon()
+ case 3 -> ordinalSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon()
: Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
case 4 ->
// Do not overwrite!
@@ -142,11 +142,11 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract {
};
}
- private static int isTurbineControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
+ private static int isTurbineControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int ordinalSide) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (!(tTileEntity instanceof IGregTechTileEntity tTile)) return 0;
- if (tTile.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine turbine
- && tTile.getFrontFacing() == aSide) {
+ if (tTile.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine turbine && tTile.getFrontFacing()
+ .ordinal() == ordinalSide) {
if (turbine.isNewStyleRendering()) return 0;
if (tTile.isActive()) return 1;
return turbine.hasTurbine() ? 2 : 3;
@@ -156,23 +156,27 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract {
@Override
@SideOnly(Side.CLIENT)
- public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
+ public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int ordinalSide) {
aWorld = GT_RenderingWorld.getInstance(aWorld);
int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
if (tMeta != 6 && tMeta != 8 && tMeta != 9 && tMeta != 10 && tMeta != 11 && tMeta != 12
|| !mConnectedMachineTextures) {
- return getIcon(aSide, tMeta);
+ return getIcon(ordinalSide, tMeta);
}
if (tMeta > 8 && tMeta < 13) {
- int tInvertLeftRightMod = aSide % 2 * 2 - 1;
- switch (aSide / 2) {
+ int tInvertLeftRightMod = ordinalSide % 2 * 2 - 1;
+ switch (ordinalSide / 2) {
case 0 -> {
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if (i == 0 && j == 0) continue;
int tState;
- if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide))
- != 0) {
+ if ((tState = isTurbineControllerWithSide(
+ aWorld,
+ xCoord + j,
+ yCoord,
+ zCoord + i,
+ ordinalSide)) != 0) {
return getTurbineCasing(tMeta, 4 - i * 3 - j, tState == 1, tState == 2);
}
}
@@ -183,8 +187,12 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract {
for (int j = -1; j < 2; j++) {
if (i == 0 && j == 0) continue;
int tState;
- if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide))
- != 0) {
+ if ((tState = isTurbineControllerWithSide(
+ aWorld,
+ xCoord + j,
+ yCoord + i,
+ zCoord,
+ ordinalSide)) != 0) {
return getTurbineCasing(
tMeta,
4 + i * 3 - j * tInvertLeftRightMod,
@@ -199,8 +207,12 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract {
for (int j = -1; j < 2; j++) {
if (i == 0 && j == 0) continue;
int tState;
- if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide))
- != 0) {
+ if ((tState = isTurbineControllerWithSide(
+ aWorld,
+ xCoord,
+ yCoord + i,
+ zCoord + j,
+ ordinalSide)) != 0) {
return getTurbineCasing(
tMeta,
4 + i * 3 + j * tInvertLeftRightMod,
@@ -226,7 +238,7 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract {
if (isSameBlock(aWorld, xCoord, yCoord, zCoord + 1, tMeta)) tIndexIntoMapping |= 1 << 3;
if (isSameBlock(aWorld, xCoord - 1, yCoord, zCoord, tMeta)) tIndexIntoMapping |= 1 << 4;
if (isSameBlock(aWorld, xCoord, yCoord, zCoord - 1, tMeta)) tIndexIntoMapping |= 1 << 5;
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + mapping[aSide][tIndexIntoMapping]].getIcon();
+ return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + mapping[ordinalSide][tIndexIntoMapping]].getIcon();
}
private boolean isSameBlock(IBlockAccess aWorld, int aX, int aY, int aZ, int aMeta) {