Format sourcecode
This commit is contained in:
@@ -97,7 +97,8 @@ public class FacadeDispatcherBakedModel implements IBakedModel
|
||||
@Override
|
||||
public ItemOverrideList getOverrides()
|
||||
{
|
||||
return new ItemOverrideList( Collections.emptyList() ){
|
||||
return new ItemOverrideList( Collections.emptyList() )
|
||||
{
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ public class FacadeWithBlockBakedModel implements IBakedModel
|
||||
List<BakedQuad> quads = new ArrayList<>( 1 );
|
||||
CubeBuilder builder = new CubeBuilder( format, quads );
|
||||
FacadeBuilder.TextureAtlasAndTint sprite = FacadeBuilder.getSprite( textureModel, blockState, side, rand );
|
||||
if ( sprite != null && sprite.getSprite() != null )
|
||||
if( sprite != null && sprite.getSprite() != null )
|
||||
{
|
||||
if( sprite.getTint() != -1 )
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.client.render;
|
||||
|
||||
|
||||
@@ -25,6 +26,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
|
||||
/**
|
||||
* TODO: Removed useless stuff.
|
||||
*/
|
||||
@@ -32,44 +34,44 @@ public enum FacingToRotation
|
||||
{
|
||||
|
||||
// DUNSWE
|
||||
//@formatter:off
|
||||
DOWN_DOWN ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
DOWN_UP ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
DOWN_NORTH ( new Vector3f( -90, 0, 0 ) ),
|
||||
DOWN_SOUTH ( new Vector3f( -90, 0, 180 ) ),
|
||||
DOWN_WEST ( new Vector3f( -90, 0, 90 ) ),
|
||||
DOWN_EAST ( new Vector3f( -90, 0, -90 ) ),
|
||||
UP_DOWN ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
UP_UP ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
UP_NORTH ( new Vector3f( 90, 0, 180 ) ),
|
||||
UP_SOUTH ( new Vector3f( 90, 0, 0 ) ),
|
||||
UP_WEST ( new Vector3f( 90, 0, 90 ) ),
|
||||
UP_EAST ( new Vector3f( 90, 0, -90 ) ),
|
||||
NORTH_DOWN ( new Vector3f( 0, 0, 180 ) ),
|
||||
NORTH_UP ( new Vector3f( 0, 0, 0 ) ),
|
||||
NORTH_NORTH ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
NORTH_SOUTH ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
NORTH_WEST ( new Vector3f( 0, 0, 90 ) ),
|
||||
NORTH_EAST ( new Vector3f( 0, 0, -90 ) ),
|
||||
SOUTH_DOWN ( new Vector3f( 0, 180, 180 ) ),
|
||||
SOUTH_UP ( new Vector3f( 0, 180, 0 ) ),
|
||||
SOUTH_NORTH ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
SOUTH_SOUTH ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
SOUTH_WEST ( new Vector3f( 0, 180, -90 ) ),
|
||||
SOUTH_EAST ( new Vector3f( 0, 180, 90 ) ),
|
||||
WEST_DOWN ( new Vector3f( 0, 90, 180 ) ),
|
||||
WEST_UP ( new Vector3f( 0, 90, 0 ) ),
|
||||
WEST_NORTH ( new Vector3f( 0, 90, -90 ) ),
|
||||
WEST_SOUTH ( new Vector3f( 0, 90, 90 ) ),
|
||||
WEST_WEST ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
WEST_EAST ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
EAST_DOWN ( new Vector3f( 0, -90, 180 ) ),
|
||||
EAST_UP ( new Vector3f( 0, -90, 0 ) ),
|
||||
EAST_NORTH ( new Vector3f( 0, -90, 90 ) ),
|
||||
EAST_SOUTH ( new Vector3f( 0, -90, -90 ) ),
|
||||
EAST_WEST ( new Vector3f( 0, 0, 0 ) ), //NOOP
|
||||
EAST_EAST ( new Vector3f( 0, 0, 0 ) ); //NOOP
|
||||
//@formatter:on
|
||||
// @formatter:off
|
||||
DOWN_DOWN( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
DOWN_UP( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
DOWN_NORTH( new Vector3f( -90, 0, 0 ) ),
|
||||
DOWN_SOUTH( new Vector3f( -90, 0, 180 ) ),
|
||||
DOWN_WEST( new Vector3f( -90, 0, 90 ) ),
|
||||
DOWN_EAST( new Vector3f( -90, 0, -90 ) ),
|
||||
UP_DOWN( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
UP_UP( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
UP_NORTH( new Vector3f( 90, 0, 180 ) ),
|
||||
UP_SOUTH( new Vector3f( 90, 0, 0 ) ),
|
||||
UP_WEST( new Vector3f( 90, 0, 90 ) ),
|
||||
UP_EAST( new Vector3f( 90, 0, -90 ) ),
|
||||
NORTH_DOWN( new Vector3f( 0, 0, 180 ) ),
|
||||
NORTH_UP( new Vector3f( 0, 0, 0 ) ),
|
||||
NORTH_NORTH( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
NORTH_SOUTH( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
NORTH_WEST( new Vector3f( 0, 0, 90 ) ),
|
||||
NORTH_EAST( new Vector3f( 0, 0, -90 ) ),
|
||||
SOUTH_DOWN( new Vector3f( 0, 180, 180 ) ),
|
||||
SOUTH_UP( new Vector3f( 0, 180, 0 ) ),
|
||||
SOUTH_NORTH( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
SOUTH_SOUTH( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
SOUTH_WEST( new Vector3f( 0, 180, -90 ) ),
|
||||
SOUTH_EAST( new Vector3f( 0, 180, 90 ) ),
|
||||
WEST_DOWN( new Vector3f( 0, 90, 180 ) ),
|
||||
WEST_UP( new Vector3f( 0, 90, 0 ) ),
|
||||
WEST_NORTH( new Vector3f( 0, 90, -90 ) ),
|
||||
WEST_SOUTH( new Vector3f( 0, 90, 90 ) ),
|
||||
WEST_WEST( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
WEST_EAST( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
EAST_DOWN( new Vector3f( 0, -90, 180 ) ),
|
||||
EAST_UP( new Vector3f( 0, -90, 0 ) ),
|
||||
EAST_NORTH( new Vector3f( 0, -90, 90 ) ),
|
||||
EAST_SOUTH( new Vector3f( 0, -90, -90 ) ),
|
||||
EAST_WEST( new Vector3f( 0, 0, 0 ) ), // NOOP
|
||||
EAST_EAST( new Vector3f( 0, 0, 0 ) ); // NOOP
|
||||
// @formatter:on
|
||||
|
||||
private final Vector3f rot;
|
||||
private final Matrix4f mat;
|
||||
@@ -77,7 +79,10 @@ public enum FacingToRotation
|
||||
private FacingToRotation( Vector3f rot )
|
||||
{
|
||||
this.rot = rot;
|
||||
this.mat = TRSRTransformation.toVecmath( new org.lwjgl.util.vector.Matrix4f().rotate( (float) Math.toRadians( rot.x ), new org.lwjgl.util.vector.Vector3f( 1, 0, 0 ) ).rotate( (float) Math.toRadians( rot.y ), new org.lwjgl.util.vector.Vector3f( 0, 1, 0 ) ).rotate( (float) Math.toRadians( rot.z ), new org.lwjgl.util.vector.Vector3f( 0, 0, 1 ) ) );
|
||||
this.mat = TRSRTransformation
|
||||
.toVecmath( new org.lwjgl.util.vector.Matrix4f().rotate( (float) Math.toRadians( rot.x ), new org.lwjgl.util.vector.Vector3f( 1, 0, 0 ) )
|
||||
.rotate( (float) Math.toRadians( rot.y ), new org.lwjgl.util.vector.Vector3f( 0, 1, 0 ) )
|
||||
.rotate( (float) Math.toRadians( rot.z ), new org.lwjgl.util.vector.Vector3f( 0, 0, 1 ) ) );
|
||||
}
|
||||
|
||||
public Vector3f getRot()
|
||||
|
||||
@@ -130,7 +130,7 @@ public class SpatialSkyRender extends IRenderHandler
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.depthMask( false );
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
OpenGlHelper.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0 );
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
|
||||
@@ -55,7 +55,8 @@ public class StackSizeRenderer
|
||||
|
||||
if( aeStack.getShowCraftingLabel() )
|
||||
{
|
||||
final String craftLabelText = AEConfig.instance().useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
|
||||
final String craftLabelText = AEConfig.instance().useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft
|
||||
.getLocal();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.disableDepth();
|
||||
GlStateManager.disableBlend();
|
||||
|
||||
@@ -34,7 +34,8 @@ public final class VertexFormats
|
||||
// Standard item format extended with lightmap coordinates
|
||||
private static final VertexFormat itemFormatWithLightMap = new VertexFormat( DefaultVertexFormats.ITEM ).addElement( DefaultVertexFormats.TEX_2S );
|
||||
|
||||
private VertexFormats() {
|
||||
private VertexFormats()
|
||||
{
|
||||
}
|
||||
|
||||
public static VertexFormat getFormatWithLightMap( VertexFormat format )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -74,7 +74,8 @@ class CraftingCubeModel implements IModel
|
||||
@Override
|
||||
public Collection<ResourceLocation> getTextures()
|
||||
{
|
||||
return ImmutableList.of( RING_CORNER, RING_SIDE_HOR, RING_SIDE_VER, UNIT_BASE, LIGHT_BASE, ACCELERATOR_LIGHT, STORAGE_1K_LIGHT, STORAGE_4K_LIGHT, STORAGE_16K_LIGHT, STORAGE_64K_LIGHT, MONITOR_BASE, MONITOR_LIGHT_DARK, MONITOR_LIGHT_MEDIUM, MONITOR_LIGHT_BRIGHT );
|
||||
return ImmutableList.of( RING_CORNER, RING_SIDE_HOR, RING_SIDE_VER, UNIT_BASE, LIGHT_BASE, ACCELERATOR_LIGHT, STORAGE_1K_LIGHT, STORAGE_4K_LIGHT,
|
||||
STORAGE_16K_LIGHT, STORAGE_64K_LIGHT, MONITOR_BASE, MONITOR_LIGHT_DARK, MONITOR_LIGHT_MEDIUM, MONITOR_LIGHT_BRIGHT );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,9 +95,12 @@ class CraftingCubeModel implements IModel
|
||||
case STORAGE_4K:
|
||||
case STORAGE_16K:
|
||||
case STORAGE_64K:
|
||||
return new LightBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter.apply( LIGHT_BASE ), getLightTexture( bakedTextureGetter, type ) );
|
||||
return new LightBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter
|
||||
.apply( LIGHT_BASE ), getLightTexture( bakedTextureGetter, type ) );
|
||||
case MONITOR:
|
||||
return new MonitorBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter.apply( UNIT_BASE ), bakedTextureGetter.apply( MONITOR_BASE ), bakedTextureGetter.apply( MONITOR_LIGHT_DARK ), bakedTextureGetter.apply( MONITOR_LIGHT_MEDIUM ), bakedTextureGetter.apply( MONITOR_LIGHT_BRIGHT ) );
|
||||
return new MonitorBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter.apply( UNIT_BASE ), bakedTextureGetter
|
||||
.apply( MONITOR_BASE ), bakedTextureGetter.apply(
|
||||
MONITOR_LIGHT_DARK ), bakedTextureGetter.apply( MONITOR_LIGHT_MEDIUM ), bakedTextureGetter.apply( MONITOR_LIGHT_BRIGHT ) );
|
||||
default:
|
||||
throw new IllegalArgumentException( "Unsupported crafting unit type: " + type );
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
@@ -31,8 +32,10 @@ import appeng.items.misc.ItemEncodedPattern;
|
||||
|
||||
|
||||
/**
|
||||
* This special model handles switching between rendering the crafting output of an encoded pattern (when shift is being held), and
|
||||
* showing the encoded pattern itself. Matters are further complicated by only wanting to show the crafting output when the pattern is being
|
||||
* This special model handles switching between rendering the crafting output of an encoded pattern (when shift is being
|
||||
* held), and
|
||||
* showing the encoded pattern itself. Matters are further complicated by only wanting to show the crafting output when
|
||||
* the pattern is being
|
||||
* rendered in the GUI, and not anywhere else.
|
||||
*/
|
||||
class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
@@ -105,10 +108,14 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Since the ItemOverrideList handling comes before handling the perspective awareness (which is the first place where we
|
||||
* know how we are being rendered) we need to remember the model of the crafting output, and make the decision on which to render later on.
|
||||
* Sadly, Forge is pretty inconsistent when it will call the handlePerspective method, so some methods are called even on this interim-model.
|
||||
* Usually those methods only matter for rendering on the ground and other cases, where we wouldn't render the crafting output model anyway,
|
||||
* Since the ItemOverrideList handling comes before handling the perspective awareness (which is the first place
|
||||
* where we
|
||||
* know how we are being rendered) we need to remember the model of the crafting output, and make the decision on
|
||||
* which to render later on.
|
||||
* Sadly, Forge is pretty inconsistent when it will call the handlePerspective method, so some methods are called
|
||||
* even on this interim-model.
|
||||
* Usually those methods only matter for rendering on the ground and other cases, where we wouldn't render the
|
||||
* crafting output model anyway,
|
||||
* so in those cases we delegate to the model of the encoded pattern.
|
||||
*/
|
||||
private class ShiftHoldingModelWrapper implements IBakedModel
|
||||
@@ -199,10 +206,11 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Item Override Lists are the only point during item rendering where we can access the item stack that is being rendered.
|
||||
* So this is the point where we actually check if shift is being held, and if so, determine the crafting output model.
|
||||
* Item Override Lists are the only point during item rendering where we can access the item stack that is being
|
||||
* rendered.
|
||||
* So this is the point where we actually check if shift is being held, and if so, determine the crafting output
|
||||
* model.
|
||||
*/
|
||||
private class CustomOverrideList extends ItemOverrideList
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
@@ -54,7 +55,7 @@ class ItemEncodedPatternModel implements IModel
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms = PerspectiveMapWrapper.getTransforms(state);
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms = PerspectiveMapWrapper.getTransforms( state );
|
||||
|
||||
return new ItemEncodedPatternBakedModel( baseModel, transforms );
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
|
||||
@@ -67,19 +67,19 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.move(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
this.motionY -= 0.04D * (double) this.particleGravity;
|
||||
this.move( this.motionX, this.motionY, this.motionZ );
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
|
||||
if( this.isExpired )
|
||||
{
|
||||
|
||||
@@ -93,16 +93,32 @@ public class CraftingFx extends ParticleBreaking
|
||||
offY -= interpPosY;
|
||||
offZ -= interpPosZ;
|
||||
|
||||
int i = this.getBrightnessForRender(partialTick);
|
||||
int i = this.getBrightnessForRender( partialTick );
|
||||
int j = i >> 16 & 65535;
|
||||
int k = i & 65535;
|
||||
|
||||
// AELog.info( "" + partialTick );
|
||||
final float f14 = 1.0F;
|
||||
par1Tessellator.pos( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale ).tex( f7, f9 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale ).tex( f7, f8 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale ).tex( f6, f8 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale ).tex( f6, f9 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale )
|
||||
.tex( f7, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale )
|
||||
.tex( f7, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale )
|
||||
.tex( f6, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale )
|
||||
.tex( f6, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,15 +84,31 @@ public class EnergyFx extends ParticleBreaking
|
||||
|
||||
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
|
||||
{
|
||||
int i = this.getBrightnessForRender(partialTicks);
|
||||
int i = this.getBrightnessForRender( partialTicks );
|
||||
int j = i >> 16 & 65535;
|
||||
int k = i & 65535;
|
||||
|
||||
final float f14 = 1.0F;
|
||||
par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 ).tex( f7, f9 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 ).tex( f7, f8 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 ).tex( f6, f8 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 ).tex( f6, f9 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 )
|
||||
.tex( f7, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 )
|
||||
.tex( f7, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 )
|
||||
.tex( f6, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 )
|
||||
.tex( f6, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,19 +80,19 @@ public class LightningFX extends Particle
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.move(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
this.motionY -= 0.04D * (double) this.particleGravity;
|
||||
this.move( this.motionX, this.motionY, this.motionZ );
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,7 +190,8 @@ public class LightningFX extends Particle
|
||||
oz = ( xD * 0 ) - ( 1 * yD );
|
||||
}
|
||||
|
||||
final double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) LightningFX.STEPS - (double) s ) / LightningFX.STEPS ) * scale );
|
||||
final double ss = Math
|
||||
.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) LightningFX.STEPS - (double) s ) / LightningFX.STEPS ) * scale );
|
||||
ox /= ss;
|
||||
oy /= ss;
|
||||
oz /= ss;
|
||||
@@ -227,8 +228,16 @@ public class LightningFX extends Particle
|
||||
if( this.hasData )
|
||||
{
|
||||
tess.pos( a[0], a[1], a[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
|
||||
tess.pos( this.vertices[0], this.vertices[1], this.vertices[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
|
||||
tess.pos( this.verticesWithUV[0], this.verticesWithUV[1], this.verticesWithUV[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
|
||||
tess.pos( this.vertices[0], this.vertices[1], this.vertices[2] )
|
||||
.tex( f6, f8 )
|
||||
.color( red, green, blue, this.particleAlpha )
|
||||
.lightmap( BRIGHTNESS, BRIGHTNESS )
|
||||
.endVertex();
|
||||
tess.pos( this.verticesWithUV[0], this.verticesWithUV[1], this.verticesWithUV[2] )
|
||||
.tex( f6, f8 )
|
||||
.color( red, green, blue, this.particleAlpha )
|
||||
.lightmap( BRIGHTNESS, BRIGHTNESS )
|
||||
.endVertex();
|
||||
tess.pos( b[0], b[1], b[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
|
||||
}
|
||||
this.hasData = true;
|
||||
|
||||
@@ -97,13 +97,29 @@ public class MatterCannonFX extends ParticleBreaking
|
||||
final float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ );
|
||||
final float f14 = 1.0F;
|
||||
|
||||
int i = this.getBrightnessForRender(par2);
|
||||
int i = this.getBrightnessForRender( par2 );
|
||||
int j = i >> 16 & 65535;
|
||||
int k = i & 65535;
|
||||
|
||||
par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 ).tex( f7, f9 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 ).tex( f7, f8 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 ).tex( f6, f8 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 ).tex( f6, f9 ).color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ).lightmap( j, k ).endVertex();
|
||||
par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 )
|
||||
.tex( f7, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 )
|
||||
.tex( f7, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 )
|
||||
.tex( f6, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 )
|
||||
.tex( f6, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ public class AutoRotatingModel implements IBakedModel
|
||||
{
|
||||
this.parent = parent;
|
||||
// 6 (DUNSWE) * 6 (DUNSWE) * 7 (DUNSWE + null) = 252
|
||||
this.quadCache = CacheBuilder.newBuilder().maximumSize( 252 ).build( new CacheLoader<AutoRotatingCacheKey, List<BakedQuad>>(){
|
||||
this.quadCache = CacheBuilder.newBuilder().maximumSize( 252 ).build( new CacheLoader<AutoRotatingCacheKey, List<BakedQuad>>()
|
||||
{
|
||||
@Override
|
||||
public List<BakedQuad> load( AutoRotatingCacheKey key ) throws Exception
|
||||
{
|
||||
@@ -98,13 +99,8 @@ public class AutoRotatingModel implements IBakedModel
|
||||
// Packing it back to the vanilla vertex format will fix this inconsistency because it converts
|
||||
// the normal back to a byte-based format, which then re-applies Forge's own bug when piping it
|
||||
// to the AO lighter, thus fixing our problem.
|
||||
BakedQuad packedQuad = new BakedQuad( unpackedQuad.getVertexData(),
|
||||
quad.getTintIndex(),
|
||||
unpackedQuad.getFace(),
|
||||
quad.getSprite(),
|
||||
quad.shouldApplyDiffuseLighting(),
|
||||
quad.getFormat()
|
||||
);
|
||||
BakedQuad packedQuad = new BakedQuad( unpackedQuad.getVertexData(), quad.getTintIndex(), unpackedQuad.getFace(), quad.getSprite(), quad
|
||||
.shouldApplyDiffuseLighting(), quad.getFormat() );
|
||||
rotated.add( packedQuad );
|
||||
}
|
||||
return rotated;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
@@ -66,7 +67,8 @@ class BiometricCardBakedModel implements IBakedModel
|
||||
this.modelCache = modelCache;
|
||||
}
|
||||
|
||||
private static Cache<Integer, BiometricCardBakedModel> createCache() {
|
||||
private static Cache<Integer, BiometricCardBakedModel> createCache()
|
||||
{
|
||||
return CacheBuilder.newBuilder()
|
||||
.maximumSize( 100 )
|
||||
.build();
|
||||
@@ -124,7 +126,8 @@ class BiometricCardBakedModel implements IBakedModel
|
||||
else
|
||||
{
|
||||
final float scale = 0.3f / 255.0f;
|
||||
builder.setColorRGB( ( ( col.blackVariant >> 16 ) & 0xff ) * scale, ( ( col.blackVariant >> 8 ) & 0xff ) * scale, ( col.blackVariant & 0xff ) * scale );
|
||||
builder.setColorRGB( ( ( col.blackVariant >> 16 ) & 0xff ) * scale, ( ( col.blackVariant >> 8 ) & 0xff ) * scale,
|
||||
( col.blackVariant & 0xff ) * scale );
|
||||
}
|
||||
|
||||
builder.addCube( 4 + x, 6 + y, 7.5f, 4 + x + 1, 6 + y + 1, 8.5f );
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
@@ -18,7 +19,8 @@ import appeng.core.AppEng;
|
||||
|
||||
|
||||
/**
|
||||
* Model wrapper for the biometric card item model, which combines a base card layer with a "visual hash" of the player name
|
||||
* Model wrapper for the biometric card item model, which combines a base card layer with a "visual hash" of the player
|
||||
* name
|
||||
*/
|
||||
public class BiometricCardModel implements IModel
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
@@ -34,8 +35,7 @@ class ColorApplicatorBakedModel implements IBakedModel
|
||||
|
||||
private final List<BakedQuad> generalQuads;
|
||||
|
||||
ColorApplicatorBakedModel( IBakedModel baseModel, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map,
|
||||
TextureAtlasSprite texDark, TextureAtlasSprite texMedium, TextureAtlasSprite texBright )
|
||||
ColorApplicatorBakedModel( IBakedModel baseModel, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map, TextureAtlasSprite texDark, TextureAtlasSprite texMedium, TextureAtlasSprite texBright )
|
||||
{
|
||||
this.baseModel = baseModel;
|
||||
this.transforms = map;
|
||||
@@ -75,14 +75,8 @@ class ColorApplicatorBakedModel implements IBakedModel
|
||||
continue;
|
||||
}
|
||||
|
||||
BakedQuad newQuad = new BakedQuad(
|
||||
quad.getVertexData(),
|
||||
tint,
|
||||
quad.getFace(),
|
||||
quad.getSprite(),
|
||||
quad.shouldApplyDiffuseLighting(),
|
||||
quad.getFormat()
|
||||
);
|
||||
BakedQuad newQuad = new BakedQuad( quad.getVertexData(), tint, quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(), quad
|
||||
.getFormat() );
|
||||
result.add( newQuad );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
@@ -23,7 +24,8 @@ import appeng.core.AppEng;
|
||||
|
||||
|
||||
/**
|
||||
* A color applicator uses the base model, and extends it with additional layers that are colored according to the selected color of the applicator.
|
||||
* A color applicator uses the base model, and extends it with additional layers that are colored according to the
|
||||
* selected color of the applicator.
|
||||
*/
|
||||
public class ColorApplicatorModel implements IModel
|
||||
{
|
||||
@@ -46,8 +48,7 @@ public class ColorApplicatorModel implements IModel
|
||||
return ImmutableList.of(
|
||||
TEXTURE_DARK,
|
||||
TEXTURE_MEDIUM,
|
||||
TEXTURE_BRIGHT
|
||||
);
|
||||
TEXTURE_BRIGHT );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
@@ -49,8 +50,7 @@ public class DriveModel implements IModel
|
||||
DriveSlotState.OFFLINE, new ResourceLocation( "appliedenergistics2:block/drive_cell_off" ),
|
||||
DriveSlotState.ONLINE, new ResourceLocation( "appliedenergistics2:block/drive_cell_on" ),
|
||||
DriveSlotState.TYPES_FULL, new ResourceLocation( "appliedenergistics2:block/drive_cell_types_full" ),
|
||||
DriveSlotState.FULL, new ResourceLocation( "appliedenergistics2:block/drive_cell_full" )
|
||||
);
|
||||
DriveSlotState.FULL, new ResourceLocation( "appliedenergistics2:block/drive_cell_full" ) );
|
||||
|
||||
@Override
|
||||
public Collection<ResourceLocation> getDependencies()
|
||||
|
||||
@@ -134,14 +134,14 @@ class GlassBakedModel implements IBakedModel
|
||||
quads.add( createQuad( side, corners, glassTexture, u, v ) );
|
||||
|
||||
/*
|
||||
This needs some explanation:
|
||||
The bit-field contains 4-bits, one for each direction that a frame may be drawn.
|
||||
Converted to a number, the bit-field is then used as an index into the list of
|
||||
frame textures, which have been created in such a way that their filenames
|
||||
indicate, in which directions they contain borders.
|
||||
i.e. bitmask = 0101 means a border should be drawn up and down (in terms of u,v space).
|
||||
Converted to a number, this bitmask is 5. So the texture at index 5 is used.
|
||||
That texture had "0101" in its filename to indicate this.
|
||||
* This needs some explanation:
|
||||
* The bit-field contains 4-bits, one for each direction that a frame may be drawn.
|
||||
* Converted to a number, the bit-field is then used as an index into the list of
|
||||
* frame textures, which have been created in such a way that their filenames
|
||||
* indicate, in which directions they contain borders.
|
||||
* i.e. bitmask = 0101 means a border should be drawn up and down (in terms of u,v space).
|
||||
* Converted to a number, this bitmask is 5. So the texture at index 5 is used.
|
||||
* That texture had "0101" in its filename to indicate this.
|
||||
*/
|
||||
int edgeBitmask = makeBitmask( glassState, side );
|
||||
TextureAtlasSprite sideSprite = frameTextures[edgeBitmask];
|
||||
@@ -227,8 +227,9 @@ class GlassBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
/*
|
||||
This method is as complicated as it is, because the order in which we push data into the vertexbuffer actually has to be precisely the order
|
||||
in which the vertex elements had been declared in the vertex format.
|
||||
* This method is as complicated as it is, because the order in which we push data into the vertexbuffer actually
|
||||
* has to be precisely the order
|
||||
* in which the vertex elements had been declared in the vertex format.
|
||||
*/
|
||||
private void putVertex( UnpackedBakedQuad.Builder builder, Vec3d normal, double x, double y, double z, TextureAtlasSprite sprite, float u, float v )
|
||||
{
|
||||
|
||||
@@ -114,7 +114,8 @@ final class MatrixVertexTransformer extends QuadGatheringTransformer
|
||||
case 4:
|
||||
Vector4f vecc = new Vector4f( fs[0], fs[1], fs[2], fs[3] );
|
||||
// Otherwise all translation is lost
|
||||
if (elemCount == 3) {
|
||||
if( elemCount == 3 )
|
||||
{
|
||||
vecc.w = 1;
|
||||
}
|
||||
vecc.x -= 0.5f;
|
||||
|
||||
@@ -107,7 +107,8 @@ public class SkyCompassBakedModel implements IBakedModel
|
||||
transformer.setParent( builder );
|
||||
transformer.setVertexFormat( builder.getVertexFormat() );
|
||||
bakedQuad.pipe( transformer );
|
||||
builder.setQuadOrientation( null ); // After rotation, facing a specific side cannot be guaranteed anymore
|
||||
builder.setQuadOrientation( null ); // After rotation, facing a specific side cannot be guaranteed
|
||||
// anymore
|
||||
BakedQuad q = builder.build();
|
||||
quads.add( q );
|
||||
}
|
||||
@@ -150,8 +151,9 @@ public class SkyCompassBakedModel implements IBakedModel
|
||||
public ItemOverrideList getOverrides()
|
||||
{
|
||||
/*
|
||||
This handles setting the rotation of the compass when being held in hand. If it's not held in hand, it'll animate using the
|
||||
spinning animation.
|
||||
* This handles setting the rotation of the compass when being held in hand. If it's not held in hand, it'll
|
||||
* animate using the
|
||||
* spinning animation.
|
||||
*/
|
||||
return new ItemOverrideList( Collections.emptyList() )
|
||||
{
|
||||
@@ -188,7 +190,8 @@ public class SkyCompassBakedModel implements IBakedModel
|
||||
{
|
||||
CompassResult cr = CompassManager.INSTANCE.getCompassDirection( 0, pos.getX(), pos.getY(), pos.getZ() );
|
||||
|
||||
// Prefetch meteor positions from the server for adjacent blocks so they are available more quickly when we're moving
|
||||
// Prefetch meteor positions from the server for adjacent blocks so they are available more quickly when
|
||||
// we're moving
|
||||
if( prefetch )
|
||||
{
|
||||
for( int i = 0; i < 3; i++ )
|
||||
|
||||
@@ -106,7 +106,8 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
modifiers.set( faceBakery, faceBakery.getModifiers() & ( ~Modifier.FINAL ) );
|
||||
|
||||
Class clas = Class.forName( ModelLoader.class.getName() + "$VanillaModelWrapper" );
|
||||
vanillaModelWrapper = clas.getDeclaredConstructor( ModelLoader.class, ResourceLocation.class, ModelBlock.class, boolean.class, ModelBlockAnimation.class );
|
||||
vanillaModelWrapper = clas.getDeclaredConstructor( ModelLoader.class, ResourceLocation.class, ModelBlock.class, boolean.class,
|
||||
ModelBlockAnimation.class );
|
||||
vanillaModelWrapper.setAccessible( true );
|
||||
|
||||
Class<?> vanillaLoaderClass = Class.forName( ModelLoader.class.getName() + "$VanillaLoader" );
|
||||
@@ -190,7 +191,10 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
modelPath = modelPath.substring( "models/".length() );
|
||||
}
|
||||
try( InputStreamReader io = new InputStreamReader( Minecraft.getMinecraft().getResourceManager().getResource( new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) ).getInputStream() ) )
|
||||
try( InputStreamReader io = new InputStreamReader( Minecraft.getMinecraft()
|
||||
.getResourceManager()
|
||||
.getResource( new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) )
|
||||
.getInputStream() ) )
|
||||
{
|
||||
return gson.fromJson( io, UVLMarker.class ).uvlMarker;
|
||||
}
|
||||
@@ -209,7 +213,14 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
|
||||
public class UVLModelWrapper implements IModel
|
||||
{
|
||||
final Gson UVLSERIALIZER = ( new GsonBuilder() ).registerTypeAdapter( ModelBlock.class, deserializer( ModelBlock.class ) ).registerTypeAdapter( BlockPart.class, deserializer( BlockPart.class ) ).registerTypeAdapter( BlockPartFace.class, new BlockPartFaceOverrideSerializer() ).registerTypeAdapter( BlockFaceUV.class, deserializer( BlockFaceUV.class ) ).registerTypeAdapter( ItemTransformVec3f.class, deserializer( ItemTransformVec3f.class ) ).registerTypeAdapter( ItemCameraTransforms.class, deserializer( ItemCameraTransforms.class ) ).registerTypeAdapter( ItemOverride.class, deserializer( ItemOverride.class ) ).create();
|
||||
final Gson UVLSERIALIZER = ( new GsonBuilder() ).registerTypeAdapter( ModelBlock.class, deserializer( ModelBlock.class ) )
|
||||
.registerTypeAdapter( BlockPart.class, deserializer( BlockPart.class ) )
|
||||
.registerTypeAdapter( BlockPartFace.class, new BlockPartFaceOverrideSerializer() )
|
||||
.registerTypeAdapter( BlockFaceUV.class, deserializer( BlockFaceUV.class ) )
|
||||
.registerTypeAdapter( ItemTransformVec3f.class, deserializer( ItemTransformVec3f.class ) )
|
||||
.registerTypeAdapter( ItemCameraTransforms.class, deserializer( ItemCameraTransforms.class ) )
|
||||
.registerTypeAdapter( ItemOverride.class, deserializer( ItemOverride.class ) )
|
||||
.create();
|
||||
|
||||
private Map<BlockPartFace, Pair<Float, Float>> uvlightmap = new HashMap<>();
|
||||
|
||||
@@ -234,7 +245,8 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
String s = modelLocation.getResourcePath();
|
||||
|
||||
iresource = Minecraft.getMinecraft().getResourceManager().getResource( new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) );
|
||||
iresource = Minecraft.getMinecraft().getResourceManager().getResource(
|
||||
new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) );
|
||||
reader = new InputStreamReader( iresource.getInputStream(), Charsets.UTF_8 );
|
||||
|
||||
lvt_5_1_ = JsonUtils.gsonDeserialize( UVLSERIALIZER, reader, ModelBlock.class, false );
|
||||
@@ -339,7 +351,8 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
VertexFormat newFormat = VertexFormats.getFormatWithLightMap( quad.getFormat() );
|
||||
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder( newFormat );
|
||||
VertexLighterFlat trans = new VertexLighterFlat( Minecraft.getMinecraft().getBlockColors() ){
|
||||
VertexLighterFlat trans = new VertexLighterFlat( Minecraft.getMinecraft().getBlockColors() )
|
||||
{
|
||||
|
||||
@Override
|
||||
protected void updateLightmap( float[] normal, float[] lightmap, float x, float y, float z )
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.renderable;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
||||
@@ -129,7 +129,12 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
}
|
||||
}
|
||||
|
||||
builder.setTextures( textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.UP ) ), textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.DOWN ) ), textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.NORTH ) ), textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.SOUTH ) ), textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.EAST ) ), textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.WEST ) ) );
|
||||
builder.setTextures( textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.UP ) ),
|
||||
textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.DOWN ) ),
|
||||
textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.NORTH ) ),
|
||||
textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.SOUTH ) ),
|
||||
textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.EAST ) ),
|
||||
textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.WEST ) ) );
|
||||
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
||||
|
||||
if( ( flags & TileSpatialPylon.DISPLAY_POWERED_ENABLED ) == TileSpatialPylon.DISPLAY_POWERED_ENABLED )
|
||||
@@ -137,7 +142,12 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
builder.setRenderFullBright( true );
|
||||
}
|
||||
|
||||
builder.setTextures( textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.UP ) ), textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.DOWN ) ), textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.NORTH ) ), textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.SOUTH ) ), textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.EAST ) ), textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.WEST ) ) );
|
||||
builder.setTextures( textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.UP ) ),
|
||||
textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.DOWN ) ),
|
||||
textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.NORTH ) ),
|
||||
textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.SOUTH ) ),
|
||||
textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.EAST ) ),
|
||||
textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.WEST ) ) );
|
||||
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -40,7 +40,8 @@ import appeng.tile.grindstone.TileCrank;
|
||||
|
||||
|
||||
/**
|
||||
* This FastTESR only handles the animated model of the turning crank. When the crank is at rest, it is rendered using a normal model.
|
||||
* This FastTESR only handles the animated model of the turning crank. When the crank is at rest, it is rendered using a
|
||||
* normal model.
|
||||
*/
|
||||
@SideOnly( Side.CLIENT )
|
||||
public class CrankTESR extends TileEntitySpecialRenderer<TileCrank>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
GlStateManager.translate( (float) x, (float) y + 1.0F, (float) z + 1.0F );
|
||||
GlStateManager.scale( 1.0F, -1.0F, -1.0F );
|
||||
if( te != null )
|
||||
|
||||
@@ -78,8 +78,10 @@ public class SkyCompassTESR extends FastTESR<TileSkyCompass>
|
||||
// Flip forward/up for rendering, the base model is facing up without any rotation
|
||||
EnumFacing forward = exState.getValue( AEBaseTileBlock.FORWARD );
|
||||
EnumFacing up = exState.getValue( AEBaseTileBlock.UP );
|
||||
// This ensures the needle isn't flipped by the model rotator. Since the model is symmetrical, this should not affect the appearance
|
||||
if ( forward == EnumFacing.UP || forward == EnumFacing.DOWN ) {
|
||||
// This ensures the needle isn't flipped by the model rotator. Since the model is symmetrical, this should
|
||||
// not affect the appearance
|
||||
if( forward == EnumFacing.UP || forward == EnumFacing.DOWN )
|
||||
{
|
||||
up = EnumFacing.NORTH;
|
||||
}
|
||||
exState = exState.withProperty( AEBaseTileBlock.FORWARD, up )
|
||||
|
||||
Reference in New Issue
Block a user