本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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));
}
示例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);
}
}
}
示例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));
}
示例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();
}
示例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();
}
示例10: ItemRenderer
import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public ItemRenderer(Minecraft mcIn)
{
this.mc = mcIn;
this.renderManager = mcIn.getRenderManager();
this.itemRenderer = mcIn.getRenderItem();
}
示例11: GuiAchievement
import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public GuiAchievement(Minecraft mc)
{
this.mc = mc;
this.renderItem = mc.getRenderItem();
}