本文整理汇总了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();
}
示例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();
}
示例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();
}