diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-04-11 21:47:51 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-04-11 21:47:51 +0800 |
| commit | 41998600e53f941554c8d73790180c13a2e5663c (patch) | |
| tree | f068c4e7c0f5a5f32a4d614b5f75bd4704c9e888 /src/main/java/me/shedaniel/rei/api/DisplayHelper.java | |
| parent | 6c783c00640143c810c81486e0c49003b297221f (diff) | |
| download | RoughlyEnoughItems-41998600e53f941554c8d73790180c13a2e5663c.tar.gz RoughlyEnoughItems-41998600e53f941554c8d73790180c13a2e5663c.tar.bz2 RoughlyEnoughItems-41998600e53f941554c8d73790180c13a2e5663c.zip | |
2.7.2
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/DisplayHelper.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/DisplayHelper.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java new file mode 100644 index 000000000..f912b33c5 --- /dev/null +++ b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -0,0 +1,32 @@ +package me.shedaniel.rei.api; + +import me.shedaniel.rei.RoughlyEnoughItemsCore; + +import java.awt.*; +import java.util.List; + +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 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; + } + } + +} |
