|
17 | 17 |
|
18 | 18 | package com.lambda.mixin.render; |
19 | 19 |
|
| 20 | +import com.lambda.module.modules.render.MapPreview; |
| 21 | +import net.minecraft.client.gui.tooltip.BundleTooltipComponent; |
| 22 | +import net.minecraft.client.gui.tooltip.ProfilesTooltipComponent; |
20 | 23 | import net.minecraft.client.gui.tooltip.TooltipComponent; |
| 24 | +import net.minecraft.item.tooltip.BundleTooltipData; |
| 25 | +import net.minecraft.item.tooltip.TooltipData; |
21 | 26 | import org.spongepowered.asm.mixin.Mixin; |
| 27 | +import org.spongepowered.asm.mixin.injection.At; |
| 28 | +import org.spongepowered.asm.mixin.injection.Inject; |
| 29 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
| 30 | + |
| 31 | +import java.util.Objects; |
22 | 32 |
|
23 | 33 | @Mixin(TooltipComponent.class) |
24 | 34 | public interface TooltipComponentMixin { |
25 | | - /*@Inject(method = "of(Lnet/minecraft/item/tooltip/TooltipData;)Lnet/minecraft/client/gui/tooltip/TooltipComponent;", at = @At("HEAD"), cancellable = true) |
| 35 | + @Inject(method = "of(Lnet/minecraft/item/tooltip/TooltipData;)Lnet/minecraft/client/gui/tooltip/TooltipComponent;", at = @At("HEAD"), cancellable = true) |
26 | 36 | private static void of(TooltipData tooltipData, CallbackInfoReturnable<TooltipComponent> cir) { |
27 | | - Objects.requireNonNull(tooltipData); |
28 | | -
|
29 | 37 | cir.setReturnValue((switch (tooltipData) { |
30 | 38 | case MapPreview.MapComponent mapComponent -> mapComponent; |
31 | | -
|
32 | 39 | case BundleTooltipData bundleTooltipData -> new BundleTooltipComponent(bundleTooltipData.contents()); |
33 | 40 | case ProfilesTooltipComponent.ProfilesData profilesData -> new ProfilesTooltipComponent(profilesData); |
34 | 41 | default -> throw new IllegalArgumentException("Unknown TooltipComponent"); |
35 | 42 | })); |
36 | | - }*/ |
| 43 | + } |
37 | 44 | } |
0 commit comments