Search in sources :

Example 1 with TileEntityUVLightBox

use of pneumaticCraft.common.tileentity.TileEntityUVLightBox in project PneumaticCraft by MineMaarten.

the class ModelUVLightBox method renderStatic.

@Override
public void renderStatic(float size, TileEntity te) {
    if (te instanceof TileEntityUVLightBox) {
        TileEntityUVLightBox tile = (TileEntityUVLightBox) te;
        renderModel(size, tile.leftConnected, tile.rightConnected, tile.areLightsOn);
        if (blueprintEntity == null) {
            blueprintEntity = new EntityItem(tile.getWorldObj());
            blueprintEntity.setEntityItemStack(new ItemStack(Itemss.PCBBlueprint));
            blueprintEntity.hoverStart = 0.0F;
        }
        if (pcbEntity == null) {
            pcbEntity = new EntityItem(tile.getWorldObj());
            pcbEntity.setEntityItemStack(new ItemStack(Itemss.emptyPCB));
            pcbEntity.hoverStart = 0.0F;
        }
        // getGhostItemScaleFactor(tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX));
        float scaleFactor = 1.0F;
        // float rotationAngle = (float) (720.0 *
        // (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
        // GL11.glTranslatef(10F / 16F, (float)d1 + 2.0F / 16F, (float)d2 + 0.5F); // size
        // size
        GL11.glTranslatef(0, 22.0F / 16F, 2F / 16F);
        // translateGhostItemByOrientation(ghostEntityItem.getEntityItem(),
        // x, y, z, tileGlassBell.getOrientation());
        GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
        // GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
        GL11.glRotated(-90, 1, 0, 0);
        //GL11.glRotated(90, 0, 0, 1);
        boolean fancySetting = RenderManager.instance.options.fancyGraphics;
        RenderManager.instance.options.fancyGraphics = true;
        customRenderItem.doRender(blueprintEntity, 0, 0, 0, 0, 0);
        if (tile.inventory[TileEntityUVLightBox.PCB_INDEX] != null && tile.inventory[TileEntityUVLightBox.PCB_INDEX].getItem() == Itemss.emptyPCB) {
            GL11.glTranslated(0, 0, 0.5 / 16D);
            customRenderItem.doRender(pcbEntity, 0, 0, 0, 0, 0);
        }
        RenderManager.instance.options.fancyGraphics = fancySetting;
    } else {
        renderModel(size, false, false, false);
    }
}
Also used : TileEntityUVLightBox(pneumaticCraft.common.tileentity.TileEntityUVLightBox) ItemStack(net.minecraft.item.ItemStack) EntityItem(net.minecraft.entity.item.EntityItem)

Example 2 with TileEntityUVLightBox

use of pneumaticCraft.common.tileentity.TileEntityUVLightBox in project PneumaticCraft by MineMaarten.

the class BlockUVLightBox method getLightValue.

@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) {
    Block block = world.getBlock(x, y, z);
    if (block != null && block != this) {
        return block.getLightValue(world, x, y, z);
    }
    TileEntity te = world.getTileEntity(x, y, z);
    if (te != null && te instanceof TileEntityUVLightBox) {
        return ((TileEntityUVLightBox) te).getLightLevel();
    } else {
        return 0;
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityUVLightBox(pneumaticCraft.common.tileentity.TileEntityUVLightBox) Block(net.minecraft.block.Block)

Aggregations

TileEntityUVLightBox (pneumaticCraft.common.tileentity.TileEntityUVLightBox)2 Block (net.minecraft.block.Block)1 EntityItem (net.minecraft.entity.item.EntityItem)1 ItemStack (net.minecraft.item.ItemStack)1 TileEntity (net.minecraft.tileentity.TileEntity)1