use of net.minecraft.client.renderer.RenderItem in project Solar by Martacus.
the class RenderUtil method renderLayingOnBlock.
public static void renderLayingOnBlock(ItemStack renderItem) {
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
if (!renderItem.isEmpty()) {
GlStateManager.translate(0.5, 1, 0.5);
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
GlStateManager.rotate(180, 0.0F, 1.0F, 1);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(renderItem, ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
use of net.minecraft.client.renderer.RenderItem in project Solar by Martacus.
the class RenderUtil method renderLayingOnBlockWithCoords.
public static void renderLayingOnBlockWithCoords(ItemStack renderItem, double x, double y, double z) {
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.translate(x, y, z);
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
GlStateManager.rotate(180, 0.0F, 1.0F, 1);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(renderItem, ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
use of net.minecraft.client.renderer.RenderItem in project BuildCraft by BuildCraft.
the class GuiUtil method drawItemStackAt.
public static void drawItemStackAt(ItemStack stack, int x, int y) {
RenderHelper.enableGUIStandardItemLighting();
Minecraft mc = Minecraft.getMinecraft();
RenderItem itemRender = mc.getRenderItem();
itemRender.renderItemAndEffectIntoGUI(mc.player, stack, x, y);
itemRender.renderItemOverlayIntoGUI(mc.fontRenderer, stack, x, y, null);
RenderHelper.disableStandardItemLighting();
}
use of net.minecraft.client.renderer.RenderItem in project RebornCore by TechReborn.
the class GuiButtonItemTexture method drawButton.
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float ticks) {
if (this.visible) {
boolean flag = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
int u = textureU;
int v = textureV;
if (flag) {
u += mc.fontRenderer.getStringWidth(this.NAME) + 25;
v += mc.fontRenderer.getStringWidth(this.NAME) + 25;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
this.drawTexturedModalRect(this.x, this.y, u, v, mc.fontRenderer.getStringWidth(this.NAME) + 25, height);
GL11.glPopMatrix();
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(32826);
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
itemRenderer.renderItemIntoGUI(itemstack, this.x, this.y);
this.drawString(mc.fontRenderer, this.NAME, this.x + 20, this.y + 3, Color.white.getRGB());
}
}
use of net.minecraft.client.renderer.RenderItem in project ImmersiveEngineering by BluSunrize.
the class GuiRevolver method drawExternalGUI.
public static void drawExternalGUI(NonNullList<ItemStack> bullets, int bulletAmount) {
ClientUtils.bindTexture("immersiveengineering:textures/gui/revolver.png");
GlStateManager.color(1, 1, 1, 1);
RenderHelper.disableStandardItemLighting();
ClientUtils.drawTexturedRect(0, 1, 74, 74, 0 / 256f, 74 / 256f, 51 / 256f, 125 / 256f);
if (bulletAmount >= 18)
ClientUtils.drawTexturedRect(47, 1, 103, 74, 74 / 256f, 177 / 256f, 51 / 256f, 125 / 256f);
else if (bulletAmount > 8)
ClientUtils.drawTexturedRect(57, 1, 79, 39, 57 / 256f, 136 / 256f, 12 / 256f, 51 / 256f);
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableDepth();
RenderItem ir = ClientUtils.mc().getRenderItem();
int[][] slots = ContainerRevolver.slotPositions[bulletAmount >= 18 ? 2 : bulletAmount > 8 ? 1 : 0];
for (int i = 0; i < bulletAmount; i++) {
ItemStack b = bullets.get(i);
if (!b.isEmpty()) {
int x;
int y;
if (i == 0) {
x = 29;
y = 3;
} else if (i - 1 < slots.length) {
x = slots[i - 1][0];
y = slots[i - 1][1];
} else {
int ii = i - (slots.length + 1);
x = ii == 0 ? 48 : ii == 1 ? 29 : ii == 3 ? 2 : 10;
y = ii == 1 ? 57 : ii == 3 ? 30 : ii == 4 ? 11 : 49;
}
ir.renderItemIntoGUI(b, x, y);
}
}
GlStateManager.disableDepth();
}
Aggregations