TheKodeToad / Numeral-Ping

Fabric mod: show ping as number in tab list
MIT License
6 stars 6 forks source link

update to 1.20.6 #17

Closed uku3lig closed 5 months ago

uku3lig commented 5 months ago

title says it all !

TheKodeToad commented 5 months ago

Oh, looks like this doesn't work quite properly - The modified patch no longer affects the ping tooltip - When hovering the incompatible server text the game crashes due to it being a List and the implicit cast due to generics...:

java.lang.ClassCastException: class net.minecraft.class_5481$$Lambda/0x00007f06c8dc5a30 cannot be cast to class net.minecraft.class_2561 (net.minecraft.class_5481$$Lambda/0x00007f06c8dc5a30 and net.minecraft.class_2561 are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @52af6cff)
    at net.minecraft.class_4267$class_4270.args$znd000$numeralping$setTooltip(class_4267.java:613)
    at net.minecraft.class_4267$class_4270.method_25343(class_4267.java:320)
    at net.minecraft.class_350.method_44397(class_350.java:438)
    at net.minecraft.class_350.method_25311(class_350.java:423)
    at net.minecraft.class_350.method_48579(class_350.java:187)
    at net.minecraft.class_339.method_25394(class_339.java:66)
    at net.minecraft.class_437.method_25394(class_437.java:131)
    at net.minecraft.class_500.method_25394(class_500.java:250)
    at net.minecraft.class_437.method_47413(class_437.java:120)
    at net.minecraft.class_757.mixinextras$bridge$method_47413$180(class_757.java)
    at net.minecraft.class_757.wrapOperation$zmc000$fabric-screen-api-v1$onRenderScreen(class_757.java:2101)
    at net.minecraft.class_757.method_3192(class_757.java:922)
    at net.minecraft.class_310.method_1523(class_310.java:1320)
    at net.minecraft.class_310.method_1514(class_310.java:888)
    at net.minecraft.client.main.Main.main(Main.java:265)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100)
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:70)

Would you like to have a go at fixing this? Or should I merge now and try to fix myself?

uku3lig commented 5 months ago

thanks for noticing that, i targeted the wrong method by accident but it should work just fine now (at least it does on my machine)

i replaced your @ModifyArgs with mixinextra's @WrapWithCondition, as it allows for slightly cleaner code, better compatibility and because setting the tooltip text to null caused another crash

TheKodeToad commented 5 months ago

good