Simplified some control flow statements
This commit is contained in:
@@ -326,7 +326,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
public static boolean isLoading()
|
||||
{
|
||||
Boolean is = isLoading.get();
|
||||
return is != null && is == true;
|
||||
return is != null && is;
|
||||
}
|
||||
|
||||
public void addToWorld()
|
||||
|
||||
@@ -423,19 +423,19 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
{
|
||||
boolean Worked = false;
|
||||
|
||||
if ( Worked == false && side.offsetX == 0 && side.offsetZ == 0 )
|
||||
if ( side.offsetX == 0 && side.offsetZ == 0 )
|
||||
Worked = i.onItemUse( is, player, w, x + side.offsetX, y + side.offsetY, z + side.offsetZ, side.getOpposite().ordinal(),
|
||||
side.offsetX, side.offsetY, side.offsetZ );
|
||||
|
||||
if ( Worked == false && side.offsetX == 0 && side.offsetZ == 0 )
|
||||
if ( !Worked && side.offsetX == 0 && side.offsetZ == 0 )
|
||||
Worked = i.onItemUse( is, player, w, x - side.offsetX, y - side.offsetY, z - side.offsetZ, side.ordinal(), side.offsetX,
|
||||
side.offsetY, side.offsetZ );
|
||||
|
||||
if ( Worked == false && side.offsetY == 0 )
|
||||
if ( !Worked && side.offsetY == 0 )
|
||||
Worked = i.onItemUse( is, player, w, x, y - 1, z, ForgeDirection.UP.ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||
|
||||
if ( Worked == false )
|
||||
Worked = i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||
if ( !Worked )
|
||||
i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||
|
||||
maxStorage = maxStorage - is.stackSize;
|
||||
}
|
||||
|
||||
@@ -394,7 +394,6 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
bch.addBox( dist, 6.0, 6.0, 6.0, 10.0, 10.0 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -423,7 +422,6 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
bch.addBox( 0.0, 6.0, 6.0, 6.0, 10.0, 10.0 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -713,31 +711,28 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
if ( true )
|
||||
setSmartConnectionRotations( of, renderer );
|
||||
IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
|
||||
{
|
||||
setSmartConnectionRotations( of, renderer );
|
||||
IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
|
||||
{
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST );
|
||||
ico.setFlip( false, true );
|
||||
}
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
Tessellator.instance.setColorOpaque_I( myColor.blackVariant );
|
||||
rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
|
||||
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( myColor.whiteVariant );
|
||||
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
|
||||
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST );
|
||||
ico.setFlip( false, true );
|
||||
}
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
Tessellator.instance.setColorOpaque_I( myColor.blackVariant );
|
||||
rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
|
||||
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( myColor.whiteVariant );
|
||||
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
|
||||
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
|
||||
rh.setTexture( getTexture( getCableColor() ) );
|
||||
}
|
||||
|
||||
@@ -965,7 +960,6 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
renderer.setRenderBounds( 6 / 16.0, 6 / 16.0, 0, 10 / 16.0, 10 / 16.0, 16 / 16.0 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ public class PartCableCovered extends PartCable
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,7 +228,6 @@ public class PartCableCovered extends PartCable
|
||||
renderer.setRenderBounds( 5 / 16.0, 5 / 16.0, 0, 11 / 16.0, 11 / 16.0, 16 / 16.0 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,6 @@ public class PartCableSmart extends PartCable
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,6 @@ public class PartDenseCable extends PartCable
|
||||
bch.addBox( 0.0, min, min, min, max, max );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -195,7 +194,6 @@ public class PartDenseCable extends PartCable
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
|
||||
|
||||
data.writeByte( spin );
|
||||
data.writeBoolean( isLocked );
|
||||
data.writeBoolean( configuredItem != null ? true : false );
|
||||
data.writeBoolean( configuredItem != null );
|
||||
if ( configuredItem != null )
|
||||
configuredItem.writeToPacket( data );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user