From e5cafbbe2fa9b434e1965fab9772fff9c6e4ca48 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 16 Jan 2022 03:23:22 +0800 Subject: Technically fix #611, would need CPAS to use the new methods --- .../api/client/registry/screen/ExclusionZones.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'api/src/main/java/me/shedaniel') 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 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 getExclusionZones(Class currentScreenClass, boolean sort); + /** + * Returns the exclusion zones by the screen + * + * @param screen the screen + * @return the list of exclusion zones + */ + default List 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 getExclusionZones(Screen screen, boolean sort); + int getZonesCount(); /** -- cgit