Reworked cable connections (#3334)

* Reworked cable connections

Added enums for cable variants and sizes.
Rules for connections between a cable and another cable or grid member
are much more simple without any exceptions for certain combinations.
1/ Connections are rendered as the lowest type between cores.
2/ Each type uses are core for clear separation.
3/ The core will always be on the cable with the higher order.
This commit is contained in:
yueh
2018-05-27 21:34:28 +02:00
committed by GitHub
parent 2894a7caa0
commit 3c4a0cae11
8 changed files with 201 additions and 36 deletions
@@ -132,7 +132,7 @@ class CableBuilder
break;
case DENSE_COVERED:
case DENSE_SMART:
this.addCableCore( CableCoreType.DENSE_SMART, color, quadsOut );
this.addCableCore( CableCoreType.DENSE, color, quadsOut );
break;
default:
}
@@ -153,7 +153,7 @@ class CableBuilder
case COVERED:
cubeBuilder.addCube( 5, 5, 5, 11, 11, 11 );
break;
case DENSE_SMART:
case DENSE:
cubeBuilder.addCube( 3, 3, 3, 13, 13, 13 );
break;
}
@@ -329,7 +329,6 @@ class CableBuilder
public void addConstrainedCoveredConnection( EnumFacing facing, AEColor cableColor, int distanceFromEdge, List<BakedQuad> quadsOut )
{
// The core of a covered cable reaches up to 5 voxels from the block edge, so
// drawing a connection can only occur from there onwards
if( distanceFromEdge >= 5 )
@@ -348,6 +347,11 @@ class CableBuilder
public void addSmartConnection( EnumFacing facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, int channels, List<BakedQuad> quadsOut )
{
if( connectionType == AECableType.COVERED || connectionType == AECableType.GLASS )
{
this.addCoveredConnection( facing, cableColor, connectionType, cableBusAdjacent, quadsOut );
return;
}
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );