diff options
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/DisplayHelper.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/DisplayHelper.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index 1589ae43d..25c04295d 100644 --- a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -15,12 +15,12 @@ import java.util.List; import static net.minecraft.util.ActionResult.PASS; public interface DisplayHelper { - + @SuppressWarnings("deprecation") static DisplayHelper getInstance() { return RoughlyEnoughItemsCore.getDisplayHelper(); } - + /** * Gets the sorted version of all responsible bounds handlers * @@ -29,14 +29,14 @@ public interface DisplayHelper { * @see DisplayHelper#getResponsibleBoundsHandler(Class) for the unsorted version */ List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass); - + /** * Gets all registered bounds handlers * * @return the list of registered bounds handlers */ List<DisplayBoundsHandler<?>> getAllBoundsHandlers(); - + /** * Gets all responsible bounds handlers * @@ -45,21 +45,21 @@ public interface DisplayHelper { * @see DisplayHelper#getSortedBoundsHandlers(Class) for the sorted version */ DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass); - + /** * Registers a bounds handler * * @param handler the handler to register */ void registerBoundsHandler(DisplayBoundsHandler<?> handler); - + /** * Gets the base bounds handler api for exclusion zones * * @return the base bounds handler */ BaseBoundsHandler getBaseBoundsHandler(); - + public static interface DisplayBoundsHandler<T> { /** * Gets the base supported class for the bounds handler @@ -67,7 +67,7 @@ public interface DisplayHelper { * @return the base class */ Class<?> getBaseSupportedClass(); - + /** * Gets the left bounds of the overlay * @@ -75,7 +75,7 @@ public interface DisplayHelper { * @return the left bounds */ Rectangle getLeftBounds(T screen); - + /** * Gets the right bounds of the overlay * @@ -83,7 +83,7 @@ public interface DisplayHelper { * @return the right bounds */ Rectangle getRightBounds(T screen); - + /** * Checks if item slot can fit the screen * @@ -97,7 +97,7 @@ public interface DisplayHelper { default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { return PASS; } - + /** * Checks if item slot can fit the screen * @@ -113,7 +113,7 @@ public interface DisplayHelper { default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) { return canItemSlotWidgetFit(left, top, screen, fullBounds); } - + /** * Checks if mouse is inside the overlay * @@ -127,7 +127,7 @@ public interface DisplayHelper { default ActionResult isInZone(boolean isOnRightSide, double mouseX, double mouseY) { return isInZone(mouseX, mouseY); } - + /** * Checks if mouse is inside the overlay * @@ -138,7 +138,7 @@ public interface DisplayHelper { default ActionResult isInZone(double mouseX, double mouseY) { return PASS; } - + /** * Gets the item list bounds by the overlay bounds * @@ -148,12 +148,12 @@ public interface DisplayHelper { default Rectangle getItemListArea(Rectangle rectangle) { return new Rectangle(rectangle.x + 1, rectangle.y + 2 + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + (ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22), rectangle.width - 2, rectangle.height - (ConfigObject.getInstance().getSearchFieldLocation() != SearchFieldLocation.CENTER ? 27 + 22 : 27) + (!ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22)); } - + default Rectangle getFavoritesListArea(Rectangle rectangle) { int offset = 31 + (ConfigObject.getInstance().doesShowUtilsButtons() ? 25 : 0); return new Rectangle(rectangle.x + 1, rectangle.y + 2 + offset, rectangle.width - 2, rectangle.height - 5 - offset); } - + /** * Checks if REI should recalculate the overlay bounds * @@ -164,7 +164,7 @@ public interface DisplayHelper { default boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) { return false; } - + /** * Gets the priority of the handler, the higher it is, the earlier it is called. * @@ -174,5 +174,5 @@ public interface DisplayHelper { return 0f; } } - + } |
