當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。