Examples of GuiContainer


Examples of net.minecraft.client.gui.inventory.GuiContainer

    return height - Mouse.getY() * height / minecraft.displayHeight - 1;
  }

  @SideOnly(Side.CLIENT)
  public static Slot getHoveredSlot(int guiLeft, int guiTop) {
    GuiContainer gui = (GuiContainer) Minecraft.getMinecraft().currentScreen;
    if( gui == null )
      return null;

    Container container = Minecraft.getMinecraft().thePlayer.openContainer;
    int mouseX = getMouseX( Minecraft.getMinecraft() ) - guiLeft;
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

        else
            page = firstIndex / itemsPerPage + 1;
    }

    private void updateValidSlots() {
        GuiContainer gui = NEIClientUtils.getGuiContainer();
        validSlotMap = new boolean[rows * columns];
        itemsPerPage = 0;
        for (int i = 0; i < validSlotMap.length; i++)
            if (slotValid(gui, i)) {
                validSlotMap[i] = true;
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

    private boolean handleDraggedClick(int mousex, int mousey, int button) {
        if (draggedStack == null)
            return false;

        GuiContainer gui = NEIClientUtils.getGuiContainer();
        boolean handled = false;
        for (INEIGuiHandler handler : GuiInfo.guiHandlers)
            if (handler.handleDragNDrop(gui, mousex, mousey, draggedStack, button)) {
                handled = true;
                if (draggedStack.stackSize == 0) {
                    draggedStack = null;
                    return true;
                }
            }

        if (handled)
            return true;

        Slot overSlot = gui.getSlotAtPosition(mousex, mousey);
        if (overSlot != null && overSlot.isItemValid(draggedStack)) {
            if (NEIClientConfig.canCheatItem(draggedStack)) {
                int contents = overSlot.getHasStack() ? overSlot.getStack().stackSize : 0;
                int add = button == 0 ? draggedStack.stackSize : 1;
                if (overSlot.getHasStack() && !NEIServerUtils.areStacksSameType(draggedStack, overSlot.getStack()))
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

        return numPages;
    }

    @Override
    public boolean contains(int px, int py) {
        GuiContainer gui = NEIClientUtils.getGuiContainer();
        Rectangle4i rect = new Rectangle4i(px, py, 1, 1);
        for (INEIGuiHandler handler : GuiInfo.guiHandlers)
            if (handler.hideItemPanelSlot(gui, rect.x, rect.y, rect.w, rect.h))
                return false;
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

    public static void giveStack(ItemStack base, int i, boolean infinite) {
        ItemStack stack = copyStack(base, i);
        if (hasSMPCounterPart()) {
            ItemStack typestack = copyStack(stack, 1);
            if (!infinite && !canItemFitInInventory(mc().thePlayer, stack) && (mc().currentScreen instanceof GuiContainer)) {
                GuiContainer gui = getGuiContainer();
                List<Iterable<Integer>> handlerSlots = new LinkedList<Iterable<Integer>>();
                for(INEIGuiHandler handler : GuiInfo.guiHandlers)
                    handlerSlots.add(handler.getItemSpawnSlots(gui, typestack));

                int increment = typestack.getMaxStackSize();
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

        if (!statesSaved[state]) {
            return;
        }

        NBTTagCompound statesave = global.nbt.getCompoundTag("save" + state);
        GuiContainer currentContainer = NEIClientUtils.getGuiContainer();
        LinkedList<TaggedInventoryArea> saveAreas = new LinkedList<TaggedInventoryArea>();
        saveAreas.add(new TaggedInventoryArea(NEIClientUtils.mc().thePlayer.inventory));

        for (INEIGuiHandler handler : GuiInfo.guiHandlers) {
            List<TaggedInventoryArea> areaList = handler.getInventoryAreas(currentContainer);
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

        }
    }

    public static void saveState(int state) {
        NBTTagCompound statesave = global.nbt.getCompoundTag("save" + state);
        GuiContainer currentContainer = NEIClientUtils.getGuiContainer();
        LinkedList<TaggedInventoryArea> saveAreas = new LinkedList<TaggedInventoryArea>();
        saveAreas.add(new TaggedInventoryArea(NEIClientUtils.mc().thePlayer.inventory));

        for (INEIGuiHandler handler : GuiInfo.guiHandlers) {
            List<TaggedInventoryArea> areaList = handler.getInventoryAreas(currentContainer);
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

public class GuiUsageRecipe extends GuiRecipe
{
    public static boolean openRecipeGui(String inputId, Object... ingredients) {
        Minecraft mc = NEIClientUtils.mc();
        GuiContainer prevscreen = mc.currentScreen instanceof GuiContainer ? (GuiContainer) mc.currentScreen : null;

        TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
        ArrayList<IUsageHandler> handlers = new ArrayList<IUsageHandler>();
        for (IUsageHandler usagehandler : usagehandlers) {
            profiler.start(usagehandler.getRecipeName());
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

public class GuiCraftingRecipe extends GuiRecipe
{
    public static boolean openRecipeGui(String outputId, Object... results) {
        Minecraft mc = NEIClientUtils.mc();
        GuiContainer prevscreen = mc.currentScreen instanceof GuiContainer ? (GuiContainer) mc.currentScreen : null;

        TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
        ArrayList<ICraftingHandler> handlers = new ArrayList<ICraftingHandler>();
        for (ICraftingHandler craftinghandler : craftinghandlers) {
            profiler.start(craftinghandler.getRecipeName());
View Full Code Here

Examples of net.minecraft.client.gui.inventory.GuiContainer

      } catch(Exception e) {
        if(LPConstants.DEBUG) e.printStackTrace();
      }
    }
    if(isOverlaySlotActive) {
      GuiContainer gui = (GuiContainer) FMLClientHandler.instance().getClient().currentScreen;
      int guiTop = gui.guiTop;
      int guiLeft = gui.guiLeft;
      int x = oldX * gui.width / FMLClientHandler.instance().getClient().displayWidth;
      int y = gui.height - oldY * gui.height / FMLClientHandler.instance().getClient().displayHeight - 1;
      for(Slot slot: (List<Slot>) gui.inventorySlots.inventorySlots) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.