aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-06-14 22:10:42 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-06-14 22:10:42 +0800
commit69a531030df74768d86025cd5668e0418a3c1f07 (patch)
treef128d5b07b0a8cfa8f02def50477ce8bfef4a50e /src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java
parent5c29f7917d71dc0042ee2b71a1f7ba4f4c347fde (diff)
downloadRoughlyEnoughItems-69a531030df74768d86025cd5668e0418a3c1f07.tar.gz
RoughlyEnoughItems-69a531030df74768d86025cd5668e0418a3c1f07.tar.bz2
RoughlyEnoughItems-69a531030df74768d86025cd5668e0418a3c1f07.zip
stuff
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java')
-rw-r--r--src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java b/src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java
index 972fba8b3..426ccd926 100644
--- a/src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java
@@ -24,15 +24,15 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
private static final Function<Rectangle, String> RECTANGLE_STRING_FUNCTION = rectangle -> rectangle.x + "," + rectangle.y + "," + rectangle.width + "," + rectangle.height;
private static final Comparator<Rectangle> RECTANGLE_COMPARATOR = BaseBoundsHandlerImpl::compare;
- private static final Comparator<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> LIST_PAIR_COMPARATOR;
+ private static final Comparator<Pair<Pair<Class<?>, Float>, ExclusionZoneSupplier>> LIST_PAIR_COMPARATOR;
static {
- Comparator<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> comparator = Comparator.comparingDouble(value -> value.getLeft().getRight());
+ Comparator<Pair<Pair<Class<?>, Float>, ExclusionZoneSupplier>> comparator = Comparator.comparingDouble(value -> value.getLeft().getRight());
LIST_PAIR_COMPARATOR = comparator.reversed();
}
private String lastArea = null;
- private List<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> list = Lists.newArrayList();
+ private List<Pair<Pair<Class<?>, Float>, ExclusionZoneSupplier>> list = Lists.newArrayList();
private static int compare(Rectangle o1, Rectangle o2) {return RECTANGLE_STRING_FUNCTION.apply(o1).compareTo(RECTANGLE_STRING_FUNCTION.apply(o2));}
@@ -93,8 +93,8 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
return ActionResult.PASS;
}
- public List<Rectangle> getCurrentExclusionZones(Class<? extends Screen> currentScreenClass, boolean isOnRightSide) {
- List<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> only = list.stream().filter(pair -> pair.getLeft().getLeft().isAssignableFrom(currentScreenClass)).collect(Collectors.toList());
+ public List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide) {
+ List<Pair<Pair<Class<?>, Float>, ExclusionZoneSupplier>> only = list.stream().filter(pair -> pair.getLeft().getLeft().isAssignableFrom(currentScreenClass)).collect(Collectors.toList());
only.sort(LIST_PAIR_COMPARATOR);
List<Rectangle> rectangles = Lists.newArrayList();
only.forEach(pair -> rectangles.addAll(pair.getRight().apply(isOnRightSide)));
@@ -102,7 +102,7 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
}
@Override
- public void registerExclusionZones(Class<? extends Screen> screenClass, ExclusionZoneSupplier supplier) {
+ public void registerExclusionZones(Class<?> screenClass, ExclusionZoneSupplier supplier) {
list.add(new Pair<>(new Pair<>(screenClass, 0f), supplier));
}