aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2019-12-20 17:31:30 +0800
committershedaniel <daniel@shedaniel.me>2019-12-20 17:31:30 +0800
commitb2d0af7a9fb0d16f14b294802f6718ac315d0de8 (patch)
tree239aeb17bc098158bf2e63737253247ba3e687fe /src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
parente0a4a4692f8cb465c32ef589e15cea83d2432f99 (diff)
downloadRoughlyEnoughItems-b2d0af7a9fb0d16f14b294802f6718ac315d0de8.tar.gz
RoughlyEnoughItems-b2d0af7a9fb0d16f14b294802f6718ac315d0de8.tar.bz2
RoughlyEnoughItems-b2d0af7a9fb0d16f14b294802f6718ac315d0de8.zip
3.2.27
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java')
-rw-r--r--src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java b/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
index 9bc6d1430..84b8574a6 100644
--- a/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
+++ b/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
@@ -5,11 +5,14 @@
package me.shedaniel.rei.api;
+import com.google.common.collect.Lists;
import me.shedaniel.math.api.Rectangle;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import net.minecraft.client.gui.screen.Screen;
import java.util.List;
import java.util.function.Function;
+import java.util.function.Supplier;
public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Screen> {
/**
@@ -19,11 +22,19 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
* @param isOnRightSide whether the user has set the overlay to the right
* @return the list of exclusion zones
*/
+ @Deprecated
default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide) {
- return getCurrentExclusionZones(currentScreenClass, isOnRightSide, false);
+ return getExclusionZones(currentScreenClass, false);
}
- List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide, boolean sort);
+ @Deprecated
+ default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide, boolean sort) {
+ return getExclusionZones(currentScreenClass, sort);
+ }
+
+ List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort);
+
+ int supplierSize();
/**
* Register an exclusion zone
@@ -31,6 +42,16 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
* @param screenClass the screen
* @param supplier the exclusion zone supplier, isOnRightSide -> the list of exclusion zones
*/
- void registerExclusionZones(Class<?> screenClass, Function<Boolean, List<Rectangle>> supplier);
+ @Deprecated
+ default void registerExclusionZones(Class<?> screenClass, Function<Boolean, List<Rectangle>> supplier) {
+ RoughlyEnoughItemsCore.LOGGER.warn("[REI] Someone is registering exclusion zones with the deprecated method: " + supplier.getClass().getName());
+ registerExclusionZones(screenClass, () -> {
+ List<Rectangle> zones = Lists.newArrayList(supplier.apply(false));
+ zones.addAll(supplier.apply(true));
+ return zones;
+ });
+ }
+
+ void registerExclusionZones(Class<?> screenClass, Supplier<List<Rectangle>> supplier);
}