java类net.minecraft.client.renderer.RenderBlocks的实例源码

RenderItemBlockGlassTank.java 文件源码 项目:Steam-and-Steel 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

    RenderBlocks renderblocks = (RenderBlocks) data[0];
    Block block = Block.getBlockFromItem(item.getItem());
    if (item.hasTagCompound()) {
        NBTTagCompound tag = item.stackTagCompound;
        if (tag.hasKey("Fluid")) {
            FluidStack liquid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("Fluid"));
            if (liquid != null) {
                GL11.glEnable(GL11.GL_BLEND);
                float height = ((float) liquid.amount / (float) 8000 * (float) 0.99);
                renderblocks.setRenderBounds(0.01, 0.01, 0.01, 0.99, height, 0.99);
                Utils.renderInventoryBlock(renderblocks, GrandFluidTank.renderblocks, liquid.getFluid());
                GL11.glDisable(GL11.GL_BLEND);
            }
        }

        GL11.glEnable(GL11.GL_ALPHA_TEST);
        renderblocks.setRenderBounds(0, 0, 0, 1, 1, 1);
        Utils.renderInventoryBlock(renderblocks, block, GrandFluidTank.glassfluidtank.getIcon(0, 0));
        GL11.glDisable(GL11.GL_ALPHA_TEST);

    }
}
RenderGlassTank.java 文件源码 项目:Steam-and-Steel 阅读 17 收藏 0 点赞 0 评论 0
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    if (modelId == renderID) {
        TileGlassFluidTank tank = (TileGlassFluidTank) world.getTileEntity(x, y, z);
        if (renderPass == 0) {
            if (tank.tank.getFluid() != null) {
                Fluid fluid = tank.tank.getFluid().getFluid();
                Utils.renderBlockByCompleteness(GrandFluidTank.renderblocks,fluid, world.getBlockMetadata(x, y, z), renderer, (double) tank.tank.getFluidAmount() / (double) tank.tank.getCapacity(), x, y, z);
            }
        }
        else if (renderPass == 1) {
            renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
            renderer.renderStandardBlock(block, x, y, z);
            renderer.setRenderFromInside(true);
            renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
            renderer.renderStandardBlock(block, x, y, z);
            renderer.setRenderFromInside(false);
        }
    }
    return true;
}
BlockChorusFlowerRender.java 文件源码 项目:connor41-etfuturum2 阅读 17 收藏 0 点赞 0 评论 0
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
    OpenGLHelper.translate(-0.5F, -0.5F, -0.5F);

    renderer.setRenderBounds(2 / 16F, 14 / 16F, 2 / 16F, 14 / 16F, 1, 14 / 16F);
    renderCube(renderer, block, meta);
    renderer.setRenderBounds(0, 2 / 16F, 2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F);
    renderCube(renderer, block, meta);
    renderer.setRenderBounds(2 / 16F, 2 / 16F, 0, 14 / 16F, 14 / 16F, 2 / 16F);
    renderCube(renderer, block, meta);
    renderer.setRenderBounds(2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F, 1);
    renderCube(renderer, block, meta);
    renderer.setRenderBounds(14 / 16F, 2 / 16F, 2 / 16F, 1, 14 / 16F, 14 / 16F);
    renderCube(renderer, block, meta);
    renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F);
    renderCube(renderer, block, meta);
}
BlockChorusFlowerRender.java 文件源码 项目:connor41-etfuturum2 阅读 18 收藏 0 点赞 0 评论 0
private void renderCube(RenderBlocks renderer, Block block, int meta) {
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
    tessellator.draw();
}
BlockChorusFlowerRender.java 文件源码 项目:connor41-etfuturum2 阅读 19 收藏 0 点赞 0 评论 0
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    renderer.renderAllFaces = true;

    renderer.setRenderBounds(2 / 16F, 14 / 16F, 2 / 16F, 14 / 16F, 1, 14 / 16F);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.setRenderBounds(0, 2 / 16F, 2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.setRenderBounds(2 / 16F, 2 / 16F, 0, 14 / 16F, 14 / 16F, 2 / 16F);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.setRenderBounds(2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F, 1);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.setRenderBounds(14 / 16F, 2 / 16F, 2 / 16F, 1, 14 / 16F, 14 / 16F);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.renderAllFaces = false;
    return true;
}
BlockInfusedBlockOreRenderer.java 文件源码 项目:ThaumOres 阅读 17 收藏 0 点赞 0 评论 0
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    block.setBlockBounds(0.005F, 0.005F, 0.005F, 0.995F, 0.995F, 0.995F);
    renderer.setRenderBoundsFromBlock(block);

    if (metadata < 6) {
        drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[0], ((BlockInfusedBlockOre) block).icon[1],
                ((BlockInfusedBlockOre) block).icon[2], ((BlockInfusedBlockOre) block).icon[3],
                ((BlockInfusedBlockOre) block).icon[4], ((BlockInfusedBlockOre) block).icon[5], false);
        Color c = new Color(BlockCustomOreItem.colors[metadata + 1]);
        float r = c.getRed() / 255.0F;
        float g = c.getGreen() / 255.0F;
        float b = c.getBlue() / 255.0F;
        GL11.glColor3f(r, g, b);
        block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
        renderer.setRenderBoundsFromBlock(block);
        drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[6], false);
        GL11.glColor3f(1.0F, 1.0F, 1.0F);
    }
}
RenderBlockFullBright.java 文件源码 项目:ExtraUtilities 阅读 17 收藏 0 点赞 0 评论 0
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
    final Tessellator var4 = Tessellator.instance;
    block.setBlockBoundsForItemRender();
    renderer.setRenderBoundsFromBlock(block);
    GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
    GL11.glTranslatef(-0.5f, -0.0f, -0.5f);
    final int l = block.getRenderColor(metadata);
    final float r = (l >> 16 & 0xFF) / 255.0f;
    final float g = (l >> 8 & 0xFF) / 255.0f;
    final float b = (l & 0xFF) / 255.0f;
    GL11.glColor4f(r, g, b, 1.0f);
    GL11.glDisable(2896);
    renderer.enableAO = false;
    var4.startDrawingQuads();
    var4.setNormal(0.0f, 1.0f, 0.0f);
    renderer.renderFaceYNeg(block, 0.0, -0.5, 0.0, block.getIcon(0, metadata));
    renderer.renderFaceYPos(block, 0.0, -0.5, 0.0, block.getIcon(1, metadata));
    renderer.renderFaceZNeg(block, 0.0, -0.5, 0.0, block.getIcon(2, metadata));
    renderer.renderFaceZPos(block, 0.0, -0.5, 0.0, block.getIcon(3, metadata));
    renderer.renderFaceXNeg(block, 0.0, -0.5, 0.0, block.getIcon(4, metadata));
    renderer.renderFaceXPos(block, 0.0, -0.5, 0.0, block.getIcon(5, metadata));
    var4.draw();
    GL11.glTranslatef(0.5f, 0.0f, 0.5f);
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glEnable(2896);
}
RenderBlockColor.java 文件源码 项目:ExtraUtilities 阅读 23 收藏 0 点赞 0 评论 0
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
    final Tessellator var8 = Tessellator.instance;
    final int i = world.getBlockMetadata(par2, par3, par4);
    float f = BlockColor.initColor[i][0];
    float f2 = BlockColor.initColor[i][1];
    float f3 = BlockColor.initColor[i][2];
    final TileEntity data = world.getTileEntity(BlockColorData.dataBlockX(par2), BlockColorData.dataBlockY(par3), BlockColorData.dataBlockZ(par4));
    if (data instanceof TileEntityBlockColorData) {
        f = ((TileEntityBlockColorData)data).palette[i][0];
        f2 = ((TileEntityBlockColorData)data).palette[i][1];
        f3 = ((TileEntityBlockColorData)data).palette[i][2];
    }
    if (EntityRenderer.anaglyphEnable) {
        final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
        final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
        final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
        f = f4;
        f2 = f5;
        f3 = f6;
    }
    return (Minecraft.isAmbientOcclusionEnabled() && par1Block.getLightValue() == 0) ? renderer.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, f, f2, f3) : renderer.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, f, f2, f3);
}
ItemRendererMachine.java 文件源码 项目:4Space-5 阅读 26 收藏 0 点赞 0 评论 0
private void renderCryogenicChamber(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    GL11.glPushMatrix();

    this.transform(type);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(ItemRendererMachine.chamberTexture0);
    this.model.renderPart("Main_Cylinder");

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(0.1F, 0.6F, 0.5F, 0.4F);

    this.model.renderPart("Shield_Torus");

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();
}
ModelCampfire.java 文件源码 项目:PrimitiveCraft 阅读 20 收藏 0 点赞 0 评论 0
public void renderFluid(float f5)
 {
    if(hasFluid && hasJug)
    {
        GL11.glPushMatrix();
        GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        float scale = 0.5F;
        GL11.glScalef(scale, scale, scale);
        GL11.glTranslatef(0f, 2.0F, 0f);

        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);

    RenderBlocks renderBlocks = RenderBlocks.getInstance();
      renderBlocks.setOverrideBlockTexture(fluidstack.getFluid().getStillIcon());
      renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0f);

      renderBlocks.clearOverrideBlockTexture();

GL11.glPopAttrib();
GL11.glPopMatrix();
    }
 }
BlockRendererCavernousVines.java 文件源码 项目:4Space-5 阅读 18 收藏 0 点赞 0 评论 0
public void renderBlockMeteor(RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(var1, par2, par3, par4));
    float f = 1.0F;
    int l = par1Block.colorMultiplier(var1, par2, par3, par4);
    float f1 = (l >> 16 & 255) / 255.0F;
    float f2 = (l >> 8 & 255) / 255.0F;
    float f3 = (l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f4;
        f2 = f5;
        f3 = f6;
    }

    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);

    renderBlocks.drawCrossedSquares(par1Block.getIcon(0, var1.getBlockMetadata(par2, par3, par4)), par2, par3, par4, 1.0F);
}
BlockRendererEgg.java 文件源码 项目:4Space-5 阅读 19 收藏 0 点赞 0 评论 0
public static void renderInvNormalBlock(RenderBlocks renderBlocks, Block par1Block, int var2)
{
    renderBlocks.setRenderBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.5F, 0.8F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.52F, 0.0F, 0.4F, 0.68F, 0.68F, 0.6F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.65F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.15F, 0.0F, 0.25F, 0.2F, 0.4F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.8F, 0.0F, 0.25F, 0.85F, 0.4F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.1F, 0.75F, 0.4F, 0.2F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.8F, 0.75F, 0.4F, 0.9F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.clearOverrideBlockTexture();
}
BlockRendererMachine.java 文件源码 项目:4Space-5 阅读 18 收藏 0 点赞 0 评论 0
public void renderMachineInWorld(RenderBlocks renderBlocks, IBlockAccess iblockaccess, Block par1Block, int x, int y, int z)
{
    par1Block.setBlockBoundsBasedOnState(iblockaccess, x, y, z);
    renderBlocks.setRenderBoundsFromBlock(par1Block);

    int metadata = iblockaccess.getBlockMetadata(x, y, z) & 12;

    if (metadata == BlockMachineMars.CRYOGENIC_CHAMBER_METADATA && par1Block == MarsBlocks.machine)
    {

    }
    else
    {
        renderBlocks.renderStandardBlock(par1Block, x, y, z);
    }

    renderBlocks.clearOverrideBlockTexture();
}
ItemRendererTier3Rocket.java 文件源码 项目:4Space-5 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
ItemRendererShortRangeTelepad.java 文件源码 项目:4Space-5 阅读 19 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
        break;
    }
}
ItemRendererWalkway.java 文件源码 项目:4Space-5 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
        break;
    }
}
ItemRendererAstroMiner.java 文件源码 项目:4Space-5 阅读 24 收藏 0 点赞 0 评论 0
protected void renderMiner(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    boolean saveCullState = GL11.glIsEnabled(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glPushMatrix();

    this.transform(item, type);
    GL11.glScalef(0.06F, 0.06F, 0.06F);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.texture);
    this.modelMiner.renderAll();
    GL11.glTranslatef(1.875F, 0F, 0F);
 this.modellasergl.renderAll();
    GL11.glTranslatef(-3.75F, 0F, 0F);
 this.modellasergr.renderAll();
    GL11.glPopMatrix();
    if (!saveCullState) GL11.glDisable(GL11.GL_CULL_FACE);
}
ItemRendererAstroMiner.java 文件源码 项目:4Space-5 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
ItemRendererBeamReflector.java 文件源码 项目:4Space-5 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
        break;
    }
}
ItemRendererBeamReceiver.java 文件源码 项目:4Space-5 阅读 18 收藏 0 点赞 0 评论 0
private void renderBeamReceiver(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    GL11.glPushMatrix();
    this.transform(type);

    GL11.glColor3f(1.0F, 1.0F, 1.0F);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(TileEntityBeamReceiverRenderer.receiverTexture);
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Main");
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Ring");

    GL11.glColor3f(0.6F, 0.3F, 0.0F);

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_CULL_FACE);
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Receiver");
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_CULL_FACE);

    GL11.glPopMatrix();
}
ItemRendererBuggy.java 文件源码 项目:4Space-5 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
ItemRendererThruster.java 文件源码 项目:4Space-5 阅读 16 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
ItemRendererTier1Rocket.java 文件源码 项目:4Space-5 阅读 28 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
ItemRendererKey.java 文件源码 项目:4Space-5 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case INVENTORY:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case ENTITY:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    default:
    }
}
ItemRendererMeteorChunk.java 文件源码 项目:4Space-5 阅读 17 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
ItemRendererFlag.java 文件源码 项目:4Space-5 阅读 23 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case INVENTORY:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case ENTITY:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    default:
    }
}
ItemRendererScreen.java 文件源码 项目:4Space-5 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
ForgeHooksClient.java 文件源码 项目:TRHS_Club_Mod_2016 阅读 25 收藏 0 点赞 0 评论 0
public static void renderEquippedItem(ItemRenderType type, IItemRenderer customRenderer, RenderBlocks renderBlocks, EntityLivingBase entity, ItemStack item)
{
    if (customRenderer.shouldUseRenderHelper(type, item, EQUIPPED_BLOCK))
    {
        GL11.glPushMatrix();
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
        customRenderer.renderItem(type, item, renderBlocks, entity);
        GL11.glPopMatrix();
    }
    else
    {
        GL11.glPushMatrix();
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glTranslatef(0.0F, -0.3F, 0.0F);
        GL11.glScalef(1.5F, 1.5F, 1.5F);
        GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
        GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
        customRenderer.renderItem(type, item, renderBlocks, entity);
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
    }
}
ModelJug.java 文件源码 项目:PrimitiveCraft 阅读 18 收藏 0 点赞 0 评论 0
public void renderFluid(float f5)
 {
    if(hasFluid)
    {
        GL11.glPushMatrix();
        GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        float scale = 0.5F;
        GL11.glScalef(scale, scale, scale);
        GL11.glTranslatef(0f, 2.0F, 0f);

        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);

    RenderBlocks renderBlocks = RenderBlocks.getInstance();
      renderBlocks.setOverrideBlockTexture(fluidstack.getFluid().getStillIcon());
      renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0f);

      renderBlocks.clearOverrideBlockTexture();

GL11.glPopAttrib();
GL11.glPopMatrix();
    }
 }
RenderWireDrawBench.java 文件源码 项目:TFCTech 阅读 19 收藏 0 点赞 0 评论 0
private void setRotatedRenderBounds(RenderBlocks renderer, byte rotation, float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
    switch (rotation) {
    case 0:
        renderer.setRenderBounds(minX, minY, minZ, maxX, maxY, maxZ);
        break;
    case 1:
        renderer.setRenderBounds(MAX_Z - maxZ - 1F + P, minY, minX, MAX_Z - minZ - 1F + P, maxY, maxX);
        break;
    case 2:
        renderer.setRenderBounds(1F - maxX, minY, MAX_Z - maxZ - 1F + P, 1F - minX, maxY, MAX_Z - minZ - 1F + P);
        break;
    case 3:
        renderer.setRenderBounds(minZ, minY, 1F - maxX, maxZ, maxY, 1F - minX);
        break;
    default:
        break;
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号