aboutsummaryrefslogtreecommitdiff
path: root/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-03-09 23:17:05 +0800
committershedaniel <daniel@shedaniel.me>2021-03-09 23:17:05 +0800
commitde461fde691f593b85ffeae837b5b419a9abf7cc (patch)
treecec6e08c99427eddf9eef5e19d04edca56d3d0d4 /default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
parent64bc9937d6ec04c6d66240a84b4fb345026c0b12 (diff)
downloadRoughlyEnoughItems-de461fde691f593b85ffeae837b5b419a9abf7cc.tar.gz
RoughlyEnoughItems-de461fde691f593b85ffeae837b5b419a9abf7cc.tar.bz2
RoughlyEnoughItems-de461fde691f593b85ffeae837b5b419a9abf7cc.zip
Use AbstractRecipeViewingScreen and remove static from ScreenHelper
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java')
-rw-r--r--default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
index 9fd033af6..f46d5433b 100644
--- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
+++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
@@ -25,10 +25,10 @@ package me.shedaniel.rei.plugin;
import com.google.common.collect.Ordering;
import me.shedaniel.math.Rectangle;
-import me.shedaniel.rei.api.REIHelper;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen;
import net.minecraft.world.effect.MobEffectInstance;
@@ -43,12 +43,13 @@ import java.util.function.Supplier;
public class DefaultPotionEffectExclusionZones implements Supplier<List<Rectangle>> {
@Override
public List<Rectangle> get() {
- if (!(REIHelper.getInstance().getPreviousContainerScreen() instanceof EffectRenderingInventoryScreen) || !((EffectRenderingInventoryScreen<?>) REIHelper.getInstance().getPreviousContainerScreen()).doRenderEffects)
+ Screen screen = Minecraft.getInstance().screen;
+ if (!(screen instanceof EffectRenderingInventoryScreen) || !((EffectRenderingInventoryScreen<?>) screen).doRenderEffects)
return Collections.emptyList();
Collection<MobEffectInstance> activePotionEffects = Minecraft.getInstance().player.getActiveEffects();
if (activePotionEffects.isEmpty())
return Collections.emptyList();
- AbstractContainerScreen<?> containerScreen = REIHelper.getInstance().getPreviousContainerScreen();
+ AbstractContainerScreen<?> containerScreen = (AbstractContainerScreen<?>) screen;
List<Rectangle> list = new ArrayList<>();
int x = containerScreen.leftPos - 124;
int y = containerScreen.topPos;