blob: edb319d762a08ad2f571d30474bcaa0a40772613 (
plain)
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
|
package me.shedaniel.rei.api;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
import net.minecraft.util.ActionResult;
import java.awt.*;
import java.util.List;
import static net.minecraft.util.ActionResult.PASS;
public interface DisplayHelper {
List<DisplayBoundsHandler> getSortedBoundsHandlers(Class screenClass);
DisplayBoundsHandler getResponsibleBoundsHandler(Class screenClass);
void registerBoundsHandler(DisplayBoundsHandler handler);
public static interface DisplayBoundsHandler<T> {
Class getBaseSupportedClass();
Rectangle getLeftBounds(T screen);
Rectangle getRightBounds(T screen);
default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) {
return PASS;
}
default Rectangle getItemListArea(Rectangle rectangle) {
return new Rectangle(rectangle.x + 2, rectangle.y + 24, rectangle.width - 4, rectangle.height - (RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField ? 27 + 22 : 27));
}
default float getPriority() {
return 0f;
}
}
}
|