Sync debug mixin to all ViaFabric versions

This commit is contained in:
FlorianMichael 2023-10-16 15:00:44 +02:00
parent f3151e820c
commit 36a41fd9b4
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
14 changed files with 182 additions and 7 deletions

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc114.mixin.debug.client;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.ClientConnection;
import org.apache.logging.log4j.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

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

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc115.mixin.debug.client;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.ClientConnection;
import org.apache.logging.log4j.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

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

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc116.mixin.debug.client;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.ClientConnection;
import org.apache.logging.log4j.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

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

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc117.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

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

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc118.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

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

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc119.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

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

View File

@ -0,0 +1,24 @@
package com.viaversion.fabric.mc18.mixin.debug.client;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.ClientConnection;
import org.apache.logging.log4j.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

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