Search in sources :

Example 1 with GuiContainerCreative

use of net.minecraft.client.gui.inventory.GuiContainerCreative in project Hyperium by HyperiumClient.

the class VanillaEnhancementsHud method onRenderArmor.

@InvokeEvent
public void onRenderArmor(GuiDrawScreenEvent e) {
    if ((Settings.ARMOR_PROT_POTENTIONAL || Settings.ARMOR_PROJ_POTENTIONAL) && (e.getScreen() instanceof GuiInventory || e.getScreen() instanceof GuiContainerCreative)) {
        ScaledResolution res = new ScaledResolution(mc);
        String message = getArmorString();
        mc.currentScreen.drawString(mc.fontRendererObj, message, 10, res.getScaledHeight() - 16, -1);
    }
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiInventory(net.minecraft.client.gui.inventory.GuiInventory) GuiContainerCreative(net.minecraft.client.gui.inventory.GuiContainerCreative) InvokeEvent(cc.hyperium.event.InvokeEvent)

Example 2 with GuiContainerCreative

use of net.minecraft.client.gui.inventory.GuiContainerCreative in project Galacticraft by micdoodle8.

the class LayoutManager method onPreDraw.

@Override
public void onPreDraw(GuiContainer gui) {
    if (// Reset the gui to the center of the screen, for potion effect offsets etc
    !isHidden() && isEnabled() && gui instanceof InventoryEffectRenderer) {
        gui.guiLeft = (gui.width - gui.xSize) / 2;
        gui.guiTop = (gui.height - gui.ySize) / 2;
        if (gui instanceof GuiContainerCreative && gui.buttonList.size() >= 2) {
            GuiButton button1 = (GuiButton) gui.buttonList.get(0);
            GuiButton button2 = (GuiButton) gui.buttonList.get(1);
            button1.xPosition = gui.guiLeft;
            button2.xPosition = gui.guiLeft + gui.xSize - 20;
        }
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) InventoryEffectRenderer(net.minecraft.client.renderer.InventoryEffectRenderer) GuiContainerCreative(net.minecraft.client.gui.inventory.GuiContainerCreative)

Aggregations

GuiContainerCreative (net.minecraft.client.gui.inventory.GuiContainerCreative)2 InvokeEvent (cc.hyperium.event.InvokeEvent)1 GuiButton (net.minecraft.client.gui.GuiButton)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 GuiInventory (net.minecraft.client.gui.inventory.GuiInventory)1 InventoryEffectRenderer (net.minecraft.client.renderer.InventoryEffectRenderer)1