Files
NotEnoughItems/src/main/java/codechicken/nei/api/INEIGuiHandler.java
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
2.3 KiB
Java
Raw Normal View History

2014-04-29 10:54:20 +10:00
package codechicken.nei.api;
2023-09-25 00:34:42 +02:00
import codechicken.nei.VisiblityData;
2014-04-29 10:54:20 +10:00
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
2023-09-25 00:34:42 +02:00
import java.util.List;
2014-04-29 10:54:20 +10:00
/**
* If this is implemented on a gui, it will be automatically registered
*/
public interface INEIGuiHandler {
2014-04-29 10:54:20 +10:00
public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility);
2014-04-29 10:54:20 +10:00
/**
* NEI will give the specified item to the InventoryRange returned if the player's inventory is full. Should not
2015-02-26 09:48:13 +10:00
* return null, just an empty list
2014-04-29 10:54:20 +10:00
*/
public Iterable<Integer> getItemSpawnSlots(GuiContainer gui, ItemStack item);
2014-04-29 10:54:20 +10:00
/**
* @return A list of TaggedInventoryAreas that will be used with the savestates.
*/
public List<TaggedInventoryArea> getInventoryAreas(GuiContainer gui);
2014-04-29 10:54:20 +10:00
/**
* Handles clicks while an itemstack has been dragged from the item panel. Use this to set configurable slots and
2014-04-29 10:54:20 +10:00
* the like. Changes made to the stackSize of the dragged stack will be kept
*
2014-04-29 10:54:20 +10:00
* @param gui The current gui instance
* @param mousex The x position of the mouse
* @param mousey The y position of the mouse
* @param draggedStack The stack being dragged from the item panel
* @param button The button presed
* @return True if the drag n drop was handled. False to resume processing through other routes. The held stack will
* be deleted if draggedStack.stackSize == 0
*/
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button);
2014-04-29 10:54:20 +10:00
/**
* Used to prevent the item panel from drawing on top of other gui elements. This function will also be called with
* a 1x1 size rectangle on the mouse position for determining if the given coordinate should override item panel
* functions such as scrolling
*
2014-04-29 10:54:20 +10:00
* @param x The x coordinate of the rectangle bounding the slot
* @param y The y coordinate of the rectangle bounding the slot
* @param w The w coordinate of the rectangle bounding the slot
* @param h The h coordinate of the rectangle bounding the slot
* @return true if the item panel slot within the specified rectangle should not be rendered.
*/
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h);
}