aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java
diff options
context:
space:
mode:
authorAnthony Hilyard <anthony.hilyard@gmail.com>2021-12-04 21:27:28 -0800
committerAnthony Hilyard <anthony.hilyard@gmail.com>2021-12-04 21:27:28 -0800
commitf5d35697f524cda1736740e739f8afd902651c53 (patch)
tree1b582f6420418f62fbef9755434fbaebe7644ff6 /src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java
parent36a1f98bba70892f4e06c3df8b2b0bb4d0d5fe03 (diff)
downloadIceberg-f5d35697f524cda1736740e739f8afd902651c53.tar.gz
Iceberg-f5d35697f524cda1736740e739f8afd902651c53.tar.bz2
Iceberg-f5d35697f524cda1736740e739f8afd902651c53.zip
Initial 1.18 port. Overhauled tooltip handling, added color code item
color support.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java')
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java
index bbd2d6b..4c7e0c8 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/ScreenMixin.java
@@ -2,11 +2,10 @@ package com.anthonyhilyard.iceberg.mixin;
import java.util.List;
-import com.anthonyhilyard.iceberg.util.StringRecomposer;
+import com.anthonyhilyard.iceberg.events.RenderTooltipExtEvent;
import com.google.common.collect.Lists;
import com.mojang.blaze3d.vertex.PoseStack;
-import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
@@ -37,11 +36,9 @@ public class ScreenMixin extends AbstractContainerEventHandler
@Shadow(remap = false)
private ItemStack tooltipStack = ItemStack.EMPTY;
- @Final
@Shadow
private final List<GuiEventListener> children = Lists.newArrayList();
- @SuppressWarnings("removal")
@Inject(method = "renderTooltipInternal",
at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/entity/ItemRenderer;blitOffset:F", ordinal = 2, shift = Shift.AFTER),
locals = LocalCapture.CAPTURE_FAILEXCEPTION)
@@ -49,7 +46,7 @@ public class ScreenMixin extends AbstractContainerEventHandler
{
if (!components.isEmpty())
{
- MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostText(tooltipStack, StringRecomposer.recompose(components), poseStack, postX, postY, ForgeHooksClient.getTooltipFont(tooltipFont, tooltipStack, font), tooltipWidth, tooltipHeight));
+ MinecraftForge.EVENT_BUS.post(new RenderTooltipExtEvent.Post(tooltipStack, poseStack, postX, postY, ForgeHooksClient.getTooltipFont(tooltipFont, tooltipStack, font), tooltipWidth, tooltipHeight, components, false));
}
}