Fixes #675 No disabled feature should log spam or crash anymore.
Deprecates the old usage of the AEItemDefinitions via the direct method access of * blocks() * parts() * items() * materials() and thus use the new re-direct via definitions(). All definitions are now initialized, no matter what. But SubItems, Items and Blocks are not registered, if by chance are disabled.
This commit is contained in:
@@ -40,6 +40,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.implementations.parts.IPartCable;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
@@ -52,6 +53,7 @@ import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.IPartRenderHelper;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEColoredItemDefinition;
|
||||
import appeng.api.util.IReadOnlyCollection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
@@ -72,9 +74,9 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
EnumSet<ForgeDirection> connections = EnumSet.noneOf( ForgeDirection.class );
|
||||
boolean powered = false;
|
||||
|
||||
public PartCable( Class c, ItemStack is )
|
||||
public PartCable( ItemStack is )
|
||||
{
|
||||
super( c, is );
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.PREFERRED );
|
||||
this.proxy.setIdlePowerUsage( 0.0 );
|
||||
this.proxy.myColor = AEColor.values()[( ( ItemMultiPart ) is.getItem() ).variantOf( is.getItemDamage() )];
|
||||
@@ -130,8 +132,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
return CableBusTextures.MECable_Yellow.getIcon();
|
||||
default:
|
||||
}
|
||||
return AEApi.instance().parts().partCableGlass.item( AEColor.Transparent ).getIconIndex(
|
||||
AEApi.instance().parts().partCableGlass.stack( AEColor.Transparent, 1 ) );
|
||||
|
||||
final AEColoredItemDefinition glassCable = AEApi.instance().definitions().parts().cableGlass();
|
||||
final ItemStack glassCableStack = glassCable.stack( AEColor.Transparent, 1 );
|
||||
|
||||
return glassCable.item( AEColor.Transparent ).getIconIndex( glassCableStack );
|
||||
}
|
||||
|
||||
public IIcon getTexture( AEColor c )
|
||||
@@ -177,8 +182,11 @@ 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 ) );
|
||||
|
||||
final AEColoredItemDefinition coveredCable = AEApi.instance().definitions().parts().cableCovered();
|
||||
final ItemStack coveredCableStack = coveredCable.stack( AEColor.Transparent, 1 );
|
||||
|
||||
return coveredCable.item( AEColor.Transparent ).getIconIndex( coveredCableStack );
|
||||
}
|
||||
|
||||
public IIcon getSmartTexture( AEColor c )
|
||||
@@ -219,8 +227,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
return CableBusTextures.MESmart_Yellow.getIcon();
|
||||
default:
|
||||
}
|
||||
return AEApi.instance().parts().partCableCovered.item( AEColor.Transparent ).getIconIndex(
|
||||
AEApi.instance().parts().partCableSmart.stack( AEColor.Transparent, 1 ) );
|
||||
|
||||
final IParts parts = AEApi.instance().definitions().parts();
|
||||
final ItemStack smartCableStack = parts.cableSmart().stack( AEColor.Transparent, 1 );
|
||||
|
||||
return parts.cableCovered().item( AEColor.Transparent ).getIconIndex( smartCableStack );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1009,21 +1020,23 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
ItemStack newPart = null;
|
||||
|
||||
final IParts parts = AEApi.instance().definitions().parts();
|
||||
|
||||
if ( this.getCableConnectionType() == AECableType.GLASS )
|
||||
{
|
||||
newPart = AEApi.instance().parts().partCableGlass.stack( newColor, 1 );
|
||||
newPart = parts.cableGlass().stack( newColor, 1 );
|
||||
}
|
||||
else if ( this.getCableConnectionType() == AECableType.COVERED )
|
||||
{
|
||||
newPart = AEApi.instance().parts().partCableCovered.stack( newColor, 1 );
|
||||
newPart = parts.cableCovered().stack( newColor, 1 );
|
||||
}
|
||||
else if ( this.getCableConnectionType() == AECableType.SMART )
|
||||
{
|
||||
newPart = AEApi.instance().parts().partCableSmart.stack( newColor, 1 );
|
||||
newPart = parts.cableSmart().stack( newColor, 1 );
|
||||
}
|
||||
else if ( this.getCableConnectionType() == AECableType.DENSE )
|
||||
{
|
||||
newPart = AEApi.instance().parts().partCableDense.stack( newColor, 1 );
|
||||
newPart = parts.cableDense().stack( newColor, 1 );
|
||||
}
|
||||
|
||||
boolean hasPermission = true;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.parts.networking;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -42,33 +43,32 @@ import appeng.api.parts.IPartRenderHelper;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.client.texture.OffsetIcon;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class PartCableCovered extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableCovered( ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated(MENetworkChannelsChanged c)
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender(MENetworkPowerStatusChange c)
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
public PartCableCovered(Class c, ItemStack is) {
|
||||
super( c, is );
|
||||
}
|
||||
|
||||
public PartCableCovered(ItemStack is) {
|
||||
this( PartCableCovered.class, is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTexture(AEColor c)
|
||||
public IIcon getTexture( AEColor c )
|
||||
{
|
||||
return this.getCoveredTexture( c );
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes(IPartCollisionHelper bch)
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 );
|
||||
|
||||
@@ -93,36 +93,36 @@ public class PartCableCovered extends PartCable
|
||||
this.connections.clear();
|
||||
}
|
||||
|
||||
for (ForgeDirection of : this.connections)
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
bch.addBox( 5.0, 0.0, 5.0, 11.0, 5.0, 11.0 );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( 11.0, 5.0, 5.0, 16.0, 11.0, 11.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( 5.0, 5.0, 0.0, 11.0, 11.0, 5.0 );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( 5.0, 5.0, 11.0, 11.0, 11.0, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( 5.0, 11.0, 5.0, 11.0, 16.0, 11.0 );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
case DOWN:
|
||||
bch.addBox( 5.0, 0.0, 5.0, 11.0, 5.0, 11.0 );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( 11.0, 5.0, 5.0, 16.0, 11.0, 11.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( 5.0, 5.0, 0.0, 11.0, 11.0, 5.0 );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( 5.0, 5.0, 11.0, 11.0, 11.0, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( 5.0, 11.0, 5.0, 11.0, 16.0, 11.0 );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -132,7 +132,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
|
||||
|
||||
for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ))
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
@@ -141,14 +141,14 @@ public class PartCableCovered extends PartCable
|
||||
offV = 0;
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
|
||||
|
||||
for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ))
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 );
|
||||
|
||||
for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ))
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
@@ -157,8 +157,8 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( this.getTexture( this.getCableColor() ) );
|
||||
@@ -167,7 +167,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
boolean hasBuses = false;
|
||||
IPartHost ph = this.getHost();
|
||||
for (ForgeDirection of : EnumSet.complementOf( this.connections ))
|
||||
for ( ForgeDirection of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
if ( bp instanceof IGridHost )
|
||||
@@ -181,28 +181,28 @@ public class PartCableCovered extends PartCable
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
if ( len < 8 )
|
||||
{
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
rh.setBounds( 6, len, 6, 10, 5, 10 );
|
||||
break;
|
||||
case EAST:
|
||||
rh.setBounds( 11, 6, 6, 16 - len, 10, 10 );
|
||||
break;
|
||||
case NORTH:
|
||||
rh.setBounds( 6, 6, len, 10, 10, 5 );
|
||||
break;
|
||||
case SOUTH:
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 16 - len );
|
||||
break;
|
||||
case UP:
|
||||
rh.setBounds( 6, 11, 6, 10, 16 - len, 10 );
|
||||
break;
|
||||
case WEST:
|
||||
rh.setBounds( len, 6, 6, 5, 10, 10 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
case DOWN:
|
||||
rh.setBounds( 6, len, 6, 10, 5, 10 );
|
||||
break;
|
||||
case EAST:
|
||||
rh.setBounds( 11, 6, 6, 16 - len, 10, 10 );
|
||||
break;
|
||||
case NORTH:
|
||||
rh.setBounds( 6, 6, len, 10, 10, 5 );
|
||||
break;
|
||||
case SOUTH:
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 16 - len );
|
||||
break;
|
||||
case UP:
|
||||
rh.setBounds( 6, 11, 6, 10, 16 - len, 10 );
|
||||
break;
|
||||
case WEST:
|
||||
rh.setBounds( len, 6, 6, 5, 10, 10 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
}
|
||||
@@ -211,7 +211,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for (ForgeDirection of : this.connections)
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
@@ -224,29 +224,29 @@ public class PartCableCovered extends PartCable
|
||||
{
|
||||
IIcon def = this.getTexture( this.getCableColor() );
|
||||
IIcon off = new OffsetIcon( def, 0, -12 );
|
||||
for (ForgeDirection of : this.connections)
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
renderer.setRenderBounds( 5 / 16.0, 0, 5 / 16.0, 11 / 16.0, 16 / 16.0, 11 / 16.0 );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = renderer.uvRotateTop = 1;
|
||||
renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateNorth = renderer.uvRotateSouth = 1;
|
||||
renderer.setRenderBounds( 5 / 16.0, 5 / 16.0, 0, 11 / 16.0, 11 / 16.0, 16 / 16.0 );
|
||||
break;
|
||||
default:
|
||||
case DOWN:
|
||||
case UP:
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
renderer.setRenderBounds( 5 / 16.0, 0, 5 / 16.0, 11 / 16.0, 16 / 16.0, 11 / 16.0 );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = renderer.uvRotateTop = 1;
|
||||
renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateNorth = renderer.uvRotateSouth = 1;
|
||||
renderer.setRenderBounds( 5 / 16.0, 5 / 16.0, 0, 11 / 16.0, 11 / 16.0, 16 / 16.0 );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,5 +256,4 @@ public class PartCableCovered extends PartCable
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
|
||||
package appeng.parts.networking;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.helpers.Reflected;
|
||||
|
||||
|
||||
public class PartCableGlass extends PartCable
|
||||
{
|
||||
|
||||
public PartCableGlass(Class c, ItemStack is) {
|
||||
super( c, is );
|
||||
@Reflected
|
||||
public PartCableGlass( ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
public PartCableGlass(ItemStack is) {
|
||||
this( PartCableGlass.class, is );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.parts.networking;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -46,31 +47,30 @@ import appeng.block.AEBaseBlock;
|
||||
import appeng.client.texture.FlippableIcon;
|
||||
import appeng.client.texture.OffsetIcon;
|
||||
import appeng.client.texture.TaughtIcon;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class PartCableSmart extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableSmart( ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated(MENetworkChannelsChanged c)
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender(MENetworkPowerStatusChange c)
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
public PartCableSmart(Class c, ItemStack is) {
|
||||
super( c, is );
|
||||
}
|
||||
|
||||
public PartCableSmart(ItemStack is) {
|
||||
this( PartCableSmart.class, is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType()
|
||||
{
|
||||
@@ -78,14 +78,14 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTexture(AEColor c)
|
||||
public IIcon getTexture( AEColor c )
|
||||
{
|
||||
return this.getSmartTexture( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -96,7 +96,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 (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ))
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -110,7 +110,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 (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ))
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -122,7 +122,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 (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ))
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -134,7 +134,7 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes(IPartCollisionHelper bch)
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 );
|
||||
|
||||
@@ -147,36 +147,36 @@ public class PartCableSmart extends PartCable
|
||||
this.connections.clear();
|
||||
}
|
||||
|
||||
for (ForgeDirection of : this.connections)
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
bch.addBox( 5.0, 0.0, 5.0, 11.0, 5.0, 11.0 );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( 11.0, 5.0, 5.0, 16.0, 11.0, 11.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( 5.0, 5.0, 0.0, 11.0, 11.0, 5.0 );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( 5.0, 5.0, 11.0, 11.0, 11.0, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( 5.0, 11.0, 5.0, 11.0, 16.0, 11.0 );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
case DOWN:
|
||||
bch.addBox( 5.0, 0.0, 5.0, 11.0, 5.0, 11.0 );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( 11.0, 5.0, 5.0, 16.0, 11.0, 11.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( 5.0, 5.0, 0.0, 11.0, 11.0, 5.0 );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( 5.0, 5.0, 11.0, 11.0, 11.0, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( 5.0, 11.0, 5.0, 11.0, 16.0, 11.0 );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( this.getTexture( this.getCableColor() ) );
|
||||
@@ -185,7 +185,7 @@ public class PartCableSmart extends PartCable
|
||||
|
||||
boolean hasBuses = false;
|
||||
IPartHost ph = this.getHost();
|
||||
for (ForgeDirection of : EnumSet.complementOf( this.connections ))
|
||||
for ( ForgeDirection of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
if ( bp instanceof IGridHost )
|
||||
@@ -199,28 +199,28 @@ public class PartCableSmart extends PartCable
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
if ( len < 8 )
|
||||
{
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
rh.setBounds( 6, len, 6, 10, 5, 10 );
|
||||
break;
|
||||
case EAST:
|
||||
rh.setBounds( 11, 6, 6, 16 - len, 10, 10 );
|
||||
break;
|
||||
case NORTH:
|
||||
rh.setBounds( 6, 6, len, 10, 10, 5 );
|
||||
break;
|
||||
case SOUTH:
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 16 - len );
|
||||
break;
|
||||
case UP:
|
||||
rh.setBounds( 6, 11, 6, 10, 16 - len, 10 );
|
||||
break;
|
||||
case WEST:
|
||||
rh.setBounds( len, 6, 6, 5, 10, 10 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
case DOWN:
|
||||
rh.setBounds( 6, len, 6, 10, 5, 10 );
|
||||
break;
|
||||
case EAST:
|
||||
rh.setBounds( 11, 6, 6, 16 - len, 10, 10 );
|
||||
break;
|
||||
case NORTH:
|
||||
rh.setBounds( 6, 6, len, 10, 10, 5 );
|
||||
break;
|
||||
case SOUTH:
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 16 - len );
|
||||
break;
|
||||
case UP:
|
||||
rh.setBounds( 6, 11, 6, 10, 16 - len, 10 );
|
||||
break;
|
||||
case WEST:
|
||||
rh.setBounds( len, 6, 6, 5, 10, 10 );
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
@@ -253,7 +253,7 @@ public class PartCableSmart extends PartCable
|
||||
|
||||
if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for (ForgeDirection of : this.connections)
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
@@ -266,7 +266,7 @@ public class PartCableSmart extends PartCable
|
||||
{
|
||||
ForgeDirection selectedSide = ForgeDirection.UNKNOWN;
|
||||
|
||||
for (ForgeDirection of : this.connections)
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
@@ -282,88 +282,88 @@ public class PartCableSmart extends PartCable
|
||||
IIcon secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
IIcon secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 );
|
||||
|
||||
switch (selectedSide)
|
||||
switch ( selectedSide )
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
renderer.setRenderBounds( 5 / 16.0, 0, 5 / 16.0, 11 / 16.0, 16 / 16.0, 11 / 16.0 );
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
case DOWN:
|
||||
case UP:
|
||||
renderer.setRenderBounds( 5 / 16.0, 0, 5 / 16.0, 11 / 16.0, 16 / 16.0, 11 / 16.0 );
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST );
|
||||
ico.setFlip( false, true );
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST );
|
||||
ico.setFlip( false, true );
|
||||
|
||||
renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
FlippableIcon fpA = new FlippableIcon( firstTaughtIcon );
|
||||
FlippableIcon fpB = new FlippableIcon( secondTaughtIcon );
|
||||
FlippableIcon fpA = new FlippableIcon( firstTaughtIcon );
|
||||
FlippableIcon fpB = new FlippableIcon( secondTaughtIcon );
|
||||
|
||||
fpA = new FlippableIcon( firstTaughtIcon );
|
||||
fpB = new FlippableIcon( secondTaughtIcon );
|
||||
fpA = new FlippableIcon( firstTaughtIcon );
|
||||
fpB = new FlippableIcon( secondTaughtIcon );
|
||||
|
||||
fpA.setFlip( true, false );
|
||||
fpB.setFlip( true, false );
|
||||
fpA.setFlip( true, false );
|
||||
fpB.setFlip( true, false );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, fpA );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, fpA );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, fpB );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.setRenderBounds( 5 / 16.0, 5 / 16.0, 0, 11 / 16.0, 11 / 16.0, 16 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, fpB );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.setRenderBounds( 5 / 16.0, 5 / 16.0, 0, 11 / 16.0, 11 / 16.0, 16 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.parts.networking;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -50,10 +51,19 @@ import appeng.client.texture.CableBusTextures;
|
||||
import appeng.client.texture.FlippableIcon;
|
||||
import appeng.client.texture.OffsetIcon;
|
||||
import appeng.client.texture.TaughtIcon;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class PartDenseCable extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartDenseCable( ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
this.proxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED );
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusSupport supportsBuses()
|
||||
@@ -61,25 +71,15 @@ public class PartDenseCable extends PartCable
|
||||
return BusSupport.DENSE_CABLE;
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated(MENetworkChannelsChanged c)
|
||||
@Override
|
||||
public IIcon getTexture( AEColor c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
if ( c == AEColor.Transparent )
|
||||
{
|
||||
return AEApi.instance().definitions().parts().cableSmart().stack( AEColor.Transparent, 1 ).getIconIndex();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender(MENetworkPowerStatusChange c)
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
public PartDenseCable(Class c, ItemStack is) {
|
||||
super( c, is );
|
||||
this.proxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED );
|
||||
}
|
||||
|
||||
public PartDenseCable(ItemStack is) {
|
||||
this( PartDenseCable.class, is );
|
||||
return this.getSmartTexture( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,64 +89,7 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTexture(AEColor c)
|
||||
{
|
||||
if ( c == AEColor.Transparent )
|
||||
return AEApi.instance().parts().partCableSmart.stack( AEColor.Transparent, 1 ).getIconIndex();
|
||||
|
||||
return this.getSmartTexture( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
rh.setBounds( 4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f );
|
||||
|
||||
float offU = 0;
|
||||
float offV = 9;
|
||||
|
||||
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
|
||||
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ))
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
rh.renderInventoryFace( ch2, side, renderer );
|
||||
}
|
||||
|
||||
offU = 9;
|
||||
offV = 0;
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ))
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
rh.renderInventoryFace( ch2, side, renderer );
|
||||
}
|
||||
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 );
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
|
||||
|
||||
for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ))
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
rh.renderInventoryFace( ch2, side, renderer );
|
||||
}
|
||||
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes(IPartCollisionHelper bch)
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
{
|
||||
boolean noLadder = !bch.isBBCollision();
|
||||
double min = noLadder ? 3.0 : 4.9;
|
||||
@@ -163,85 +106,249 @@ public class PartDenseCable extends PartCable
|
||||
this.connections.clear();
|
||||
}
|
||||
|
||||
for (ForgeDirection of : this.connections)
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
if ( this.isDense( of ) )
|
||||
{
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
bch.addBox( min, 0.0, min, max, min, max );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( max, min, min, 16.0, max, max );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( min, min, 0.0, max, max, min );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( min, min, max, max, max, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( min, max, min, max, 16.0, max );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, min, min, min, max, max );
|
||||
break;
|
||||
default:
|
||||
case DOWN:
|
||||
bch.addBox( min, 0.0, min, max, min, max );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( max, min, min, 16.0, max, max );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( min, min, 0.0, max, max, min );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( min, min, max, max, max, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( min, max, min, max, 16.0, max );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, min, min, min, max, max );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
bch.addBox( 5.0, 0.0, 5.0, 11.0, 5.0, 11.0 );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( 11.0, 5.0, 5.0, 16.0, 11.0, 11.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( 5.0, 5.0, 0.0, 11.0, 11.0, 5.0 );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( 5.0, 5.0, 11.0, 11.0, 11.0, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( 5.0, 11.0, 5.0, 11.0, 16.0, 11.0 );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
case DOWN:
|
||||
bch.addBox( 5.0, 0.0, 5.0, 11.0, 5.0, 11.0 );
|
||||
break;
|
||||
case EAST:
|
||||
bch.addBox( 11.0, 5.0, 5.0, 16.0, 11.0, 11.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
bch.addBox( 5.0, 5.0, 0.0, 11.0, 11.0, 5.0 );
|
||||
break;
|
||||
case SOUTH:
|
||||
bch.addBox( 5.0, 5.0, 11.0, 11.0, 11.0, 16.0 );
|
||||
break;
|
||||
case UP:
|
||||
bch.addBox( 5.0, 11.0, 5.0, 11.0, 16.0, 11.0 );
|
||||
break;
|
||||
case WEST:
|
||||
bch.addBox( 0.0, 5.0, 5.0, 5.0, 11.0, 11.0 );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDense(ForgeDirection of)
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
|
||||
{
|
||||
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ );
|
||||
if ( te instanceof IGridHost )
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
rh.setBounds( 4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f );
|
||||
|
||||
float offU = 0;
|
||||
float offV = 9;
|
||||
|
||||
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
|
||||
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) )
|
||||
{
|
||||
AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.DENSE;
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
rh.renderInventoryFace( ch2, side, renderer );
|
||||
}
|
||||
return false;
|
||||
|
||||
offU = 9;
|
||||
offV = 0;
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
rh.renderInventoryFace( ch2, side, renderer );
|
||||
}
|
||||
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 );
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
|
||||
|
||||
for ( ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
rh.renderInventoryFace( ch2, side, renderer );
|
||||
}
|
||||
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
private boolean isSmart(ForgeDirection of)
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
{
|
||||
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ );
|
||||
if ( te instanceof IGridHost )
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( this.getTexture( this.getCableColor() ) );
|
||||
|
||||
EnumSet<ForgeDirection> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.SMART;
|
||||
if ( !this.isDense( of ) )
|
||||
hasBuses = true;
|
||||
}
|
||||
return false;
|
||||
|
||||
if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
if ( this.isDense( of ) )
|
||||
this.renderDenseConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
else if ( this.isSmart( of ) )
|
||||
this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
else
|
||||
this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
|
||||
rh.setTexture( this.getDenseTexture( this.getCableColor() ) );
|
||||
rh.setBounds( 3, 3, 3, 13, 13, 13 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
}
|
||||
else
|
||||
{
|
||||
ForgeDirection selectedSide = ForgeDirection.UNKNOWN;
|
||||
|
||||
for ( ForgeDirection of : this.connections )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
IIcon def = this.getTexture( this.getCableColor() );
|
||||
IIcon off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IIcon firstOffset = new OffsetIcon( firstIcon, 0, -12 );
|
||||
|
||||
IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
IIcon secondOffset = new OffsetIcon( secondIcon, 0, -12 );
|
||||
|
||||
switch ( selectedSide )
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
renderer.setRenderBounds( 3 / 16.0, 0, 3 / 16.0, 13 / 16.0, 16 / 16.0, 13 / 16.0 );
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstIcon, firstIcon, firstOffset, firstOffset, firstOffset, firstOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondIcon, secondIcon, secondOffset, secondOffset, secondOffset, secondOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST );
|
||||
ico.setFlip( false, true );
|
||||
|
||||
renderer.setRenderBounds( 0, 3 / 16.0, 3 / 16.0, 16 / 16.0, 13 / 16.0, 13 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
FlippableIcon fpA = new FlippableIcon( firstIcon );
|
||||
FlippableIcon fpB = new FlippableIcon( secondIcon );
|
||||
|
||||
fpA.setFlip( true, false );
|
||||
fpB.setFlip( true, false );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffset, firstOffset, firstOffset, firstOffset, firstIcon, fpA );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffset, secondOffset, secondOffset, secondOffset, secondIcon, fpB );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.setRenderBounds( 3 / 16.0, 3 / 16.0, 0, 13 / 16.0, 13 / 16.0, 16 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffset, firstOffset, firstIcon, firstIcon, firstOffset, firstOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffset, secondOffset, secondIcon, secondIcon, secondOffset, secondOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDenseConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDenseConnection( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
@@ -280,34 +387,33 @@ public class PartDenseCable extends PartCable
|
||||
*/
|
||||
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of, of.getOpposite() ) ) );
|
||||
if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent
|
||||
&& partHost.getPart( of.getOpposite() ) == null )
|
||||
if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent && partHost.getPart( of.getOpposite() ) == null )
|
||||
rh.setTexture( this.getTexture( myColor = partHost.getColor() ) );
|
||||
else
|
||||
rh.setTexture( this.getTexture( this.getCableColor() ) );
|
||||
|
||||
switch (of)
|
||||
switch ( of )
|
||||
{
|
||||
case DOWN:
|
||||
rh.setBounds( 4, 0, 4, 12, 5, 12 );
|
||||
break;
|
||||
case EAST:
|
||||
rh.setBounds( 11, 4, 4, 16, 12, 12 );
|
||||
break;
|
||||
case NORTH:
|
||||
rh.setBounds( 4, 4, 0, 12, 12, 5 );
|
||||
break;
|
||||
case SOUTH:
|
||||
rh.setBounds( 4, 4, 11, 12, 12, 16 );
|
||||
break;
|
||||
case UP:
|
||||
rh.setBounds( 4, 11, 4, 12, 16, 12 );
|
||||
break;
|
||||
case WEST:
|
||||
rh.setBounds( 0, 4, 4, 5, 12, 12 );
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
case DOWN:
|
||||
rh.setBounds( 4, 0, 4, 12, 5, 12 );
|
||||
break;
|
||||
case EAST:
|
||||
rh.setBounds( 11, 4, 4, 16, 12, 12 );
|
||||
break;
|
||||
case NORTH:
|
||||
rh.setBounds( 4, 4, 0, 12, 12, 5 );
|
||||
break;
|
||||
case SOUTH:
|
||||
rh.setBounds( 4, 4, 11, 12, 12, 16 );
|
||||
break;
|
||||
case UP:
|
||||
rh.setBounds( 4, 11, 4, 12, 16, 12 );
|
||||
break;
|
||||
case WEST:
|
||||
rh.setBounds( 0, 4, 4, 5, 12, 12 );
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
@@ -333,183 +439,79 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
|
||||
private boolean isSmart( ForgeDirection of )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( this.getTexture( this.getCableColor() ) );
|
||||
|
||||
EnumSet<ForgeDirection> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
for (ForgeDirection of : this.connections)
|
||||
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ );
|
||||
if ( te instanceof IGridHost )
|
||||
{
|
||||
if ( !this.isDense( of ) )
|
||||
hasBuses = true;
|
||||
AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.SMART;
|
||||
}
|
||||
|
||||
if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for (ForgeDirection of : this.connections)
|
||||
{
|
||||
if ( this.isDense( of ) )
|
||||
this.renderDenseConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
else if ( this.isSmart( of ) )
|
||||
this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
else
|
||||
this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
|
||||
rh.setTexture( this.getDenseTexture( this.getCableColor() ) );
|
||||
rh.setBounds( 3, 3, 3, 13, 13, 13 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
}
|
||||
else
|
||||
{
|
||||
ForgeDirection selectedSide = ForgeDirection.UNKNOWN;
|
||||
|
||||
for (ForgeDirection of : this.connections)
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
IIcon def = this.getTexture( this.getCableColor() );
|
||||
IIcon off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IIcon firstOffset = new OffsetIcon( firstIcon, 0, -12 );
|
||||
|
||||
IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
IIcon secondOffset = new OffsetIcon( secondIcon, 0, -12 );
|
||||
|
||||
switch (selectedSide)
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
renderer.setRenderBounds( 3 / 16.0, 0, 3 / 16.0, 13 / 16.0, 16 / 16.0, 13 / 16.0 );
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstIcon, firstIcon, firstOffset, firstOffset, firstOffset, firstOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondIcon, secondIcon, secondOffset, secondOffset, secondOffset, secondOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST );
|
||||
ico.setFlip( false, true );
|
||||
|
||||
renderer.setRenderBounds( 0, 3 / 16.0, 3 / 16.0, 16 / 16.0, 13 / 16.0, 13 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
FlippableIcon fpA = new FlippableIcon( firstIcon );
|
||||
FlippableIcon fpB = new FlippableIcon( secondIcon );
|
||||
|
||||
fpA.setFlip( true, false );
|
||||
fpB.setFlip( true, false );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffset, firstOffset, firstOffset, firstOffset, firstIcon, fpA );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffset, secondOffset, secondOffset, secondOffset, secondIcon, fpB );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.setRenderBounds( 3 / 16.0, 3 / 16.0, 0, 13 / 16.0, 13 / 16.0, 16 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
|
||||
rh.setTexture( firstOffset, firstOffset, firstIcon, firstIcon, firstOffset, firstOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
|
||||
rh.setTexture( secondOffset, secondOffset, secondIcon, secondIcon, secondOffset, secondOffset );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
rh.setTexture( null );
|
||||
return false;
|
||||
}
|
||||
|
||||
private IIcon getDenseTexture(AEColor c)
|
||||
private IIcon getDenseTexture( AEColor c )
|
||||
{
|
||||
switch (c)
|
||||
switch ( c )
|
||||
{
|
||||
case Black:
|
||||
return CableBusTextures.MEDense_Black.getIcon();
|
||||
case Blue:
|
||||
return CableBusTextures.MEDense_Blue.getIcon();
|
||||
case Brown:
|
||||
return CableBusTextures.MEDense_Brown.getIcon();
|
||||
case Cyan:
|
||||
return CableBusTextures.MEDense_Cyan.getIcon();
|
||||
case Gray:
|
||||
return CableBusTextures.MEDense_Gray.getIcon();
|
||||
case Green:
|
||||
return CableBusTextures.MEDense_Green.getIcon();
|
||||
case LightBlue:
|
||||
return CableBusTextures.MEDense_LightBlue.getIcon();
|
||||
case LightGray:
|
||||
return CableBusTextures.MEDense_LightGrey.getIcon();
|
||||
case Lime:
|
||||
return CableBusTextures.MEDense_Lime.getIcon();
|
||||
case Magenta:
|
||||
return CableBusTextures.MEDense_Magenta.getIcon();
|
||||
case Orange:
|
||||
return CableBusTextures.MEDense_Orange.getIcon();
|
||||
case Pink:
|
||||
return CableBusTextures.MEDense_Pink.getIcon();
|
||||
case Purple:
|
||||
return CableBusTextures.MEDense_Purple.getIcon();
|
||||
case Red:
|
||||
return CableBusTextures.MEDense_Red.getIcon();
|
||||
case White:
|
||||
return CableBusTextures.MEDense_White.getIcon();
|
||||
case Yellow:
|
||||
return CableBusTextures.MEDense_Yellow.getIcon();
|
||||
default:
|
||||
case Black:
|
||||
return CableBusTextures.MEDense_Black.getIcon();
|
||||
case Blue:
|
||||
return CableBusTextures.MEDense_Blue.getIcon();
|
||||
case Brown:
|
||||
return CableBusTextures.MEDense_Brown.getIcon();
|
||||
case Cyan:
|
||||
return CableBusTextures.MEDense_Cyan.getIcon();
|
||||
case Gray:
|
||||
return CableBusTextures.MEDense_Gray.getIcon();
|
||||
case Green:
|
||||
return CableBusTextures.MEDense_Green.getIcon();
|
||||
case LightBlue:
|
||||
return CableBusTextures.MEDense_LightBlue.getIcon();
|
||||
case LightGray:
|
||||
return CableBusTextures.MEDense_LightGrey.getIcon();
|
||||
case Lime:
|
||||
return CableBusTextures.MEDense_Lime.getIcon();
|
||||
case Magenta:
|
||||
return CableBusTextures.MEDense_Magenta.getIcon();
|
||||
case Orange:
|
||||
return CableBusTextures.MEDense_Orange.getIcon();
|
||||
case Pink:
|
||||
return CableBusTextures.MEDense_Pink.getIcon();
|
||||
case Purple:
|
||||
return CableBusTextures.MEDense_Purple.getIcon();
|
||||
case Red:
|
||||
return CableBusTextures.MEDense_Red.getIcon();
|
||||
case White:
|
||||
return CableBusTextures.MEDense_White.getIcon();
|
||||
case Yellow:
|
||||
return CableBusTextures.MEDense_Yellow.getIcon();
|
||||
default:
|
||||
}
|
||||
|
||||
return this.is.getIconIndex();
|
||||
}
|
||||
|
||||
private boolean isDense( ForgeDirection of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ );
|
||||
if ( te instanceof IGridHost )
|
||||
{
|
||||
AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.DENSE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true );
|
||||
|
||||
public PartQuartzFiber(ItemStack is) {
|
||||
super( PartQuartzFiber.class, is );
|
||||
super( is );
|
||||
this.proxy.setIdlePowerUsage( 0 );
|
||||
this.proxy.setFlags( GridFlags.CANNOT_CARRY );
|
||||
this.outerProxy.setIdlePowerUsage( 0 );
|
||||
|
||||
Reference in New Issue
Block a user