rest of BC commit
This commit is contained in:
@@ -24,6 +24,7 @@ import java.io.IOException;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -140,9 +141,9 @@ public class FacadeContainer implements IFacadeContainer
|
||||
if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
final IFacadePart created = bc.createFacadePart( Block.getStateById( ids[0] ), ids[1], side );
|
||||
final IBlockState state = Block.getStateById( ids[0] );
|
||||
final IFacadePart created = bc.createFacadePart( state, side );
|
||||
changed = changed || this.storage.getFacade( x ) == null;
|
||||
this.storage.setFacade( x, bc.createFacadePart( Block.getStateById( id[0] ), ids[1], side ) );
|
||||
|
||||
this.storage.setFacade( x, created );
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
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;
|
||||
@@ -129,7 +130,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
if( this.notAEFacade() && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
myIcon = bc.getFacadeTexture();
|
||||
myIcon = bc.getCobbleStructurePipeTexture();
|
||||
}
|
||||
|
||||
if( myIcon == null )
|
||||
@@ -217,14 +218,8 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
else
|
||||
{*/
|
||||
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()] );
|
||||
|
||||
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 )
|
||||
@@ -348,7 +343,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper instance, RenderBlocks renderer )
|
||||
public void renderInventory( IPartRenderHelper instance, IRenderHelper renderer )
|
||||
{
|
||||
if( this.facade != null )
|
||||
{
|
||||
@@ -356,47 +351,42 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
|
||||
try
|
||||
{
|
||||
if( fi != null )
|
||||
ItemStack randomItem = fi.getTextureItem( this.facade );
|
||||
|
||||
instance.setTexture( renderer.getIcon( facade ) );
|
||||
instance.setBounds( 7, 7, 4, 9, 9, 14 );
|
||||
instance.renderInventoryBox( renderer );
|
||||
instance.setTexture( null );
|
||||
|
||||
if( randomItem != null )
|
||||
{
|
||||
ItemStack randomItem = fi.getTextureItem( this.facade );
|
||||
|
||||
instance.setTexture( this.facade.getIconIndex() );
|
||||
instance.setBounds( 7, 7, 4, 9, 9, 14 );
|
||||
instance.renderInventoryBox( renderer );
|
||||
instance.setTexture( null );
|
||||
|
||||
if( randomItem != null )
|
||||
if( randomItem.getItem() instanceof ItemBlock )
|
||||
{
|
||||
if( randomItem.getItem() instanceof ItemBlock )
|
||||
ItemBlock ib = (ItemBlock) randomItem.getItem();
|
||||
Block blk = Block.getBlockFromItem( ib );
|
||||
|
||||
try
|
||||
{
|
||||
ItemBlock ib = (ItemBlock) randomItem.getItem();
|
||||
Block blk = Block.getBlockFromItem( ib );
|
||||
|
||||
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() ) ) );
|
||||
|
||||
instance.setBounds( 0, 0, 14, 16, 16, 16 );
|
||||
instance.renderInventoryBox( renderer );
|
||||
|
||||
instance.setTexture( null );
|
||||
int color = ib.getColorFromItemStack( randomItem, 0 );
|
||||
instance.setInvColor( color );
|
||||
}
|
||||
catch( Throwable error )
|
||||
{
|
||||
instance.setInvColor( 0xffffff );
|
||||
}
|
||||
|
||||
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 );
|
||||
|
||||
instance.setTexture( null );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Exception ignored )
|
||||
catch( Throwable ignored )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -404,7 +394,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection getSide()
|
||||
public AEPartLocation getSide()
|
||||
{
|
||||
return this.side;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user