/
IGuiHelper.java
62 lines (51 loc) · 2.2 KB
/
IGuiHelper.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package mezz.jei.api;
import javax.annotation.Nonnull;
import net.minecraft.util.ResourceLocation;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.gui.ITickTimer;
/**
* Helps with the implementation of GUIs.
*/
public interface IGuiHelper {
@Nonnull
IDrawableStatic createDrawable(@Nonnull ResourceLocation resourceLocation, int u, int v, int width, int height);
@Nonnull
IDrawableStatic createDrawable(@Nonnull ResourceLocation resourceLocation, int u, int v, int width, int height, int paddingTop, int paddingBottom, int paddingLeft, int paddingRight);
/**
* Creates an animated texture for a gui, revealing the texture over time.
*
* @param drawable the underlying texture to draw
* @param ticksPerCycle the number of ticks for the animation to run before starting over
* @param startDirection the direction that the animation starts drawing the texture
* @param inverted when inverted is true, the texture will start fully drawn and be hidden over time
*/
@Nonnull
IDrawableAnimated createAnimatedDrawable(@Nonnull IDrawableStatic drawable, int ticksPerCycle, @Nonnull IDrawableAnimated.StartDirection startDirection, boolean inverted);
/**
* Returns a slot drawable for drawing extra slots on guis
*/
@Nonnull
IDrawableStatic getSlotDrawable();
/**
* Returns a blank drawable for using as a blank recipe background.
*/
@Nonnull
IDrawableStatic createBlankDrawable(int width, int height);
/**
* Create a crafting grid helper.
* Helps set crafting-grid-style GuiItemStackGroup.
*/
@Nonnull
ICraftingGridHelper createCraftingGridHelper(int craftInputSlot1, int craftOutputSlot);
/**
* Create a timer to help with rendering things that normally depend on ticks.
*
* @param ticksPerCycle the number of ticks for timer to run before starting over at 0
* @param maxValue the number to count up to before starting over at 0
* @param countDown if true, the tick timer will count backwards from maxValue
*/
@Nonnull
ITickTimer createTickTimer(int ticksPerCycle, int maxValue, boolean countDown);
}