Search in sources :

Example 1 with GuiScreen

use of net.minecraft.client.gui.GuiScreen in project RecurrentComplex by Ivorforce.

the class GuiHider method reopenGUI.

public static boolean reopenGUI() {
    if (!canReopen())
        return false;
    GuiScreen hiddenGUI = GuiHider.hiddenGUI;
    GuiHider.hiddenGUI = null;
    Minecraft mc = Minecraft.getMinecraft();
    mc.displayGuiScreen(hiddenGUI);
    if (mc.currentScreen == null) {
        GuiHider.hiddenGUI = hiddenGUI;
        return false;
    }
    return true;
}
Also used : GuiScreen(net.minecraft.client.gui.GuiScreen) Minecraft(net.minecraft.client.Minecraft)

Example 2 with GuiScreen

use of net.minecraft.client.gui.GuiScreen in project BetterStorage by copygirl.

the class PlayerUtils method openGui.

@SideOnly(Side.CLIENT)
public static void openGui(EntityPlayer player, String name, int columns, int rows, String title) {
    GuiScreen gui = createGuiFromName(player, name, columns, rows, title);
    Minecraft.getMinecraft().displayGuiScreen(gui);
}
Also used : GuiScreen(net.minecraft.client.gui.GuiScreen) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 3 with GuiScreen

use of net.minecraft.client.gui.GuiScreen in project BluePower by Qmunity.

the class ContainerCircuitTable method updateProgressBar.

@Override
@SideOnly(Side.CLIENT)
public void updateProgressBar(int p_75137_1_, int p_75137_2_) {
    circuitTable.slotsScrolled = p_75137_2_;
    GuiScreen gui = Minecraft.getMinecraft().currentScreen;
    if (gui instanceof GuiCircuitTable) {
        ((GuiCircuitTable) gui).updateScrollbar(circuitTable.slotsScrolled);
    }
}
Also used : GuiCircuitTable(com.bluepowermod.client.gui.GuiCircuitTable) GuiScreen(net.minecraft.client.gui.GuiScreen) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 4 with GuiScreen

use of net.minecraft.client.gui.GuiScreen in project BluePower by Qmunity.

the class GateBase method renderItem.

@Override
@SideOnly(Side.CLIENT)
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    if (this instanceof ISilkyRemovable) {
        if (this instanceof IAdvancedSilkyRemovable) {
            ((IAdvancedSilkyRemovable) this).readSilkyData(null, 0, 0, 0, item.hasTagCompound() ? item.getTagCompound().getCompoundTag("tileData") : new NBTTagCompound());
        } else {
            readFromNBT(item.hasTagCompound() ? item.getTagCompound().getCompoundTag("tileData") : new NBTTagCompound());
        }
    }
    GL11.glPushMatrix();
    {
        RenderHelper rh = RenderHelper.instance;
        rh.reset();
        if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
            GL11.glTranslated(-0.25, 0.75, 0.25);
        }
        if (type == ItemRenderType.ENTITY && item.getItemFrame() != null) {
            GL11.glTranslated(19 / 32D, 8 / 16D, 1);
            GL11.glRotated(-90, 0, 0, 1);
            GL11.glRotated(90, 0, 1, 0);
        }
        if (type == ItemRenderType.INVENTORY && BluePower.proxy.isSneakingInGui()) {
            GuiScreen gui = Minecraft.getMinecraft().currentScreen;
            if (gui != null && gui instanceof GuiContainer) {
                GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(-210F, 1.0F, 0.0F, 0.0F);
                GL11.glScaled(1.5, 1.5, 1.5);
                GL11.glTranslated(-0.5, 0, 0);
                GL11.glTranslated(0, -0.5, 0);
                GL11.glRotated(-90, 1, 0, 0);
                GL11.glTranslated(0, 0.5, 0);
            }
        }
        Tessellator.instance.startDrawingQuads();
        if (shouldRenderOnPass(0))
            renderStatic(new Vec3i(0, 0, 0), rh, RenderBlocks.getInstance(), 0);
        rh.reset();
        if (shouldRenderOnPass(1))
            renderStatic(new Vec3i(0, 0, 0), rh, RenderBlocks.getInstance(), 1);
        rh.reset();
        Tessellator.instance.draw();
        if (shouldRenderOnPass(0))
            renderDynamic(new Vec3d(0, 0, 0), 0, 0);
        if (shouldRenderOnPass(1))
            renderDynamic(new Vec3d(0, 0, 0), 0, 1);
    }
    GL11.glPopMatrix();
}
Also used : Vec3i(uk.co.qmunity.lib.vec.Vec3i) RenderHelper(uk.co.qmunity.lib.client.render.RenderHelper) IAdvancedSilkyRemovable(com.bluepowermod.api.block.IAdvancedSilkyRemovable) ISilkyRemovable(com.bluepowermod.api.block.ISilkyRemovable) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) GuiScreen(net.minecraft.client.gui.GuiScreen) GuiContainer(net.minecraft.client.gui.inventory.GuiContainer) Vec3d(uk.co.qmunity.lib.vec.Vec3d) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 5 with GuiScreen

use of net.minecraft.client.gui.GuiScreen in project PneumaticCraft by MineMaarten.

the class ClientEventHandler method onItemTooltip.

@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event) {
    if (event.itemStack.getItem() instanceof IProgrammable) {
        IProgrammable programmable = (IProgrammable) event.itemStack.getItem();
        if (programmable.canProgram(event.itemStack) && programmable.showProgramTooltip()) {
            boolean hasInvalidPrograms = false;
            List<String> addedEntries = new ArrayList<String>();
            Map<String, Integer> widgetMap = getPuzzleSummary(TileEntityProgrammer.getProgWidgets(event.itemStack));
            for (Map.Entry<String, Integer> entry : widgetMap.entrySet()) {
                IProgWidget widget = ItemProgrammingPuzzle.getWidgetForName(entry.getKey());
                String prefix = "";
                GuiScreen curScreen = Minecraft.getMinecraft().currentScreen;
                if (curScreen instanceof IGuiDrone) {
                    if (!((IGuiDrone) curScreen).getDrone().isProgramApplicable(widget)) {
                        prefix = EnumChatFormatting.RED + "";
                        hasInvalidPrograms = true;
                    }
                }
                addedEntries.add(prefix + "-" + entry.getValue() + "x " + I18n.format("programmingPuzzle." + entry.getKey() + ".name"));
            }
            if (hasInvalidPrograms) {
                event.toolTip.add(EnumChatFormatting.RED + I18n.format("gui.tooltip.programmable.invalidPieces"));
            }
            Collections.sort(addedEntries);
            event.toolTip.addAll(addedEntries);
        }
    }
}
Also used : IProgWidget(pneumaticCraft.common.progwidgets.IProgWidget) IProgrammable(pneumaticCraft.api.item.IProgrammable) IGuiDrone(pneumaticCraft.client.gui.IGuiDrone) ArrayList(java.util.ArrayList) GuiScreen(net.minecraft.client.gui.GuiScreen) HashMap(java.util.HashMap) Map(java.util.Map) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Aggregations

GuiScreen (net.minecraft.client.gui.GuiScreen)14 SideOnly (cpw.mods.fml.relauncher.SideOnly)5 ItemStack (net.minecraft.item.ItemStack)3 IProgWidget (pneumaticCraft.common.progwidgets.IProgWidget)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 GuiContainer (net.minecraft.client.gui.inventory.GuiContainer)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 GuiHudCustomization (am2.guis.GuiHudCustomization)1 IAdvancedSilkyRemovable (com.bluepowermod.api.block.IAdvancedSilkyRemovable)1 ISilkyRemovable (com.bluepowermod.api.block.ISilkyRemovable)1 GuiCircuitTable (com.bluepowermod.client.gui.GuiCircuitTable)1 IPacketIDReceiver (com.builtbroken.mc.core.network.IPacketIDReceiver)1 IPacketReceiver (com.builtbroken.mc.core.network.IPacketReceiver)1 PacketIDException (com.builtbroken.mc.core.network.ex.PacketIDException)1 PacketTileReadException (com.builtbroken.mc.core.network.ex.PacketTileReadException)1 Location (com.builtbroken.mc.imp.transform.vector.Location)1 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 Side (cpw.mods.fml.relauncher.Side)1