2013-12-27 23:59:59 +01:00
|
|
|
package appeng.client.render.blocks;
|
|
|
|
|
|
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
|
|
|
import net.minecraft.client.renderer.Tessellator;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.world.IBlockAccess;
|
2014-03-02 09:35:11 +01:00
|
|
|
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.AEBaseBlock;
|
|
|
|
import appeng.client.render.BaseBlockRender;
|
2014-05-05 02:51:05 +02:00
|
|
|
import appeng.client.render.BusRenderHelper;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.client.render.BusRenderer;
|
|
|
|
import appeng.tile.AEBaseTile;
|
|
|
|
import appeng.tile.networking.TileCableBus;
|
|
|
|
|
|
|
|
public class RendererCableBus extends BaseBlockRender
|
|
|
|
{
|
|
|
|
|
|
|
|
public RendererCableBus() {
|
|
|
|
super( true, 30 );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-03-05 04:12:23 +01:00
|
|
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
// nothin.
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
|
|
|
{
|
|
|
|
AEBaseTile t = block.getTileEntity( world, x, y, z );
|
|
|
|
|
|
|
|
if ( t instanceof TileCableBus )
|
|
|
|
{
|
|
|
|
BusRenderer.instance.renderer.renderAllFaces = true;
|
|
|
|
BusRenderer.instance.renderer.blockAccess = renderer.blockAccess;
|
2014-03-15 07:58:21 +01:00
|
|
|
BusRenderer.instance.renderer.overrideBlockTexture = renderer.overrideBlockTexture;
|
2013-12-27 23:59:59 +01:00
|
|
|
((TileCableBus) t).cb.renderStatic( x, y, z );
|
|
|
|
BusRenderer.instance.renderer.renderAllFaces = false;
|
|
|
|
}
|
|
|
|
|
2014-05-05 02:51:05 +02:00
|
|
|
return BusRenderHelper.instance.getItemsRendered() > 0;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderTile(AEBaseBlock block, AEBaseTile t, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer)
|
|
|
|
{
|
|
|
|
if ( t instanceof TileCableBus )
|
|
|
|
{
|
2014-03-15 07:58:21 +01:00
|
|
|
BusRenderer.instance.renderer.overrideBlockTexture = null;
|
2013-12-27 23:59:59 +01:00
|
|
|
((TileCableBus) t).cb.renderDynamic( x, y, z );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|