From 1893a1e87c8f46ebd501ee2de80cee1390f5fb96 Mon Sep 17 00:00:00 2001 From: 0xTas Date: Mon, 25 May 2026 15:17:40 -0700 Subject: [PATCH] Fix crash with unknown tooltip components --- .../lambda/mixin/render/TooltipComponentMixin.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/lambda/mixin/render/TooltipComponentMixin.java b/src/main/java/com/lambda/mixin/render/TooltipComponentMixin.java index 27aa110ee..b2f8f6ed1 100644 --- a/src/main/java/com/lambda/mixin/render/TooltipComponentMixin.java +++ b/src/main/java/com/lambda/mixin/render/TooltipComponentMixin.java @@ -38,11 +38,11 @@ private static void of(TooltipData tooltipData, CallbackInfoReturnable mapComponent; - case BundleTooltipData bundleTooltipData -> new BundleTooltipComponent(bundleTooltipData.contents()); - case ProfilesTooltipComponent.ProfilesData profilesData -> new ProfilesTooltipComponent(profilesData); - default -> throw new IllegalArgumentException("Unknown TooltipComponent"); - })); + if (MapPreview.INSTANCE.isEnabled()) switch (tooltipData) { + case MapPreview.MapComponent mapComponent -> cir.setReturnValue(mapComponent); + case BundleTooltipData bundleTooltipData -> cir.setReturnValue(new BundleTooltipComponent(bundleTooltipData.contents())); + case ProfilesTooltipComponent.ProfilesData profilesData -> cir.setReturnValue(new ProfilesTooltipComponent(profilesData)); + default -> {} // ignore + } } }