diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-04-12 23:26:12 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-04-12 23:26:12 +0800 |
| commit | 40064141a61e91a9b92f3b7ad417943839fb94c6 (patch) | |
| tree | 981e6fc2d7f5b7f79f78b7404d2cfa1aedcd495a /fabric/src/main | |
| parent | 371de0e3c77bd5b57616bb977925d677292f3def (diff) | |
| parent | 40119cc21ce0cf0098f31823e1382167990bc772 (diff) | |
| download | RoughlyEnoughItems-40064141a61e91a9b92f3b7ad417943839fb94c6.tar.gz RoughlyEnoughItems-40064141a61e91a9b92f3b7ad417943839fb94c6.tar.bz2 RoughlyEnoughItems-40064141a61e91a9b92f3b7ad417943839fb94c6.zip | |
Merge branch '8.x-1.18.2' into 9.x-1.19
# Conflicts:
# gradle.properties
Diffstat (limited to 'fabric/src/main')
| -rw-r--r-- | fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java b/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java index f3a730371..86c21c5a4 100644 --- a/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java +++ b/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java @@ -23,6 +23,7 @@ package me.shedaniel.rei.impl.client.gui.fabric; +import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import me.shedaniel.rei.api.client.gui.widgets.Tooltip; import me.shedaniel.rei.impl.ClientInternals; @@ -49,15 +50,19 @@ public class ScreenOverlayImplImpl { : texts.stream().map(Language.getInstance()::getVisualOrder); return sequenceStream.map(ClientTooltipComponent::create); } else { - return Stream.of(component.getAsComponent()); + return Stream.empty(); } }) .collect(Collectors.toList()); - for (TooltipComponent component : tooltip.components()) { - try { - ClientInternals.getClientTooltipComponent(lines, component); - } catch (Throwable exception) { - throw new IllegalArgumentException("Failed to add tooltip component! " + component + ", Class: " + (component == null ? null : component.getClass().getCanonicalName()), exception); + for (Tooltip.Entry entry : tooltip.entries()) { + if (entry.isTooltipComponent()) { + TooltipComponent component = entry.getAsTooltipComponent(); + + try { + ClientInternals.getClientTooltipComponent(lines, component); + } catch (Throwable exception) { + throw new IllegalArgumentException("Failed to add tooltip component! " + component + ", Class: " + (component == null ? null : component.getClass().getCanonicalName()), exception); + } } } renderTooltipInner(matrices, lines, tooltip.getX(), tooltip.getY()); @@ -67,9 +72,14 @@ public class ScreenOverlayImplImpl { if (lines.isEmpty()) { return; } + PoseStack modelViewStack = RenderSystem.getModelViewStack(); + modelViewStack.pushPose(); + modelViewStack.translate(0, 0, 500); + RenderSystem.applyModelViewMatrix(); matrices.pushPose(); - matrices.translate(0, 0, 500); Minecraft.getInstance().screen.renderTooltipInternal(matrices, lines, mouseX, mouseY); matrices.popPose(); + modelViewStack.popPose(); + RenderSystem.applyModelViewMatrix(); } } |
