ewpratten / client-ping

Purely client-side point-of-interest marking for Minecraft
https://ewp.fyi/client-ping
GNU General Public License v3.0
3 stars 2 forks source link

Pinging at negative coordinates breaks the ping parser #2

Closed ewpratten closed 1 year ago

ewpratten commented 1 year ago
[13:43:32] [Server thread/INFO]: [Not Secure] <Xnor50> Ping at {minecraft:overworld:(142, -61, 22)}
[13:43:32] [Render thread/ERROR]: Failed to deserialize ping
java.lang.IllegalArgumentException: Invalid string format
    at com.ewpratten.client_ping.util.DimensionPosition.fromString(DimensionPosition.java:37) ~[transformed-mod-client-ping.i0:0/:?]
    at com.ewpratten.client_ping.logic.Ping.deserialize(Ping.java:25) ~[transformed-mod-client-ping.i0:0/:?]
    at net.minecraft.class_338.handler$cko000$client_ping$addMessage(class_338.java:2578) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_338.method_44811(class_338.java) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_7594.method_44943(class_7594.java:135) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_7594.method_45749(class_7594.java:96) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_7594.method_44818(class_7594.java:85) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_7594.method_45748(class_7594.java:95) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_634.method_43595(class_634.java:909) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_7438.method_43629(class_7438.java:40) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_7438.method_11054(class_7438.java:14) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_2600.method_11072(class_2600.java:22) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_1255.method_18859(class_1255.java:156) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_1255.method_16075(class_1255.java:130) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_1255.method_5383(class_1255.java:115) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_310.method_1523(class_310.java:1174) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.class_310.method_1514(class_310.java:801) ~[transformed-mod-minecraft.i0:0/:?]
    at net.minecraft.client.main.Main.main(Main.java:237) ~[minecraft-1.19.4-client.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.quiltmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:527) ~[quilt-loader-0.18.10.jar:?]
    at org.quiltmc.loader.impl.launch.knot.Knot.launch(Knot.java:82) ~[quilt-loader-0.18.10.jar:?]
    at org.quiltmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:28) ~[quilt-loader-0.18.10.jar:?]
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88) ~[NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126) ~[NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:71) ~[NewLaunch.jar:?]
ewpratten commented 1 year ago

The issue is due to this faulty REGEX pattern:

(.+):\((\d+), (\d+), (\d+)\)

Which should really be:

(.+):\(([\d\-]+), ([\d\-]+), ([\d\-]+)\)
ewpratten commented 1 year ago

Fixed in MR-RELEASE-YEmUMb25