/
IAdvancedGuiHandler.java
45 lines (40 loc) · 1.69 KB
/
IAdvancedGuiHandler.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package mezz.jei.api.gui;
import javax.annotation.Nullable;
import java.awt.Rectangle;
import java.util.List;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.ingredients.IModIngredientRegistration;
import net.minecraft.client.gui.inventory.GuiContainer;
/**
* Allows plugins to change how JEI is displayed next to their mod's guis.
* Register your implementation with {@link IModRegistry#addAdvancedGuiHandlers(IAdvancedGuiHandler[])}.
* @see BlankAdvancedGuiHandler
*/
public interface IAdvancedGuiHandler<T extends GuiContainer> {
/**
* @return the class that this IAdvancedGuiHandler handles.
*/
Class<T> getGuiContainerClass();
/**
* Give JEI information about extra space that the GuiContainer takes up.
* Used for moving JEI out of the way of extra things like gui tabs.
*
* @return the space that the gui takes up besides the normal rectangle defined by GuiContainer.
*/
@Nullable
List<Rectangle> getGuiExtraAreas(T guiContainer);
/**
* Return anything under the mouse that JEI could not normally detect, used for JEI recipe lookups.
* <p>
* This is useful for guis that don't have normal slots (which is how JEI normally detects items under the mouse).
* <p>
* This can also be used to let JEI look up liquids in tanks directly, by returning a FluidStack.
* Works with any ingredient type that has been registered with {@link IModIngredientRegistration}.
*
* @param mouseX the current X position of the mouse in screen coordinates.
* @param mouseY the current Y position of the mouse in screen coordinates.
* @since JEI 3.13.2
*/
@Nullable
Object getIngredientUnderMouse(T guiContainer, int mouseX, int mouseY);
}