Skip to content

Commit be28065

Browse files
committed
Fixed MapPreview
1 parent ac59093 commit be28065

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/main/java/com/lambda/mixin/render/TooltipComponentMixin.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,28 @@
1717

1818
package com.lambda.mixin.render;
1919

20+
import com.lambda.module.modules.render.MapPreview;
21+
import net.minecraft.client.gui.tooltip.BundleTooltipComponent;
22+
import net.minecraft.client.gui.tooltip.ProfilesTooltipComponent;
2023
import net.minecraft.client.gui.tooltip.TooltipComponent;
24+
import net.minecraft.item.tooltip.BundleTooltipData;
25+
import net.minecraft.item.tooltip.TooltipData;
2126
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;
2232

2333
@Mixin(TooltipComponent.class)
2434
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)
2636
private static void of(TooltipData tooltipData, CallbackInfoReturnable<TooltipComponent> cir) {
27-
Objects.requireNonNull(tooltipData);
28-
2937
cir.setReturnValue((switch (tooltipData) {
3038
case MapPreview.MapComponent mapComponent -> mapComponent;
31-
3239
case BundleTooltipData bundleTooltipData -> new BundleTooltipComponent(bundleTooltipData.contents());
3340
case ProfilesTooltipComponent.ProfilesData profilesData -> new ProfilesTooltipComponent(profilesData);
3441
default -> throw new IllegalArgumentException("Unknown TooltipComponent");
3542
}));
36-
}*/
43+
}
3744
}

0 commit comments

Comments
 (0)