DefaultBlockRenderer.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:DynamicLib 作者:
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    DynamicBlock dynamicBlock = (block instanceof DynamicBlock) ? (DynamicBlock) block : null;
    final TileEntity te;
    if (dynamicBlock != null && dynamicBlock.shouldRenderTesrInInventory())
        te = getTileEntityForBlock(dynamicBlock);
    else
        te = null;

    if (te instanceof DynamicTileEntity) ((DynamicTileEntity) te).prepareForInventoryRender(block, metadata);

    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    if (te != null) {
        GL11.glPushAttrib(GL11.GL_TEXTURE_BIT);
        GL11.glPushMatrix();
        GL11.glTranslated(-0.5, -0.5, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(te, 0.0D, 0.0D, 0.0D, 0.0F);
        GL11.glPopMatrix();
        GL11.glPopAttrib();
    }

    RenderUtils.renderInventoryBlock(renderer, block);
    RenderUtils.resetFacesOnRenderer(renderer);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号