Search in sources :

Example 56 with Minecraft

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

the class HUDProviderModule method renderContent.

@Override
public void renderContent(boolean shifted) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    GL11.glScalef(1.0F, 1.0F, -0.00001F);
    ItemStackRenderer.renderItemIdentifierStackListIntoGui(module.displayList, null, page, -25, -24, 3, 9, 18, 18, 100.0F, DisplayAmount.ALWAYS, true, false, shifted);
    GL11.glScalef(1.0F, 1.0F, 1 / -0.00001F);
}
Also used : Minecraft(net.minecraft.client.Minecraft)

Example 57 with Minecraft

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

the class SneakyConfigurationPopup 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 + "sneakyTitle"), guiLeft + 8, guiTop + 8, Color.getValue(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 58 with Minecraft

use of net.minecraft.client.Minecraft in project malmo by Microsoft.

the class AuthenticationHelper method setSession.

private static boolean setSession(Session newSession) {
    // Are we in the dev environment or deployed?
    boolean devEnv = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
    // We need to know, because the member name will either be obfuscated or not.
    String sessionMemberName = devEnv ? "session" : "field_71449_j";
    // NOTE: obfuscated name may need updating if Forge changes - search for "session" in Malmo\Minecraft\build\tasklogs\retromapSources.log
    Field session;
    try {
        session = Minecraft.class.getDeclaredField(sessionMemberName);
        session.setAccessible(true);
        session.set(Minecraft.getMinecraft(), newSession);
        return true;
    } catch (SecurityException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (NoSuchFieldException e) {
        e.printStackTrace();
    }
    return false;
}
Also used : Field(java.lang.reflect.Field) Minecraft(net.minecraft.client.Minecraft)

Example 59 with Minecraft

use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.

the class GuiHelmetMainScreen method init.

public static void init() {
    instance = new GuiHelmetMainScreen();
    Minecraft minecraft = FMLClientHandler.instance().getClient();
    ScaledResolution scaledresolution = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
    int width = scaledresolution.getScaledWidth();
    int height = scaledresolution.getScaledHeight();
    instance.setWorldAndResolution(minecraft, width, height);
    for (int i = 1; i < instance.upgradePages.size(); i++) {
        page = i;
        instance.initGui();
    }
    page = 0;
    instance.init = false;
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) Minecraft(net.minecraft.client.Minecraft)

Example 60 with Minecraft

use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.

the class SearchUpgradeHandler method getAnimatedStat.

@Override
@SideOnly(Side.CLIENT)
public GuiAnimatedStat getAnimatedStat() {
    if (searchInfo == null) {
        Minecraft minecraft = Minecraft.getMinecraft();
        ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
        searchInfo = new GuiAnimatedStat(null, "Currently searching for:", new ItemStack(Itemss.machineUpgrade, 1, ItemMachineUpgrade.UPGRADE_SEARCH_DAMAGE), statX != -1 ? statX : sr.getScaledWidth() - 2, statY, 0x3000AA00, null, statLeftSided);
        searchInfo.setMinDimensionsAndReset(0, 0);
    }
    return searchInfo;
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat) ItemStack(net.minecraft.item.ItemStack) Minecraft(net.minecraft.client.Minecraft) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

Minecraft (net.minecraft.client.Minecraft)84 ScaledResolution (net.minecraft.client.gui.ScaledResolution)15 ItemStack (net.minecraft.item.ItemStack)15 EntityPlayer (net.minecraft.entity.player.EntityPlayer)13 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)10 ResourceLocation (net.minecraft.util.ResourceLocation)7 FontRenderer (net.minecraft.client.gui.FontRenderer)6 Tessellator (net.minecraft.client.renderer.Tessellator)6 ArrayList (java.util.ArrayList)5 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)5 SideOnly (cpw.mods.fml.relauncher.SideOnly)4 WorldClient (net.minecraft.client.multiplayer.WorldClient)4 VertexBuffer (net.minecraft.client.renderer.VertexBuffer)3 World (net.minecraft.world.World)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 GuiAnimatedStat (pneumaticCraft.client.gui.widget.GuiAnimatedStat)3 Rectangle (java.awt.Rectangle)2 File (java.io.File)2 Field (java.lang.reflect.Field)2 Block (net.minecraft.block.Block)2