Format sourcecode
This commit is contained in:
@@ -77,7 +77,8 @@ public class CableBusModel implements IModel
|
||||
CableBuilder cableBuilder = new CableBuilder( format, bakedTextureGetter );
|
||||
FacadeBuilder facadeBuilder = new FacadeBuilder( format, bakedTextureGetter );
|
||||
|
||||
// This should normally not be used, but we *have* to provide a particle texture or otherwise damage models will crash
|
||||
// This should normally not be used, but we *have* to provide a particle texture or otherwise damage models will
|
||||
// crash
|
||||
TextureAtlasSprite particleTexture = cableBuilder.getCoreTexture( CableCoreType.GLASS, AEColor.TRANSPARENT );
|
||||
|
||||
return new CableBusBakedModel( cableBuilder, facadeBuilder, partModels, particleTexture );
|
||||
|
||||
@@ -99,7 +99,7 @@ public class FacadeBuilder
|
||||
} );
|
||||
}
|
||||
|
||||
public static TextureAtlasAndTint getSprite( IBakedModel blockModel, IBlockState state, EnumFacing facing, long rand)
|
||||
public static TextureAtlasAndTint getSprite( IBakedModel blockModel, IBlockState state, EnumFacing facing, long rand )
|
||||
{
|
||||
|
||||
TextureAtlasAndTint firstFound = null;
|
||||
@@ -107,7 +107,8 @@ public class FacadeBuilder
|
||||
|
||||
try
|
||||
{
|
||||
// Some other mods also distinguish between layers, so we're doing this in a loop from most likely to least likely
|
||||
// Some other mods also distinguish between layers, so we're doing this in a loop from most likely to least
|
||||
// likely
|
||||
for( BlockRenderLayer layer : BlockRenderLayer.values() )
|
||||
{
|
||||
|
||||
@@ -258,16 +259,8 @@ public class FacadeBuilder
|
||||
|
||||
AxisAlignedBB primaryBox = getFacadeBox( side, thinFacades );
|
||||
|
||||
Vector3f min = new Vector3f(
|
||||
(float) primaryBox.minX * 16,
|
||||
(float) primaryBox.minY * 16,
|
||||
(float) primaryBox.minZ * 16
|
||||
);
|
||||
Vector3f max = new Vector3f(
|
||||
(float) primaryBox.maxX * 16,
|
||||
(float) primaryBox.maxY * 16,
|
||||
(float) primaryBox.maxZ * 16
|
||||
);
|
||||
Vector3f min = new Vector3f( (float) primaryBox.minX * 16, (float) primaryBox.minY * 16, (float) primaryBox.minZ * 16 );
|
||||
Vector3f max = new Vector3f( (float) primaryBox.maxX * 16, (float) primaryBox.maxY * 16, (float) primaryBox.maxZ * 16 );
|
||||
|
||||
if( busBounds == null )
|
||||
{
|
||||
@@ -311,8 +304,8 @@ public class FacadeBuilder
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3f busMin = new Vector3f( (float) busBounds.minX * 16, (float) busBounds.minY * 16, (float) busBounds.minZ * 16 );
|
||||
Vector3f busMax = new Vector3f( (float) busBounds.maxX * 16, (float) busBounds.maxY * 16, (float) busBounds.maxZ * 16 );
|
||||
Vector3f busMin = new Vector3f( (float) busBounds.minX * 16, (float) busBounds.minY * 16, (float) busBounds.minZ * 16 );
|
||||
Vector3f busMax = new Vector3f( (float) busBounds.maxX * 16, (float) busBounds.maxY * 16, (float) busBounds.maxZ * 16 );
|
||||
|
||||
if( side == EnumFacing.UP || side == EnumFacing.DOWN )
|
||||
{
|
||||
@@ -368,8 +361,7 @@ public class FacadeBuilder
|
||||
}
|
||||
}
|
||||
|
||||
private void renderSegmentBlockCurrentBounds( CubeBuilder builder, Vector3f min, Vector3f max,
|
||||
float minX, float minY, float minZ, float maxX, float maxY, float maxZ )
|
||||
private void renderSegmentBlockCurrentBounds( CubeBuilder builder, Vector3f min, Vector3f max, float minX, float minY, float minZ, float maxX, float maxY, float maxZ )
|
||||
{
|
||||
minX = Math.max( min.x, minX );
|
||||
minY = Math.max( min.y, minY );
|
||||
@@ -379,7 +371,7 @@ public class FacadeBuilder
|
||||
maxZ = Math.min( max.z, maxZ );
|
||||
|
||||
// don't draw it if its not at least a pixel wide...
|
||||
if( maxX - minX >= 1.0 && maxY - minY >= 1.0 && maxZ - minZ >= 1.0 )
|
||||
if( maxX - minX >= 1.0 && maxY - minY >= 1.0 && maxZ - minZ >= 1.0 )
|
||||
{
|
||||
builder.addCube( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
}
|
||||
@@ -387,7 +379,8 @@ public class FacadeBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the actual facade bounding box, and the bounding boxes of all parts, determine the biggest union of AABB that intersect with the
|
||||
* Given the actual facade bounding box, and the bounding boxes of all parts, determine the biggest union of AABB
|
||||
* that intersect with the
|
||||
* facade's bounding box. This AABB will need to be "cut out" when the facade is rendered.
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.cablebus;
|
||||
|
||||
|
||||
|
||||
@@ -101,7 +101,8 @@ public class QuadRotator
|
||||
|
||||
for( int i = 0; i < 4; i++ )
|
||||
{
|
||||
Point3f pos = new Point3f( Float.intBitsToFloat( newData[i * stride + posIdx] ) - 0.5f, Float.intBitsToFloat( newData[i * stride + posIdx + 1] ) - 0.5f, Float.intBitsToFloat( newData[i * stride + posIdx + 2] ) - 0.5f );
|
||||
Point3f pos = new Point3f( Float.intBitsToFloat( newData[i * stride + posIdx] ) - 0.5f, Float
|
||||
.intBitsToFloat( newData[i * stride + posIdx + 1] ) - 0.5f, Float.intBitsToFloat( newData[i * stride + posIdx + 2] ) - 0.5f );
|
||||
|
||||
// Rotate stuff around
|
||||
mat.transform( pos );
|
||||
@@ -116,7 +117,8 @@ public class QuadRotator
|
||||
{
|
||||
if( normalType == VertexFormatElement.EnumType.FLOAT )
|
||||
{
|
||||
Vector3f normal = new Vector3f( Float.intBitsToFloat( newData[i * stride + normalIdx] ), Float.intBitsToFloat( newData[i * stride + normalIdx + 1] ), Float.intBitsToFloat( newData[i * stride + normalIdx + 2] ) );
|
||||
Vector3f normal = new Vector3f( Float.intBitsToFloat( newData[i * stride + normalIdx] ), Float
|
||||
.intBitsToFloat( newData[i * stride + normalIdx + 1] ), Float.intBitsToFloat( newData[i * stride + normalIdx + 2] ) );
|
||||
|
||||
// Rotate stuff around
|
||||
mat.transform( normal );
|
||||
@@ -129,7 +131,8 @@ public class QuadRotator
|
||||
else if( normalType == VertexFormatElement.EnumType.BYTE )
|
||||
{
|
||||
int idx = i * stride * 4 + normalIdx;
|
||||
Vector3f normal = new Vector3f( getByte( newData, idx ) / 127.0f, getByte( newData, idx + 1 ) / 127.0f, getByte( newData, idx + 2 ) / 127.0f );
|
||||
Vector3f normal = new Vector3f( getByte( newData, idx ) / 127.0f, getByte( newData, idx + 1 ) / 127.0f, getByte( newData,
|
||||
idx + 2 ) / 127.0f );
|
||||
|
||||
// Rotate stuff around
|
||||
mat.transform( normal );
|
||||
|
||||
@@ -34,7 +34,12 @@ import appeng.core.AppEng;
|
||||
public class SmartCableTextures
|
||||
{
|
||||
|
||||
public static final ResourceLocation[] SMART_CHANNELS_TEXTURES = { new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_00" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_01" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_02" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_03" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_04" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_10" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_11" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_12" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_13" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_14" )
|
||||
public static final ResourceLocation[] SMART_CHANNELS_TEXTURES = { new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_00" ),
|
||||
new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_01" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_02" ),
|
||||
new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_03" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_04" ),
|
||||
new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_10" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_11" ),
|
||||
new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_12" ), new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_13" ),
|
||||
new ResourceLocation( AppEng.MOD_ID, "parts/cable/smart/channels_14" )
|
||||
};
|
||||
|
||||
// Textures used to display channels on smart cables. There's two sets of 5 textures each, and
|
||||
|
||||
Reference in New Issue
Block a user