Print network stacktraces

This commit is contained in:
Nassim Jahnke 2023-10-13 23:20:54 +10:00
parent 158ba3ee93
commit 573fc8e2b4
4 changed files with 27 additions and 2 deletions

View File

@ -13,7 +13,7 @@
},
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": ["1.8.9", "1.14.4", "1.15.2", "1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.2"],
"minecraft": ["1.8.9", "1.14.4", "1.15.2", "1.16.5", "1.17.1", "1.18.2", "1.19.4", ">=1.20.2"],
"viaversion": ">=4.8.1"
},
"breaks": {

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc120.mixin.debug.client;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.ClientConnection;
import org.slf4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ClientConnection.class)
public abstract class MixinClientConnection {
@Shadow
@Final
private static Logger LOGGER;
@Inject(method = "exceptionCaught", at = @At("TAIL"))
public void exceptionCaught(ChannelHandlerContext context, Throwable ex, CallbackInfo ci) {
LOGGER.error("Packet error", ex);
}
}

View File

@ -40,7 +40,7 @@
},
"depends": {
"fabric-resource-loader-v0": "*",
"minecraft": ["1.20.2"],
"minecraft": [">=1.20.2"],
"viafabric": "*"
},
"recommends": {

View File

@ -6,6 +6,7 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinClientConnection",
"client.MixinDebugHud"
],
"injectors": {