diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-01-16 03:23:22 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-01-16 03:58:05 +0800 |
| commit | e5cafbbe2fa9b434e1965fab9772fff9c6e4ca48 (patch) | |
| tree | 6791634ad253d3ad996412267873f4c76b9ebbb9 /api/src/main/java | |
| parent | 00f88f762c7da051d62b9646b4fde6c7749f73ee (diff) | |
| download | RoughlyEnoughItems-e5cafbbe2fa9b434e1965fab9772fff9c6e4ca48.tar.gz RoughlyEnoughItems-e5cafbbe2fa9b434e1965fab9772fff9c6e4ca48.tar.bz2 RoughlyEnoughItems-e5cafbbe2fa9b434e1965fab9772fff9c6e4ca48.zip | |
Technically fix #611, would need CPAS to use the new methods
Diffstat (limited to 'api/src/main/java')
| -rw-r--r-- | api/src/main/java/me/shedaniel/rei/api/client/registry/screen/ExclusionZones.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/screen/ExclusionZones.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/screen/ExclusionZones.java index cdddcae18..19a58c430 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/registry/screen/ExclusionZones.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/screen/ExclusionZones.java @@ -26,6 +26,7 @@ package me.shedaniel.rei.api.client.registry.screen; import me.shedaniel.math.Rectangle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.minecraft.client.gui.screens.Screen; import java.util.List; @@ -36,7 +37,9 @@ public interface ExclusionZones extends OverlayDecider { * * @param currentScreenClass the current screen class * @return the list of exclusion zones + * @deprecated use the screen instance instead */ + @Deprecated default List<Rectangle> getExclusionZones(Class<?> currentScreenClass) { return getExclusionZones(currentScreenClass, false); } @@ -46,9 +49,29 @@ public interface ExclusionZones extends OverlayDecider { * * @param currentScreenClass the current screen class * @return the list of exclusion zones + * @deprecated use the screen instance instead */ + @Deprecated List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort); + /** + * Returns the exclusion zones by the screen + * + * @param screen the screen + * @return the list of exclusion zones + */ + default List<Rectangle> getExclusionZones(Screen screen) { + return getExclusionZones(screen, false); + } + + /** + * Returns the exclusion zones by the screen + * + * @param screen the screen + * @return the list of exclusion zones + */ + List<Rectangle> getExclusionZones(Screen screen, boolean sort); + int getZonesCount(); /** |
