Fixes #2379: Changed texture of smooth sky stone chest to remove z-fighting between the overlapping parts. Added block-state files for both chests to fix both loading error logs and add a particle texture.

Fixed small alignment issue for the knob in the item model.
Fixed orientation issue of the chest (this only fixes north/south).
This commit is contained in:
Sebastian Hartte 2016-10-03 02:52:32 +02:00
parent af6310b13e
commit 044a9f3b8e
5 changed files with 38 additions and 13 deletions

View File

@ -22,6 +22,7 @@ package appeng.client.render.tesr;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -69,7 +70,6 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
}
else
{
// TODO 1.10.2-R - So this is weirdly half working. Either fix it or deal with it.
if( te != null )
{
this.bindTexture( ( (BlockSkyChest) te.getBlockType() ).type == SkyChestType.STONE ? TEXTURE_STONE : TEXTURE_BLOCK );
@ -82,21 +82,34 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
if( destroyStage < 0 )
{
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 );
GlStateManager.translate( 0.5F, 0.5F, 0.5F );
if( te != null )
{
FacingToRotation.get( te.getForward(), te.getUp() ).glRotateCurrentMat();
GlStateManager.translate( 0.5F, 0.5F, 0.5F );
// In the vanilla chest model, north and south are flipped
EnumFacing forward = te.getForward();
EnumFacing up = te.getUp();
if( forward == EnumFacing.SOUTH )
{
forward = EnumFacing.NORTH;
}
else if( forward == EnumFacing.NORTH )
{
forward = EnumFacing.SOUTH;
}
if( up == EnumFacing.SOUTH )
{
up = EnumFacing.NORTH;
}
else if( up == EnumFacing.NORTH )
{
up = EnumFacing.SOUTH;
}
FacingToRotation.get( forward, up ).glRotateCurrentMat();
GlStateManager.translate( -0.5F, -0.5F, -0.5F );
}
GlStateManager.translate( -0.5F, -0.5F, -0.5F );
float f = te != null ? te.getPrevLidAngle() + ( te.getLidAngle() - te.getPrevLidAngle() ) * partialTicks : 0;
f = 1.0F - f;

View File

@ -0,0 +1,6 @@
{
"__comment": "This block is rendered via TESR, so this is only used for the particle texture.",
"variants": {
"normal": { "model": "appliedenergistics2:sky_stone_block" }
}
}

View File

@ -0,0 +1,6 @@
{
"__comment": "This block is rendered via TESR, so this is only used for the particle texture.",
"variants": {
"normal": { "model": "appliedenergistics2:smooth_sky_stone_block" }
}
}

View File

@ -35,8 +35,8 @@
},
{
"name": "Knob",
"from": [ 7.0, 6.0, 0.0 ],
"to": [ 9.0, 10.0, 1.0 ],
"from": [ 7.0, 7.0, 0.0 ],
"to": [ 9.0, 11.0, 1.0 ],
"shade": false,
"faces": {
"north": { "texture": "#0", "uv": [ 0.25, 0.25, 0.75, 1.25 ] },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB