use of net.minecraft.client.renderer.RenderItem in project ImmersiveEngineering by BluSunrize.
the class GuiButtonItem method drawButton.
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
ClientUtils.bindTexture("immersiveengineering:textures/gui/hudElements.png");
GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F);
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.blendFunc(770, 771);
this.drawTexturedModalRect(xPosition, yPosition, 24 + (state ? 18 : 0), 128, width, height);
this.mouseDragged(mc, mouseX, mouseY);
if (item != null) {
this.zLevel = 200.0F;
RenderItem itemRender = mc.getRenderItem();
itemRender.zLevel = 200.0F;
FontRenderer font = item.getItem().getFontRenderer(item);
if (font == null)
font = mc.fontRendererObj;
itemRender.renderItemAndEffectIntoGUI(item, xPosition + 1, yPosition + 1);
this.zLevel = 0.0F;
itemRender.zLevel = 0.0F;
if (!state) {
RenderHelper.enableStandardItemLighting();
GlStateManager.disableLighting();
GlStateManager.disableDepth();
ClientUtils.drawColouredRect(xPosition + 1, yPosition + 1, 16, 16, 0x77444444);
GlStateManager.enableLighting();
GlStateManager.enableDepth();
}
RenderHelper.disableStandardItemLighting();
}
}
}
use of net.minecraft.client.renderer.RenderItem in project SilentGems by SilentChaos512.
the class GuiQuiverArrowOverlay method renderArrow.
private void renderArrow(ItemStack stack, int count, EntityPlayer player) {
Minecraft mc = Minecraft.getMinecraft();
RenderItem itemRenderer = mc.getRenderItem();
FontRenderer fontRenderer = mc.fontRenderer;
ScaledResolution res = new ScaledResolution(mc);
int y = res.getScaledHeight() - 19;
int x = res.getScaledWidth() / 2 + 97;
itemRenderer.renderItemAndEffectIntoGUI(player, stack, x, y);
// this.itemRenderer.renderItemOverlays(this.mc.fontRenderer, stack, p_184044_1_, p_184044_2_);
String str = Integer.toString(count);
int strWidth = fontRenderer.getStringWidth(str);
fontRenderer.drawStringWithShadow(str, x + 14, y + 9, 0xFFFFFF);
}
use of net.minecraft.client.renderer.RenderItem in project ForestryMC by ForestryMC.
the class FarmLogicSlot method draw.
@Override
public void draw(int startX, int startY) {
if (!getStackIndex().isEmpty()) {
Minecraft minecraft = Minecraft.getMinecraft();
TextureManager textureManager = minecraft.getTextureManager();
textureManager.bindTexture(getLogic().getTextureMap());
RenderItem renderItem = minecraft.getRenderItem();
renderItem.renderItemIntoGUI(getStackIndex(), startX + xPos, startY + yPos);
}
}
use of net.minecraft.client.renderer.RenderItem in project TechReborn by TechReborn.
the class GuiAutoCrafting method renderItemStack.
public void renderItemStack(ItemStack stack, int x, int y) {
if (stack != EMPTY) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
itemRenderer.renderItemAndEffectIntoGUI(stack, x, y);
GL11.glDisable(GL11.GL_LIGHTING);
}
}
use of net.minecraft.client.renderer.RenderItem in project TechReborn by TechReborn.
the class ConfigSlotElement method draw.
@Override
public void draw(GuiBase gui) {
super.draw(gui);
ItemStack stack = inventory.getStackInSlot(id);
int xPos = x + 1 + gui.guiLeft;
int yPos = y + 1 + gui.guiTop;
GlStateManager.enableDepth();
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
renderItem.renderItemAndEffectIntoGUI(gui.mc.player, stack, xPos, yPos);
renderItem.renderItemOverlayIntoGUI(gui.mc.fontRenderer, stack, xPos, yPos, null);
GlStateManager.disableDepth();
GlStateManager.disableLighting();
GlStateManager.popMatrix();
if (isHovering) {
drawSprite(gui, type.getButtonHoverOverlay(), x, y);
}
elements.forEach(elementBase -> elementBase.draw(gui));
}
Aggregations