From 4be835d27f4775987f2e04c01f231090f88bb441 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Wed, 29 Jan 2014 21:17:59 -0600 Subject: [PATCH] Fixed Cable Rendering Glitch. --- parts/networking/PartCable.java | 6 ++-- parts/networking/PartDenseCable.java | 49 ++++++++++++---------------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/parts/networking/PartCable.java b/parts/networking/PartCable.java index 60f043b6..572d6a5c 100644 --- a/parts/networking/PartCable.java +++ b/parts/networking/PartCable.java @@ -95,7 +95,8 @@ public class PartCable extends AEBasePart implements IPartCable return CableBusTextures.MECable_Yellow.getIcon(); default: } - return is.getIconIndex(); + return AEApi.instance().parts().partCableGlass.item( AEColor.Transparent ).getIconIndex( + AEApi.instance().parts().partCableGlass.stack( AEColor.Transparent, 1 ) ); } public Icon getTexture(AEColor c) @@ -141,7 +142,8 @@ public class PartCable extends AEBasePart implements IPartCable return CableBusTextures.MECovered_Yellow.getIcon(); default: } - return AEApi.instance().parts().partCableCovered.item( AEColor.Transparent ).getIconIndex( AEApi.instance().parts().partCableCovered.stack( AEColor.Transparent, 1 ) ); + return AEApi.instance().parts().partCableCovered.item( AEColor.Transparent ).getIconIndex( + AEApi.instance().parts().partCableCovered.stack( AEColor.Transparent, 1 ) ); } public Icon getSmartTexture(AEColor c) diff --git a/parts/networking/PartDenseCable.java b/parts/networking/PartDenseCable.java index 4fd72592..d8135ca2 100644 --- a/parts/networking/PartDenseCable.java +++ b/parts/networking/PartDenseCable.java @@ -192,40 +192,31 @@ public class PartDenseCable extends PartCable boolean isGlass = false; AEColor myColor = getCableColor(); /* - * ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) == - * AECableType.GLASS && ccph.getPart( of.getOpposite() ) == null ) { - * isGlass = true; rh.setTexture( getGlassTexture( myColor = - * ccph.getColor() ) ); } else if ( ccph == null && ghh != null && - * ghh.getCableConnectionType( of ) != AECableType.GLASS ) { - * rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: - * rh.setBounds( 3, 0, 3, 13, 4, 13 ); break; case EAST: rh.setBounds( - * 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13, - * 13, 4 ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); - * break; case UP: rh.setBounds( 3, 12, 3, 13, 16, 13 ); break; case - * WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } - * rh.renderBlock( x, y, z, renderer ); + * ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && ccph.getPart( + * of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = ccph.getColor() ) ); + * } else if ( ccph == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) { + * rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: rh.setBounds( 3, 0, 3, 13, 4, 13 ); + * break; case EAST: rh.setBounds( 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13, 13, 4 + * ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); break; case UP: rh.setBounds( 3, 12, 3, 13, 16, + * 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } rh.renderBlock( x, y, + * z, renderer ); * - * if ( true ) { setSmartConnectionRotations( of, renderer ); Icon defa - * = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f - * ); Icon defb = new TaughtIcon( getChannelTex( channels, true - * ).getIcon(), -0.2f ); + * if ( true ) { setSmartConnectionRotations( of, renderer ); Icon defa = new TaughtIcon( getChannelTex( + * channels, false ).getIcon(), -0.2f ); Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), + * -0.2f ); * - * if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { - * AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); FlipableIcon ico = - * blk.getRendererInstance().getTexture( ForgeDirection.EAST ); - * ico.setFlip( false, true ); } + * if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { AEBaseBlock blk = (AEBaseBlock) + * rh.getBlock(); FlipableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip( + * false, true ); } * - * Tessellator.instance.setBrightness( 15 << 20 | 15 << 5 ); - * Tessellator.instance.setColorOpaque_I( myColor.mediumVariant ); - * rh.setTexture( defa, defa, defa, defa, defa, defa ); renderAllFaces( - * (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); + * Tessellator.instance.setBrightness( 15 << 20 | 15 << 5 ); Tessellator.instance.setColorOpaque_I( + * myColor.mediumVariant ); rh.setTexture( defa, defa, defa, defa, defa, defa ); renderAllFaces( (AEBaseBlock) + * rh.getBlock(), x, y, z, renderer ); * - * Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); - * rh.setTexture( defb, defb, defb, defb, defb, defb ); renderAllFaces( - * (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); + * Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( defb, defb, defb, defb, defb, + * defb ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); * - * renderer.uvRotateBottom = renderer.uvRotateEast = - * renderer.uvRotateNorth = renderer.uvRotateSouth = + * renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = * renderer.uvRotateTop = renderer.uvRotateWest = 0; } * * rh.setTexture( getTexture( getCableColor() ) ); }