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 + } } }