diff options
| author | shedaniel <daniel@shedaniel.me> | 2024-04-30 00:37:37 +0900 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-04-30 00:45:21 +0900 |
| commit | d93e7c857fdd3b333d53d482258167305a08b812 (patch) | |
| tree | 9c67d0895f629483a3990eaf6ef83a34a05e9c8a /runtime/src/main | |
| parent | 7e6221c72d4a1383f682924b06bec397642ca9d5 (diff) | |
| download | RoughlyEnoughItems-d93e7c857fdd3b333d53d482258167305a08b812.tar.gz RoughlyEnoughItems-d93e7c857fdd3b333d53d482258167305a08b812.tar.bz2 RoughlyEnoughItems-d93e7c857fdd3b333d53d482258167305a08b812.zip | |
Fix #1620
Diffstat (limited to 'runtime/src/main')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigGroupWidget.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigGroupWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigGroupWidget.java index 59546ec9e..10ae2014e 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigGroupWidget.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigGroupWidget.java @@ -26,6 +26,7 @@ package me.shedaniel.rei.impl.client.gui.config.components; import com.mojang.math.Matrix4f; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; +import me.shedaniel.rei.api.client.REIRuntime; import me.shedaniel.rei.api.client.gui.widgets.Widget; import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds; import me.shedaniel.rei.api.client.gui.widgets.Widgets; @@ -38,6 +39,7 @@ import me.shedaniel.rei.impl.client.gui.config.options.preview.AccessibilityDisp import me.shedaniel.rei.impl.client.gui.config.options.preview.InterfacePreviewer; import me.shedaniel.rei.impl.client.gui.config.options.preview.TooltipPreviewer; import me.shedaniel.rei.impl.client.gui.text.TextTransformations; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiComponent; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; @@ -66,6 +68,10 @@ public class ConfigGroupWidget { .withPadding(0, 0, 0, 6); WidgetWithBounds contents; + if (applyPreview) { + applyPreview = REIRuntime.getInstance().getPreviousContainerScreen() != null && Minecraft.getInstance().getConnection() != null && Minecraft.getInstance().getConnection().getRecipeManager() != null; + } + if (applyPreview && SPECIAL_GROUPS.containsKey(entry.getId())) { Pair<PreviewLocation, SpecialGroupConstructor> pair = SPECIAL_GROUPS.get(entry.getId()); PreviewLocation location = pair.getLeft(); |
