aboutsummaryrefslogtreecommitdiff
path: root/forge/src/main/java/me/shedaniel/rei/impl
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-08-02 19:54:29 +0800
committershedaniel <daniel@shedaniel.me>2021-08-02 19:58:20 +0800
commitb866becfb620c02a74fb990915001e154b5d2b0b (patch)
tree904a3cb692af8a8ec059852d6b450e2a00c58621 /forge/src/main/java/me/shedaniel/rei/impl
parent9f29770195319484f534de09fb221c66f31e0247 (diff)
downloadRoughlyEnoughItems-b866becfb620c02a74fb990915001e154b5d2b0b.tar.gz
RoughlyEnoughItems-b866becfb620c02a74fb990915001e154b5d2b0b.tar.bz2
RoughlyEnoughItems-b866becfb620c02a74fb990915001e154b5d2b0b.zip
Welcome, Forge 1.17
Diffstat (limited to 'forge/src/main/java/me/shedaniel/rei/impl')
-rw-r--r--forge/src/main/java/me/shedaniel/rei/impl/client/gui/forge/ScreenOverlayImplImpl.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/forge/src/main/java/me/shedaniel/rei/impl/client/gui/forge/ScreenOverlayImplImpl.java b/forge/src/main/java/me/shedaniel/rei/impl/client/gui/forge/ScreenOverlayImplImpl.java
new file mode 100644
index 000000000..1b27ecf80
--- /dev/null
+++ b/forge/src/main/java/me/shedaniel/rei/impl/client/gui/forge/ScreenOverlayImplImpl.java
@@ -0,0 +1,45 @@
+/*
+ * This file is licensed under the MIT License, part of Roughly Enough Items.
+ * Copyright (c) 2018, 2019, 2020, 2021 shedaniel
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package me.shedaniel.rei.impl.client.gui.forge;
+
+import com.mojang.blaze3d.vertex.PoseStack;
+import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
+import me.shedaniel.rei.api.common.entry.EntryStack;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.screens.Screen;
+import net.minecraft.world.item.ItemStack;
+import net.minecraftforge.fmlclient.gui.GuiUtils;
+
+public class ScreenOverlayImplImpl {
+ public static void renderTooltipInner(Screen screen, PoseStack matrices, Tooltip tooltip, int mouseX, int mouseY) {
+ matrices.pushPose();
+ matrices.translate(0, 0, 500);
+ EntryStack<?> stack = tooltip.getContextStack();
+ ItemStack itemStack = stack.getValue() instanceof ItemStack ? stack.castValue() : ItemStack.EMPTY;
+ GuiUtils.preItemToolTip(itemStack);
+ GuiUtils.drawHoveringText(matrices, tooltip.getText(), mouseX, mouseY, screen.width, screen.height, screen.width, Minecraft.getInstance().font);
+ GuiUtils.postItemToolTip();
+ matrices.popPose();
+ }
+}