当前位置: 首页>>代码示例>>Java>>正文


Java RenderItem.doRender方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.entity.RenderItem.doRender方法的典型用法代码示例。如果您正苦于以下问题:Java RenderItem.doRender方法的具体用法?Java RenderItem.doRender怎么用?Java RenderItem.doRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.entity.RenderItem的用法示例。


在下文中一共展示了RenderItem.doRender方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderInventoryBlock

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    RenderItem itemRenderer = new RenderItem();

    ItemStack itemStackToRender = new ItemStack(block, 1, metadata);

    itemRenderer.setRenderManager(RenderManager.instance);
    EntityItem entityItemToRender = new EntityItem(Minecraft.getMinecraft().theWorld, 0, 0, 0, itemStackToRender);
    entityItemToRender.hoverStart = 0;

    float scaleItem = 1.5f;
    GL11.glPushMatrix();

    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
    GL11.glRotatef((float) (90f * Math.PI / 180f), 1, 0, 0);
    GL11.glScalef(scaleItem, scaleItem, scaleItem);
    itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0);
    GL11.glPopMatrix();
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:20,代码来源:RenderCampFire.java

示例2: renderItem

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
private void renderItem(TileEntityInventoryBase tileEnt,
		RenderItem itemRender, ItemStack stack, float x, float y, float z) {
	GL11.glPushMatrix();
	float scaleFactor = CoreUtil.getGhostItemScaleFactor(this.outputRender,
			stack);
	float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);

	EntityItem ghostEntityItem = new EntityItem(tileEnt.getWorldObj());
	ghostEntityItem.hoverStart = 0.0F;
	ghostEntityItem.setEntityItemStack(stack);

	GL11.glTranslatef(x, y, z);
	GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
	GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);

	itemRender.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
	GL11.glPopMatrix();
}
 
开发者ID:TheTemportalist,项目名称:CountryGamer_PlantsVsZombies,代码行数:19,代码来源:RenderGreenhouse.java

示例3: renderItemStack

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
private void renderItemStack(ItemStack stackToRender, RenderItem renderer, World world, double xRenderCoord,
        double yRenderCoord, double zRenderCoord, float rotation, float scale) {
    EntityItem entityItemToRender = new EntityItem(world, xRenderCoord, yRenderCoord, zRenderCoord, stackToRender);
    entityItemToRender.hoverStart = 0;

    float scaleItem = scale;
    GL11.glPushMatrix();
    bindTexture(TextureMap.locationBlocksTexture);
    GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), (float) zRenderCoord + 0.5f);
    GL11.glScalef(scaleItem, scaleItem, scaleItem);
    GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
    renderer.doRender(entityItemToRender, 0, 0, 0, 0, 0);
    GL11.glPopMatrix();
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:15,代码来源:TileEntityBrewingStandRenderer.java


注:本文中的net.minecraft.client.renderer.entity.RenderItem.doRender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。