当前位置: 首页>>代码示例>>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;未经允许,请勿转载。