Most of the 1.8 Port.

This commit is contained in:
AlgorithmX2
2015-06-15 19:44:59 -05:00
parent 17465e68e8
commit 38afde724b
824 changed files with 12120 additions and 9158 deletions
+108 -107
View File
@@ -21,11 +21,7 @@ package appeng.facade;
import java.util.EnumSet;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
@@ -33,13 +29,12 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.api.AEApi;
import appeng.api.parts.IBoxProvider;
import appeng.api.parts.IFacadeContainer;
@@ -47,9 +42,11 @@ import appeng.api.parts.IFacadePart;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.parts.ISimplifiedBundle;
import appeng.api.util.AEPartLocation;
import appeng.client.render.BusRenderHelper;
import appeng.client.render.IRenderHelper;
import appeng.client.render.RenderBlocksWorkaround;
import appeng.client.texture.IAESprite;
import appeng.core.AELog;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
@@ -61,13 +58,10 @@ public class FacadePart implements IFacadePart, IBoxProvider
{
public final ItemStack facade;
public final ForgeDirection side;
public final AEPartLocation side;
public int thickness = 2;
@SideOnly( Side.CLIENT )
ISimplifiedBundle prevLight;
public FacadePart( ItemStack facade, ForgeDirection side )
public FacadePart( ItemStack facade, AEPartLocation side )
{
if( facade == null )
{
@@ -106,7 +100,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
@Override
@SideOnly( Side.CLIENT )
public void renderStatic( int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt )
public void renderStatic( BlockPos pos, IPartRenderHelper instance2, IRenderHelper renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt )
{
if( this.facade != null )
{
@@ -126,11 +120,11 @@ public class FacadePart implements IFacadePart, IBoxProvider
{
if( rbw != null )
{
rbw.isFacade = false;
rbw.calculations = true;
//rbw.isFacade = false;
//rbw.calculations = true;
}
IIcon myIcon = null;
IAESprite myIcon = null;
if( this.isBC() )
{
IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
@@ -139,7 +133,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
if( myIcon == null )
{
myIcon = this.facade.getIconIndex();
myIcon = renderer.getIcon( this.facade );
}
instance.setTexture( myIcon );
@@ -153,7 +147,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
instance.setBounds( 7, 7, 10, 9, 9, 15 );
}
instance.renderBlock( x, y, z, renderer );
instance.renderBlock( pos, renderer );
instance.setTexture( null );
}
@@ -174,7 +168,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
}
else
{
if( blk.canRenderInPass( 1 ) )
if( blk.canRenderInLayer( EnumWorldBlockLayer.TRANSLUCENT ) )
{
instance.renderForPass( 1 );
}
@@ -194,12 +188,13 @@ public class FacadePart implements IFacadePart, IBoxProvider
instance.setBounds( 0, 0, 16 - this.thickness, 16, 16, 16 );
instance.prepareBounds( renderer );
/*
if( rbw != null )
{
rbw.isFacade = true;
rbw.calculations = true;
rbw.faces = EnumSet.noneOf( ForgeDirection.class );
rbw.faces = EnumSet.noneOf( AEPartLocation.class );
if( this.prevLight != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, this.prevLight ) )
{
@@ -216,122 +211,130 @@ public class FacadePart implements IFacadePart, IBoxProvider
rbw.calculations = false;
rbw.faces = this.calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, this.side );
( (RenderBlocksWorkaround) renderer ).setTexture( blk.getIcon( ForgeDirection.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.UP.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.NORTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.SOUTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.WEST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.EAST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) );
( (RenderBlocksWorkaround) renderer ).setTexture( blk.getIcon( AEPartLocation.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( AEPartLocation.UP.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( AEPartLocation.NORTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( AEPartLocation.SOUTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( AEPartLocation.WEST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( AEPartLocation.EAST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) );
}
else
{
instance.setTexture( blk.getIcon( ForgeDirection.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.UP.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.NORTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.SOUTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.WEST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), blk.getIcon( ForgeDirection.EAST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) );
}
{*/
IAESprite[] icon_down = renderer.getIcon( blk.getDefaultState() );
instance.setTexture(
icon_down[EnumFacing.DOWN.ordinal()],
icon_down[EnumFacing.UP.ordinal()],
icon_down[EnumFacing.NORTH.ordinal()],
icon_down[EnumFacing.SOUTH.ordinal()],
icon_down[EnumFacing.WEST.ordinal()],
icon_down[EnumFacing.EAST.ordinal()] );
//}
if( busBounds == null )
{
if( this.side == ForgeDirection.UP || this.side == ForgeDirection.DOWN )
if( this.side == AEPartLocation.UP || this.side == AEPartLocation.DOWN )
{
instance.renderBlockCurrentBounds( x, y, z, renderer );
instance.renderBlockCurrentBounds( pos, renderer );
}
else if( this.side == ForgeDirection.NORTH || this.side == ForgeDirection.SOUTH )
else if( this.side == AEPartLocation.NORTH || this.side == AEPartLocation.SOUTH )
{
if( fc.getFacade( ForgeDirection.UP ) != null )
if( fc.getFacade( AEPartLocation.UP ) != null )
{
renderer.renderMaxY -= this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.DOWN ) != null )
if( fc.getFacade( AEPartLocation.DOWN ) != null )
{
renderer.renderMinY += this.thickness / 16.0;
}
instance.renderBlockCurrentBounds( x, y, z, renderer );
instance.renderBlockCurrentBounds( pos, renderer );
}
else
{
if( fc.getFacade( ForgeDirection.UP ) != null )
if( fc.getFacade( AEPartLocation.UP ) != null )
{
renderer.renderMaxY -= this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.DOWN ) != null )
if( fc.getFacade( AEPartLocation.DOWN ) != null )
{
renderer.renderMinY += this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.SOUTH ) != null )
if( fc.getFacade( AEPartLocation.SOUTH ) != null )
{
renderer.renderMaxZ -= this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.NORTH ) != null )
if( fc.getFacade( AEPartLocation.NORTH ) != null )
{
renderer.renderMinZ += this.thickness / 16.0;
}
instance.renderBlockCurrentBounds( x, y, z, renderer );
instance.renderBlockCurrentBounds( pos, renderer );
}
}
else
{
if( this.side == ForgeDirection.UP || this.side == ForgeDirection.DOWN )
if( this.side == AEPartLocation.UP || this.side == AEPartLocation.DOWN )
{
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, busBounds.minX, 1.0, busBounds.maxZ );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, busBounds.minZ, 1.0, 1.0, busBounds.maxZ );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, 0.0, busBounds.minZ, busBounds.minX, 1.0, busBounds.maxZ );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, busBounds.maxX, 0.0, busBounds.minZ, 1.0, 1.0, busBounds.maxZ );
}
else if( this.side == ForgeDirection.NORTH || this.side == ForgeDirection.SOUTH )
else if( this.side == AEPartLocation.NORTH || this.side == AEPartLocation.SOUTH )
{
if( fc.getFacade( ForgeDirection.UP ) != null )
if( fc.getFacade( AEPartLocation.UP ) != null )
{
renderer.renderMaxY -= this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.DOWN ) != null )
if( fc.getFacade( AEPartLocation.DOWN ) != null )
{
renderer.renderMinY += this.thickness / 16.0;
}
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, 0.0, 1.0, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, busBounds.minX, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, 0.0, 0.0, busBounds.maxX, busBounds.minY, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, busBounds.maxY, 0.0, busBounds.maxX, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, busBounds.maxX, 0.0, 0.0, 1.0, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, 0.0, 0.0, busBounds.minX, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, busBounds.minX, 0.0, 0.0, busBounds.maxX, busBounds.minY, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, busBounds.minX, busBounds.maxY, 0.0, busBounds.maxX, 1.0, 1.0 );
}
else
{
if( fc.getFacade( ForgeDirection.UP ) != null )
if( fc.getFacade( AEPartLocation.UP ) != null )
{
renderer.renderMaxY -= this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.DOWN ) != null )
if( fc.getFacade( AEPartLocation.DOWN ) != null )
{
renderer.renderMinY += this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.SOUTH ) != null )
if( fc.getFacade( AEPartLocation.SOUTH ) != null )
{
renderer.renderMaxZ -= this.thickness / 16.0;
}
if( fc.getFacade( ForgeDirection.NORTH ) != null )
if( fc.getFacade( AEPartLocation.NORTH ) != null )
{
renderer.renderMinZ += this.thickness / 16.0;
}
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, 1.0, busBounds.minY, busBounds.maxZ );
this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, busBounds.maxY, busBounds.minZ, 1.0, 1.0, busBounds.maxZ );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, 0.0, busBounds.minZ, 1.0, busBounds.minY, busBounds.maxZ );
this.renderSegmentBlockCurrentBounds( instance, pos, renderer, 0.0, busBounds.maxY, busBounds.minZ, 1.0, 1.0, busBounds.maxZ );
}
}
if( rbw != null )
{
rbw.opacity = 1.0f;
rbw.faces = EnumSet.allOf( ForgeDirection.class );
rbw.faces = EnumSet.allOf( EnumFacing.class );
}
instance.renderForPass( 0 );
instance.setTexture( null );
Tessellator.instance.setColorOpaque_F( 1, 1, 1 );
renderer.setColorOpaque_F( 1, 1, 1 );
}
}
}
@@ -363,85 +366,85 @@ public class FacadePart implements IFacadePart, IBoxProvider
return null;
}
private EnumSet<ForgeDirection> calculateFaceOpenFaces( IBlockAccess blockAccess, IFacadeContainer fc, int x, int y, int z, ForgeDirection side )
private EnumSet<AEPartLocation> calculateFaceOpenFaces( IBlockAccess blockAccess, IFacadeContainer fc, BlockPos pos, AEPartLocation side )
{
EnumSet<ForgeDirection> out = EnumSet.of( side, side.getOpposite() );
EnumSet<AEPartLocation> out = EnumSet.of( side, side.getOpposite() );
IFacadePart facade = fc.getFacade( side );
for( ForgeDirection it : ForgeDirection.VALID_DIRECTIONS )
for( AEPartLocation it : AEPartLocation.SIDE_LOCATIONS )
{
if( !out.contains( it ) && this.hasAlphaDiff( blockAccess.getTileEntity( x + it.offsetX, y + it.offsetY, z + it.offsetZ ), side, facade ) )
if( !out.contains( it ) && this.hasAlphaDiff( blockAccess.getTileEntity( pos.offset( it.getFacing() ) ), side, facade ) )
{
out.add( it );
}
}
if( out.contains( ForgeDirection.UP ) && ( side.offsetX != 0 || side.offsetZ != 0 ) )
if( out.contains( AEPartLocation.UP ) && ( side.xOffset != 0 || side.zOffset != 0 ) )
{
IFacadePart fp = fc.getFacade( ForgeDirection.UP );
IFacadePart fp = fc.getFacade( AEPartLocation.UP );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( ForgeDirection.UP );
out.remove( AEPartLocation.UP );
}
}
if( out.contains( ForgeDirection.DOWN ) && ( side.offsetX != 0 || side.offsetZ != 0 ) )
if( out.contains( AEPartLocation.DOWN ) && ( side.xOffset != 0 || side.zOffset != 0 ) )
{
IFacadePart fp = fc.getFacade( ForgeDirection.DOWN );
IFacadePart fp = fc.getFacade( AEPartLocation.DOWN );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( ForgeDirection.DOWN );
out.remove( AEPartLocation.DOWN );
}
}
if( out.contains( ForgeDirection.SOUTH ) && ( side.offsetX != 0 ) )
if( out.contains( AEPartLocation.SOUTH ) && ( side.xOffset != 0 ) )
{
IFacadePart fp = fc.getFacade( ForgeDirection.SOUTH );
IFacadePart fp = fc.getFacade( AEPartLocation.SOUTH );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( ForgeDirection.SOUTH );
out.remove( AEPartLocation.SOUTH );
}
}
if( out.contains( ForgeDirection.NORTH ) && ( side.offsetX != 0 ) )
if( out.contains( AEPartLocation.NORTH ) && ( side.xOffset != 0 ) )
{
IFacadePart fp = fc.getFacade( ForgeDirection.NORTH );
IFacadePart fp = fc.getFacade( AEPartLocation.NORTH );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( ForgeDirection.NORTH );
out.remove( AEPartLocation.NORTH );
}
}
/*
* if ( out.contains( ForgeDirection.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.EAST ); }
* if ( out.contains( AEPartLocation.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* AEPartLocation.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* AEPartLocation.EAST ); }
*
* if ( out.contains( ForgeDirection.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.WEST ); }
* if ( out.contains( AEPartLocation.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* AEPartLocation.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* AEPartLocation.WEST ); }
*
* if ( out.contains( ForgeDirection.NORTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.NORTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.NORTH ); }
* if ( out.contains( AEPartLocation.NORTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* AEPartLocation.NORTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* AEPartLocation.NORTH ); }
*
* if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.SOUTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.SOUTH ); }
* if ( out.contains( AEPartLocation.SOUTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* AEPartLocation.SOUTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* AEPartLocation.SOUTH ); }
*
* if ( out.contains( ForgeDirection.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.EAST ); }
* if ( out.contains( AEPartLocation.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* AEPartLocation.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* AEPartLocation.EAST ); }
*
* if ( out.contains( ForgeDirection.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.WEST ); }
* if ( out.contains( AEPartLocation.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* AEPartLocation.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* AEPartLocation.WEST ); }
*/
return out;
}
@SideOnly( Side.CLIENT )
private void renderSegmentBlockCurrentBounds( IPartRenderHelper instance, int x, int y, int z, RenderBlocks renderer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ )
private void renderSegmentBlockCurrentBounds( IPartRenderHelper instance, BlockPos pos, IRenderHelper renderer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ )
{
double oldMinX = renderer.renderMinX;
double oldMinY = renderer.renderMinY;
@@ -460,7 +463,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
// don't draw it if its not at least a pixel wide...
if( renderer.renderMaxX - renderer.renderMinX >= 1.0 / 16.0 && renderer.renderMaxY - renderer.renderMinY >= 1.0 / 16.0 && renderer.renderMaxZ - renderer.renderMinZ >= 1.0 / 16.0 )
{
instance.renderBlockCurrentBounds( x, y, z, renderer );
instance.renderBlockCurrentBounds( pos, renderer );
}
renderer.renderMinX = oldMinX;
@@ -471,7 +474,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
renderer.renderMaxZ = oldMaxZ;
}
private boolean hasAlphaDiff( TileEntity tileEntity, ForgeDirection side, IFacadePart facade )
private boolean hasAlphaDiff( TileEntity tileEntity, AEPartLocation side, IFacadePart facade )
{
if( tileEntity instanceof IPartHost )
{
@@ -483,10 +486,10 @@ public class FacadePart implements IFacadePart, IBoxProvider
return true;
}
@Override
@SideOnly( Side.CLIENT )
public void renderInventory( IPartRenderHelper instance, RenderBlocks renderer )
public void renderInventory( IPartRenderHelper instance, IRenderHelper renderer )
{
if( this.facade != null )
{
@@ -496,7 +499,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
{
ItemStack randomItem = fi.getTextureItem( this.facade );
instance.setTexture( this.facade.getIconIndex() );
instance.setTexture( renderer.getIcon( facade ) );
instance.setBounds( 7, 7, 4, 9, 9, 14 );
instance.renderInventoryBox( renderer );
instance.setTexture( null );
@@ -511,18 +514,16 @@ public class FacadePart implements IFacadePart, IBoxProvider
try
{
int color = ib.getColorFromItemStack( randomItem, 0 );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F );
instance.setInvColor( color );
}
catch( Throwable error )
{
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F );
instance.setInvColor( 0xffffff );
}
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_F( 1, 1, 1 );
instance.setTexture( blk.getIcon( this.side.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) );
renderer.setBrightness( 15 << 20 | 15 << 4 );
renderer.setColorOpaque_F( 1, 1, 1 );
instance.setTexture( renderer.getIcon( blk.getDefaultState() )[ side.ordinal() ] );
instance.setBounds( 0, 0, 14, 16, 16, 16 );
instance.renderInventoryBox( renderer );
@@ -539,7 +540,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
}
@Override
public ForgeDirection getSide()
public AEPartLocation getSide()
{
return this.side;
}