Search in sources :

Example 76 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class LogisticsHUDRenderer method displayOneView.

private void displayOneView(IHeadUpDisplayRendererProvider renderer, IHUDConfig config, float partialTick, boolean shifted) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    EntityPlayer player = mc.thePlayer;
    double x = renderer.getX() + 0.5 - player.prevPosX - ((player.posX - player.prevPosX) * partialTick);
    double y = renderer.getY() + 0.5 - player.prevPosY - ((player.posY - player.prevPosY) * partialTick);
    double z = renderer.getZ() + 0.5 - player.prevPosZ - ((player.posZ - player.prevPosZ) * partialTick);
    GL11.glTranslatef((float) x, (float) y, (float) z);
    GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(getAngle(z, x) + 90, 0.0F, 0.0F, 1.0F);
    GL11.glRotatef((-1) * getAngle(Math.hypot(x, z), y) + 180, 1.0F, 0.0F, 0.0F);
    GL11.glTranslatef(0.0F, 0.0F, -0.4F);
    GL11.glScalef(0.01F, 0.01F, 1F);
    renderer.getRenderer().renderHeadUpDisplay(Math.hypot(x, Math.hypot(y, z)), false, shifted, mc, config);
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) Minecraft(net.minecraft.client.Minecraft)

Example 77 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class ThaumCraftProxy method renderAspectAt.

/**
	 * Used to render a icon of an aspect at a give x and y on top of a given
	 * GuiScreen.
	 * 
	 * @param tag
	 *            The EnumTag (aspect) to render
	 * @param x
	 * @param y
	 * @param gui
	 *            The gui to render on.
	 */
private void renderAspectAt(Aspect tag, int x, int y, GuiScreen gui, int amount, boolean drawBackground) {
    if (!(tag instanceof Aspect)) {
        return;
    }
    Minecraft mc = FMLClientHandler.instance().getClient();
    if (drawBackground) {
        UtilsFX.bindTexture("textures/aspects/_back.png");
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glTranslated(x - 2, y - 2, 0.0D);
        GL11.glScaled(1.25D, 1.25D, 0.0D);
        UtilsFX.drawTexturedQuadFull(0, 0, gui.zLevel);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
    }
    if (Thaumcraft.proxy.playerKnowledge.hasDiscoveredAspect(mc.thePlayer.getDisplayName(), tag)) {
        UtilsFX.drawTag(x, y, tag, amount, 0, gui.zLevel);
    } else {
        UtilsFX.bindTexture("textures/aspects/_unknown.png");
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glTranslated(x, y, 0.0D);
        UtilsFX.drawTexturedQuadFull(0, 0, gui.zLevel);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
    }
}
Also used : Aspect(thaumcraft.api.aspects.Aspect) Minecraft(net.minecraft.client.Minecraft)

Example 78 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class DisconnectionConfigurationPopup method drawGuiContainerForegroundLayer.

@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY, float partialTick) {
    drawRect(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height, 0xff000000);
    Minecraft mc = Minecraft.getMinecraft();
    ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
    int vpx = bounds.x * scaledresolution.getScaleFactor();
    int vpy = (bounds.y + 10) * scaledresolution.getScaleFactor();
    int w = bounds.width * scaledresolution.getScaleFactor();
    int h = (bounds.height - 1) * scaledresolution.getScaleFactor();
    mc.fontRenderer.drawString(StringUtils.translate(PREFIX + "disconnectTitle"), guiLeft + 8, guiTop + 8, logisticspipes.utils.Color.getValue(logisticspipes.utils.Color.DARKER_GREY), false);
    configDisplay.drawScreen(mouseX, mouseY, partialTick, new Rectangle(vpx, vpy, w, h), bounds);
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) Rectangle(java.awt.Rectangle) Minecraft(net.minecraft.client.Minecraft)

Example 79 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class HUDElectricManager method renderContent.

@Override
public void renderContent(boolean shifted) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    GL11.glScalef(1.0F, 1.0F, -0.000001F);
    ItemStackRenderer.renderItemIdentifierStackListIntoGui(ItemIdentifierStack.getListFromInventory(module.getFilterInventory()), null, 0, -25, -32, 3, 9, 18, 18, 100.0F, DisplayAmount.NEVER, true, false, shifted);
    GL11.glScalef(1.0F, 1.0F, 1 / -0.000001F);
    mc.fontRenderer.drawString("Charge:", -29, 25, 0);
    if (module.isDischargeMode()) {
        mc.fontRenderer.drawString("No", 15, 25, 0);
    } else {
        mc.fontRenderer.drawString("Yes", 11, 25, 0);
    }
}
Also used : Minecraft(net.minecraft.client.Minecraft)

Example 80 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class HUDExtractor method renderContent.

@Override
public void renderContent(boolean shifted) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    ForgeDirection d = module.getSneakyDirection();
    mc.fontRenderer.drawString("Extract", -22, -22, 0);
    mc.fontRenderer.drawString("from:", -22, -9, 0);
    mc.fontRenderer.drawString(((d == ForgeDirection.UNKNOWN) ? "DEFAULT" : d.name()), -22, 18, 0);
}
Also used : ForgeDirection(net.minecraftforge.common.util.ForgeDirection) Minecraft(net.minecraft.client.Minecraft)

Aggregations

Minecraft (net.minecraft.client.Minecraft)100 ItemStack (net.minecraft.item.ItemStack)17 ScaledResolution (net.minecraft.client.gui.ScaledResolution)15 EntityPlayer (net.minecraft.entity.player.EntityPlayer)15 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)10 ResourceLocation (net.minecraft.util.ResourceLocation)8 ArrayList (java.util.ArrayList)7 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)7 FontRenderer (net.minecraft.client.gui.FontRenderer)6 WorldClient (net.minecraft.client.multiplayer.WorldClient)6 World (net.minecraft.world.World)6 Tessellator (net.minecraft.client.renderer.Tessellator)5 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)5 Block (net.minecraft.block.Block)4 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)4 IRenderHandler (net.minecraftforge.client.IRenderHandler)4 SimplePageView (com.almuradev.almura.feature.guide.client.gui.SimplePageView)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 Field (java.lang.reflect.Field)3 GuiScreen (net.minecraft.client.gui.GuiScreen)3