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