package com.blazeloader.api.api.gui;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.network.play.server.S2DPacketOpenWindow;
import net.minecraft.util.ChatComponentText;

/**
 * GUI functions
 */
public class ApiGui {
    /**
     * Untested
     * Opens a mod added container
     *
     * @param player      the player to open the container for
     * @param c           The container to open
     * @param guiLabel
     * @param addCrafters
     */
    public static void openClientContainer(EntityPlayerMP player, Container c, String guiLabel, boolean addCrafters) {
        if (!player.worldObj.isRemote) {

            if (player.openContainer != player.inventoryContainer) {
                player.closeScreen();
            }

            player.currentWindowId = player.currentWindowId % 100 + 1;

            //TODO:  No idea what the arguments are, so this probably does not work.
            player.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(player.currentWindowId, c.getClass().getName() + ":?:" + guiLabel, new ChatComponentText("INVENTORY"), c.getInventory().size()));
            player.openContainer = c;
            player.openContainer.windowId = player.currentWindowId;
            if (addCrafters) {
                player.openContainer.addCraftingToCrafters(player);
            }
        }
    }
}

@@ -298,16 +298,60 @@
   * 
-Untested
+MOST LIKELY BROKEN, USE AT YOUR OWN RISK!!!!!%0A     *
 %0A   
@@ -522,16 +522,37 @@
 guiLabel
+ The title of the GUI
 %0A     * 
@@ -569,16 +569,63 @@
 Crafters
+ If true, add crafting support to the container
 %0A     */

Add warning to ApiGui