final variables and parameters
This commit is contained in:
@@ -75,7 +75,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
EnumSet<AEPartLocation> connections = EnumSet.noneOf( AEPartLocation.class );
|
||||
boolean powered = false;
|
||||
|
||||
public PartCable( ItemStack is )
|
||||
public PartCable( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.PREFERRED );
|
||||
@@ -102,7 +102,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean changeColor( AEColor newColor, EntityPlayer who )
|
||||
public boolean changeColor( final AEColor newColor, final EntityPlayer who )
|
||||
{
|
||||
if( this.getCableColor() != newColor )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
hasPermission = this.proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -155,13 +155,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
public void setValidSides(
|
||||
EnumSet<EnumFacing> sides )
|
||||
final EnumSet<EnumFacing> sides )
|
||||
{
|
||||
this.proxy.setValidSides( sides );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected( EnumFacing side )
|
||||
public boolean isConnected( final EnumFacing side )
|
||||
{
|
||||
return this.connections.contains( AEPartLocation.fromFacing( side ) );
|
||||
}
|
||||
@@ -172,13 +172,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 6.0, 6.0, 6.0, 10.0, 10.0, 10.0 );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -189,15 +189,15 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
IPartHost ph = this.getHost();
|
||||
final IPartHost ph = this.getHost();
|
||||
if( ph != null )
|
||||
{
|
||||
for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart p = ph.getPart( dir );
|
||||
final IPart p = ph.getPart( dir );
|
||||
if( p instanceof IGridHost )
|
||||
{
|
||||
double dist = p.cableConnectionRenderTo();
|
||||
final double dist = p.cableConnectionRenderTo();
|
||||
|
||||
if( dist > 8 )
|
||||
{
|
||||
@@ -230,7 +230,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -259,7 +259,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -269,12 +269,12 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
public IAESprite getTexture( AEColor c,ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
return this.getGlassTexture( c,renderer );
|
||||
}
|
||||
|
||||
public IAESprite getGlassTexture( AEColor c,ModelGenerator renderer )
|
||||
public IAESprite getGlassTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -327,18 +327,18 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
boolean useCovered = false;
|
||||
boolean requireDetailed = false;
|
||||
|
||||
for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart p = this.getHost().getPart( dir );
|
||||
final IPart p = this.getHost().getPart( dir );
|
||||
if( p instanceof IGridHost )
|
||||
{
|
||||
IGridHost igh = (IGridHost) p;
|
||||
AECableType type = igh.getCableConnectionType( dir.getOpposite() );
|
||||
final IGridHost igh = (IGridHost) p;
|
||||
final AECableType type = igh.getCableConnectionType( dir.getOpposite() );
|
||||
if( type == AECableType.COVERED || type == AECableType.SMART )
|
||||
{
|
||||
useCovered = true;
|
||||
@@ -347,9 +347,9 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
else if( this.connections.contains( dir ) )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( dir.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( dir.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
if( partHost == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS )
|
||||
{
|
||||
requireDetailed = true;
|
||||
@@ -366,13 +366,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.setTexture( this.getTexture( this.getCableColor(),renderer ) );
|
||||
}
|
||||
|
||||
IPartHost ph = this.getHost();
|
||||
for( AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
{
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
final int len = bp.cableConnectionRenderTo();
|
||||
if( len < 8 )
|
||||
{
|
||||
switch( of )
|
||||
@@ -416,17 +416,17 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
this.renderGlassConnection( pos, rh, renderer, of );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
rh.setTexture( def );
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing(), of.getFacing().getOpposite() ) ) );
|
||||
switch( of )
|
||||
@@ -458,18 +458,18 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode node = this.getGridNode();
|
||||
final IGridNode node = this.getGridNode();
|
||||
|
||||
if( node != null )
|
||||
{
|
||||
int howMany = 0;
|
||||
for( IGridConnection gc : node.getConnections() )
|
||||
for( final IGridConnection gc : node.getConnections() )
|
||||
{
|
||||
howMany = Math.max( gc.getUsedChannels(), howMany );
|
||||
}
|
||||
@@ -480,23 +480,23 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
int cs = 0;
|
||||
int sideOut = 0;
|
||||
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
for( AEPartLocation thisSide : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation thisSide : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart part = this.getHost().getPart( thisSide );
|
||||
final IPart part = this.getHost().getPart( thisSide );
|
||||
if( part != null )
|
||||
{
|
||||
if( part.getGridNode() != null )
|
||||
{
|
||||
IReadOnlyCollection<IGridConnection> set = part.getGridNode().getConnections();
|
||||
for( IGridConnection gc : set )
|
||||
final IReadOnlyCollection<IGridConnection> set = part.getGridNode().getConnections();
|
||||
for( final IGridConnection gc : set )
|
||||
{
|
||||
if( this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) )
|
||||
{
|
||||
@@ -511,13 +511,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( IGridConnection gc : n.getConnections() )
|
||||
for( final IGridConnection gc : n.getConnections() )
|
||||
{
|
||||
AEPartLocation side = gc.getDirection( n );
|
||||
final AEPartLocation side = gc.getDirection( n );
|
||||
if( side != AEPartLocation.INTERNAL )
|
||||
{
|
||||
boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
final boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
final boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
|
||||
if( isTier2a && isTier2b )
|
||||
{
|
||||
@@ -539,7 +539,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
cs |= ( 1 << AEPartLocation.INTERNAL.ordinal() );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// aww...
|
||||
}
|
||||
@@ -549,21 +549,21 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
int cs = data.readByte();
|
||||
int sideOut = data.readInt();
|
||||
final int cs = data.readByte();
|
||||
final int sideOut = data.readInt();
|
||||
|
||||
EnumSet<AEPartLocation> myC = this.connections.clone();
|
||||
boolean wasPowered = this.powered;
|
||||
final EnumSet<AEPartLocation> myC = this.connections.clone();
|
||||
final boolean wasPowered = this.powered;
|
||||
this.powered = false;
|
||||
boolean channelsChanged = false;
|
||||
|
||||
for( AEPartLocation d : AEPartLocation.values() )
|
||||
for( final AEPartLocation d : AEPartLocation.values() )
|
||||
{
|
||||
if( d != AEPartLocation.INTERNAL )
|
||||
{
|
||||
int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF;
|
||||
final int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF;
|
||||
if( ch != this.channelsOnSide[d.ordinal()] )
|
||||
{
|
||||
channelsChanged = true;
|
||||
@@ -573,7 +573,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
if( d == AEPartLocation.INTERNAL )
|
||||
{
|
||||
int id = 1 << d.ordinal();
|
||||
final int id = 1 << d.ordinal();
|
||||
if( id == ( cs & id ) )
|
||||
{
|
||||
this.powered = true;
|
||||
@@ -581,7 +581,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
else
|
||||
{
|
||||
int id = 1 << d.ordinal();
|
||||
final int id = 1 << d.ordinal();
|
||||
if( id == ( cs & id ) )
|
||||
{
|
||||
this.connections.add( d );
|
||||
@@ -598,12 +598,12 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return this.getTexture( this.getCableColor(), renderer ).getAtlas();
|
||||
}
|
||||
|
||||
public IAESprite getCoveredTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getCoveredTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -648,17 +648,17 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
return renderer.getIcon( coveredCableStack );
|
||||
}
|
||||
|
||||
protected boolean nonLinear( EnumSet<AEPartLocation> sides )
|
||||
protected boolean nonLinear( final EnumSet<AEPartLocation> sides )
|
||||
{
|
||||
return ( sides.contains( AEPartLocation.EAST ) && sides.contains( AEPartLocation.WEST ) ) || ( sides.contains( AEPartLocation.NORTH ) && sides.contains( AEPartLocation.SOUTH ) ) || ( sides.contains( AEPartLocation.UP ) && sides.contains( AEPartLocation.DOWN ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderGlassConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, AEPartLocation of )
|
||||
public void renderGlassConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) );
|
||||
|
||||
@@ -730,11 +730,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderCoveredConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of )
|
||||
public void renderCoveredConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) );
|
||||
if( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null && partHost.getColor() != AEColor.Transparent )
|
||||
@@ -811,11 +811,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderSmartConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of )
|
||||
public void renderSmartConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
AEColor myColor = this.getCableColor();
|
||||
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) );
|
||||
@@ -855,13 +855,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
if( of == AEPartLocation.EAST || of == AEPartLocation.WEST )
|
||||
{
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
}
|
||||
|
||||
@@ -919,8 +919,8 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
renderer.setColorOpaque_I( myColor.blackVariant );
|
||||
@@ -935,7 +935,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
public IAESprite getSmartTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getSmartTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -981,7 +981,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
protected void setSmartConnectionRotations( AEPartLocation of, ModelGenerator renderer )
|
||||
protected void setSmartConnectionRotations( final AEPartLocation of, final ModelGenerator renderer )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -1014,7 +1014,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
protected CableBusTextures getChannelTex( int i, boolean b )
|
||||
protected CableBusTextures getChannelTex( int i, final boolean b )
|
||||
{
|
||||
if( !this.powered )
|
||||
{
|
||||
@@ -1056,7 +1056,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
protected void renderAllFaces( AEBaseBlock blk, BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
protected void renderAllFaces( final AEBaseBlock blk, final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setBounds( (float) renderer.renderMinX * 16.0f, (float) renderer.renderMinY * 16.0f, (float) renderer.renderMinZ * 16.0f, (float) renderer.renderMaxX * 16.0f, (float) renderer.renderMaxY * 16.0f, (float) renderer.renderMaxZ * 16.0f );
|
||||
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.WEST ), EnumFacing.WEST, renderer );
|
||||
|
||||
@@ -51,19 +51,19 @@ import appeng.util.Platform;
|
||||
public class PartCableCovered extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableCovered( ItemStack is )
|
||||
public PartCableCovered( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
public void channelUpdated( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
@@ -75,13 +75,13 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -92,7 +92,7 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -121,7 +121,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -131,7 +131,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
@@ -140,14 +140,14 @@ public class PartCableCovered extends PartCable
|
||||
offV = 0;
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), 0, 0 );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
@@ -156,24 +156,24 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAESprite getTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
return this.getCoveredTexture( c, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
IPartHost ph = this.getHost();
|
||||
for( AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
{
|
||||
if( of != AEPartLocation.INTERNAL )
|
||||
@@ -182,7 +182,7 @@ public class PartCableCovered extends PartCable
|
||||
hasBuses = true;
|
||||
}
|
||||
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
final int len = bp.cableConnectionRenderTo();
|
||||
if( len < 8 )
|
||||
{
|
||||
switch( of )
|
||||
@@ -215,7 +215,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
this.renderCoveredConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
@@ -226,9 +226,9 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
else
|
||||
{
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
for( AEPartLocation of : this.connections )
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ import appeng.helpers.Reflected;
|
||||
public class PartCableGlass extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableGlass( ItemStack is )
|
||||
public PartCableGlass( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@@ -54,19 +54,19 @@ import appeng.util.Platform;
|
||||
public class PartCableSmart extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableSmart( ItemStack is )
|
||||
public PartCableSmart( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
public void channelUpdated( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
@@ -78,13 +78,13 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -95,7 +95,7 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -124,7 +124,7 @@ public class PartCableSmart extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -135,7 +135,7 @@ public class PartCableSmart extends PartCable
|
||||
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -149,7 +149,7 @@ public class PartCableSmart extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -161,7 +161,7 @@ public class PartCableSmart extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -173,24 +173,24 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAESprite getTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
return this.getSmartTexture( c, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
IPartHost ph = this.getHost();
|
||||
for( AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
{
|
||||
if( of != AEPartLocation.INTERNAL )
|
||||
@@ -199,7 +199,7 @@ public class PartCableSmart extends PartCable
|
||||
hasBuses = true;
|
||||
}
|
||||
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
final int len = bp.cableConnectionRenderTo();
|
||||
if( len < 8 )
|
||||
{
|
||||
switch( of )
|
||||
@@ -228,13 +228,13 @@ public class PartCableSmart extends PartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
|
||||
|
||||
if( of == AEPartLocation.EAST || of == AEPartLocation.WEST )
|
||||
{
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public class PartCableSmart extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
this.renderSmartConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
@@ -269,21 +269,21 @@ public class PartCableSmart extends PartCable
|
||||
{
|
||||
AEPartLocation selectedSide = AEPartLocation.INTERNAL;
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
final int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
IAESprite firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 );
|
||||
final IAESprite firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 );
|
||||
|
||||
IAESprite secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
IAESprite secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 );
|
||||
final IAESprite secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 );
|
||||
|
||||
switch( selectedSide )
|
||||
{
|
||||
@@ -318,8 +318,8 @@ public class PartCableSmart extends PartCable
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
|
||||
renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 );
|
||||
|
||||
@@ -58,7 +58,7 @@ import appeng.util.Platform;
|
||||
public class PartDenseCable extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartDenseCable( ItemStack is )
|
||||
public PartDenseCable( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -78,17 +78,17 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
boolean noLadder = !bch.isBBCollision();
|
||||
double min = noLadder ? 3.0 : 4.9;
|
||||
double max = noLadder ? 13.0 : 11.1;
|
||||
final boolean noLadder = !bch.isBBCollision();
|
||||
final double min = noLadder ? 3.0 : 4.9;
|
||||
final double max = noLadder ? 13.0 : 11.1;
|
||||
|
||||
bch.addBox( min, min, min, max, max, max );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -99,7 +99,7 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
if( this.isDense( of ) )
|
||||
{
|
||||
@@ -156,7 +156,7 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
rh.setBounds( 4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f );
|
||||
@@ -168,7 +168,7 @@ public class PartDenseCable extends PartCable
|
||||
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
@@ -181,7 +181,7 @@ public class PartDenseCable extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
@@ -192,7 +192,7 @@ public class PartDenseCable extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
@@ -203,7 +203,7 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAESprite getTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
if( c == AEColor.Transparent )
|
||||
{
|
||||
@@ -215,14 +215,14 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
if( !this.isDense( of ) )
|
||||
{
|
||||
@@ -232,7 +232,7 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
if( this.isDense( of ) )
|
||||
{
|
||||
@@ -256,21 +256,21 @@ public class PartDenseCable extends PartCable
|
||||
{
|
||||
AEPartLocation selectedSide = AEPartLocation.INTERNAL;
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
final int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite firstOffset = new OffsetIcon( firstIcon, 0, -12 );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite firstOffset = new OffsetIcon( firstIcon, 0, -12 );
|
||||
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
IAESprite secondOffset = new OffsetIcon( secondIcon, 0, -12 );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite secondOffset = new OffsetIcon( secondIcon, 0, -12 );
|
||||
|
||||
switch( selectedSide )
|
||||
{
|
||||
@@ -305,8 +305,8 @@ public class PartDenseCable extends PartCable
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
|
||||
renderer.setRenderBounds( 0, 3 / 16.0, 3 / 16.0, 16 / 16.0, 13 / 16.0, 13 / 16.0 );
|
||||
@@ -314,8 +314,8 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
FlippableIcon fpA = new FlippableIcon( firstIcon );
|
||||
FlippableIcon fpB = new FlippableIcon( secondIcon );
|
||||
final FlippableIcon fpA = new FlippableIcon( firstIcon );
|
||||
final FlippableIcon fpB = new FlippableIcon( secondIcon );
|
||||
|
||||
fpA.setFlip( true, false );
|
||||
fpB.setFlip( true, false );
|
||||
@@ -359,11 +359,11 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDenseConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of )
|
||||
public void renderDenseConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
AEColor myColor = this.getCableColor();
|
||||
/*
|
||||
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart(
|
||||
@@ -433,13 +433,13 @@ public class PartDenseCable extends PartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setFacesToRender( EnumSet.allOf( EnumFacing.class ) );
|
||||
boolean isGlass = false;
|
||||
final boolean isGlass = false;
|
||||
if( !isGlass )
|
||||
{
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
renderer.setColorOpaque_I( myColor.blackVariant );
|
||||
@@ -454,18 +454,18 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSmart( AEPartLocation of )
|
||||
private boolean isSmart( final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.SMART;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private IAESprite getDenseTexture( AEColor c, ModelGenerator renderer )
|
||||
private IAESprite getDenseTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -507,25 +507,25 @@ public class PartDenseCable extends PartCable
|
||||
return renderer.getIcon( is );
|
||||
}
|
||||
|
||||
private boolean isDense( AEPartLocation of )
|
||||
private boolean isDense( final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.DENSE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
public void channelUpdated( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true );
|
||||
|
||||
public PartQuartzFiber( ItemStack is )
|
||||
public PartQuartzFiber( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setIdlePowerUsage( 0 );
|
||||
@@ -64,20 +64,20 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.GLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 6, 6, 10, 10, 10, 16 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.2, -0.3, 0.0 );
|
||||
|
||||
@@ -89,9 +89,9 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
IAESprite myIcon = renderer.getIcon( is );
|
||||
final IAESprite myIcon = renderer.getIcon( is );
|
||||
rh.setTexture( myIcon );
|
||||
rh.setBounds( 6, 6, 10, 10, 10, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -99,14 +99,14 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound extra )
|
||||
public void readFromNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.outerProxy.readFromNBT( extra );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound extra )
|
||||
public void writeToNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.outerProxy.writeToNBT( extra );
|
||||
@@ -127,7 +127,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
super.setPartHostInfo( side, host, tile );
|
||||
this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) );
|
||||
@@ -146,33 +146,33 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
this.outerProxy.setOwner( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen )
|
||||
public double extractAEPower( final double amt, final Actionable mode, final Set<IEnergyGrid> seen )
|
||||
{
|
||||
double acquiredPower = 0;
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
final IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -181,31 +181,31 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen )
|
||||
public double injectAEPower( final double amt, final Actionable mode, final Set<IEnergyGrid> seen )
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
if( !seen.contains( eg ) )
|
||||
{
|
||||
return eg.injectAEPower( amt, mode, seen );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
final IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
if( !seen.contains( eg ) )
|
||||
{
|
||||
return eg.injectAEPower( amt, mode, seen );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -214,26 +214,26 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEnergyDemand( double amt, Set<IEnergyGrid> seen )
|
||||
public double getEnergyDemand( final double amt, final Set<IEnergyGrid> seen )
|
||||
{
|
||||
double demand = 0;
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
demand += eg.getEnergyDemand( amt - demand, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
final IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
demand += eg.getEnergyDemand( amt - demand, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user