當前位置: 首頁>>代碼示例>>Java>>正文


Java Minecraft.getRenderItem方法代碼示例

本文整理匯總了Java中net.minecraft.client.Minecraft.getRenderItem方法的典型用法代碼示例。如果您正苦於以下問題:Java Minecraft.getRenderItem方法的具體用法?Java Minecraft.getRenderItem怎麽用?Java Minecraft.getRenderItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.Minecraft的用法示例。


在下文中一共展示了Minecraft.getRenderItem方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: renderItemInWorld

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public static void renderItemInWorld(ItemStack stack){
    if(!stack.isEmpty()){
        Minecraft mc = Minecraft.getMinecraft();
        RenderItem renderer = mc.getRenderItem();
        TextureManager manager = mc.getTextureManager();

        IBakedModel model = renderer.getItemModelWithOverrides(stack, null, null);

        manager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        manager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableBlend();
        GlStateManager.pushMatrix();
        model = ForgeHooksClient.handleCameraTransforms(model, ItemCameraTransforms.TransformType.FIXED, false);
        renderer.renderItem(stack, model);
        GlStateManager.cullFace(GlStateManager.CullFace.BACK);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
        GlStateManager.disableBlend();
        manager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        manager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
    }
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:25,代碼來源:Util.java

示例2: GuiIngame

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public GuiIngame(Minecraft mcIn)
{
    this.mc = mcIn;
    this.itemRenderer = mcIn.getRenderItem();
    this.overlayDebug = new GuiOverlayDebug(mcIn);
    this.spectatorGui = new GuiSpectator(mcIn);
    this.persistantChatGUI = new GuiNewChat(mcIn);
    this.streamIndicator = new GuiStreamIndicator(mcIn);
    this.overlayPlayerList = new GuiPlayerTabOverlay(mcIn, this);
    this.func_175177_a();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:12,代碼來源:GuiIngame.java

示例3: setWorldAndResolution

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
/**
 * Causes the screen to lay out its subcomponents again. This is the equivalent of the Java call
 * Container.validate()
 */
public void setWorldAndResolution(Minecraft mc, int width, int height)
{
    this.mc = mc;
    this.itemRender = mc.getRenderItem();
    this.fontRendererObj = mc.fontRendererObj;
    this.width = width;
    this.height = height;
    this.buttonList.clear();
    this.initGui();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:15,代碼來源:GuiScreen.java

示例4: GuiIngame

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public GuiIngame(Minecraft mcIn) {
	this.mc = mcIn;
	this.itemRenderer = mcIn.getRenderItem();
	this.overlayDebug = new GuiOverlayDebug(mcIn);
	this.spectatorGui = new GuiSpectator(mcIn);
	this.persistantChatGUI = new GuiNewChat(mcIn);
	this.streamIndicator = new GuiStreamIndicator(mcIn);
	this.overlayPlayerList = new GuiPlayerTabOverlay(mcIn, this);
	this.func_175177_a();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:11,代碼來源:GuiIngame.java

示例5: setWorldAndResolution

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
/**
 * Causes the screen to lay out its subcomponents again. This is the equivalent of the Java call
 * Container.validate()
 */
public void setWorldAndResolution(Minecraft mc, int width, int height)
{
    this.mc = mc;
    this.itemRender = mc.getRenderItem();
    this.fontRendererObj = mc.fontRendererObj;
    this.width = width;
    this.height = height;
    if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Pre(this, this.buttonList)))
    {
    this.buttonList.clear();
    this.initGui();
    }
    net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Post(this, this.buttonList));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:19,代碼來源:GuiScreen.java

示例6: renderZoomedStack

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
private static void renderZoomedStack(ItemStack itemStack, GuiContainer guiContainer, Minecraft minecraft) {
	ScaledResolution scaledResolution = new ScaledResolution(minecraft);
	final float scale = Config.getZoomAmount() / 100f * guiContainer.getGuiLeft() / 17f; // item is 16 wide, give it some extra space on each side
	final float xPosition = (guiContainer.getGuiLeft() / scale - 16f) / 2f;
	final float yPosition = (scaledResolution.getScaledHeight() / scale - 16f) / 2f;
	FontRenderer font = getFontRenderer(minecraft, itemStack);

	GlStateManager.pushMatrix();
	GlStateManager.scale(scale, scale, 1);
	GlStateManager.translate(xPosition, yPosition, 0);
	ZoomRenderHelper.enableGUIStandardItemLighting(scale);

	minecraft.getRenderItem().zLevel += 100;
	minecraft.getRenderItem().renderItemAndEffectIntoGUI(minecraft.player, itemStack, 0, 0);
	renderItemOverlayIntoGUI(font, itemStack);
	minecraft.getRenderItem().zLevel -= 100;
	GlStateManager.disableBlend();
	RenderHelper.disableStandardItemLighting();

	GlStateManager.popMatrix();

	if (Config.showHelpText()) {
		String modName = ItemZoom.MOD_NAME;
		int stringWidth = font.getStringWidth(modName);
		int x = (guiContainer.getGuiLeft() - stringWidth) / 2;
		int y = (scaledResolution.getScaledHeight() + Math.round(17 * scale)) / 2;
		font.drawString(modName, x, y, 4210752);

		if (Config.isToggledEnabled()) {
			String toggleText = KeyBindings.TOGGLE.getDisplayName();
			stringWidth = font.getStringWidth(toggleText);
			x = (guiContainer.getGuiLeft() - stringWidth) / 2;
			y += font.FONT_HEIGHT;
			font.drawString(toggleText, x, y, 4210752);
		}
	}
}
 
開發者ID:mezz,項目名稱:ItemZoom,代碼行數:38,代碼來源:EventHandler.java

示例7: initModels

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public static void initModels() {
	
	Minecraft mc = Minecraft.getMinecraft();
	RenderManager rm = mc.getRenderManager();
	RenderItem ri = mc.getRenderItem();
	
	RenderingRegistry.registerEntityRenderingHandler(EntityCustomPotion.class, new RenderThrowable(rm, UCItems.generic, 13, ri));
	RenderingRegistry.registerEntityRenderingHandler(EntityItemWeepingEye.class, new RenderThrowable(rm, UCItems.generic, 16, ri));
	RenderingRegistry.registerEntityRenderingHandler(EntityEulaBook.class, new RenderThrowable(rm, UCItems.generic, 24, ri));
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:12,代碼來源:UCEntities.java

示例8: GuiIngame

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public GuiIngame(Minecraft mcIn)
{
    this.mc = mcIn;
    this.itemRenderer = mcIn.getRenderItem();
    this.overlayDebug = new GuiOverlayDebug(mcIn);
    this.spectatorGui = new GuiSpectator(mcIn);
    this.persistantChatGUI = new GuiNewChat(mcIn);
    this.overlayPlayerList = new GuiPlayerTabOverlay(mcIn, this);
    this.overlayBoss = new GuiBossOverlay(mcIn);
    this.overlaySubtitle = new GuiSubtitleOverlay(mcIn);
    this.setDefaultTitlesTimes();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:13,代碼來源:GuiIngame.java

示例9: setWorldAndResolution

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
public void setWorldAndResolution(Minecraft mc, int width, int height) {
    super.setWorldAndResolution(mc, width, height);
    this.renderItem = mc.getRenderItem();

}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:7,代碼來源:TomeGui.java

示例10: ItemRenderer

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public ItemRenderer(Minecraft mcIn)
{
    this.mc = mcIn;
    this.renderManager = mcIn.getRenderManager();
    this.itemRenderer = mcIn.getRenderItem();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:7,代碼來源:ItemRenderer.java

示例11: GuiAchievement

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public GuiAchievement(Minecraft mc)
{
    this.mc = mc;
    this.renderItem = mc.getRenderItem();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:6,代碼來源:GuiAchievement.java


注:本文中的net.minecraft.client.Minecraft.getRenderItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。