本文整理匯總了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();
}