From 17150bedcdf80944a64e165976cf2491d409b1c0 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 5 Jul 2020 15:31:12 +0800 Subject: Fix #370 and changes to how screens are handled Signed-off-by: shedaniel --- .../java/me/shedaniel/rei/api/OverlayDecider.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/main/java/me/shedaniel/rei/api/OverlayDecider.java') diff --git a/src/main/java/me/shedaniel/rei/api/OverlayDecider.java b/src/main/java/me/shedaniel/rei/api/OverlayDecider.java index 9f20f8223..500d9f058 100644 --- a/src/main/java/me/shedaniel/rei/api/OverlayDecider.java +++ b/src/main/java/me/shedaniel/rei/api/OverlayDecider.java @@ -23,8 +23,12 @@ package me.shedaniel.rei.api; +import me.shedaniel.math.Rectangle; +import me.shedaniel.rei.gui.config.DisplayPanelLocation; import net.minecraft.util.ActionResult; +import static net.minecraft.util.ActionResult.PASS; + public interface OverlayDecider { boolean isHandingScreen(Class screen); @@ -40,4 +44,26 @@ public interface OverlayDecider { default float getPriority() { return 0f; } + + /** + * Checks if REI should recalculate the overlay bounds + * + * @param location the location of the display panel + * @param rectangle the current overlay bounds + * @return whether REI should recalculate the overlay bounds + */ + default boolean shouldRecalculateArea(DisplayPanelLocation location, Rectangle rectangle) { + return false; + } + + /** + * Checks if mouse is inside the overlay + * + * @param mouseX mouse's x coordinates + * @param mouseY mouse's y coordinates + * @return whether mouse is inside the overlay + */ + default ActionResult isInZone(double mouseX, double mouseY) { + return PASS; + } } -- cgit