Skip to content

Commit

Permalink
Sync debug mixin to all ViaFabric versions
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Oct 16, 2023
1 parent f3151e8 commit 36a41fd
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinDebugHud"
"client.MixinDebugHud",
"client.MixinClientConnection"
],
"injectors": {
"defaultRequire": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinDebugHud"
"client.MixinDebugHud",
"client.MixinClientConnection"
],
"injectors": {
"defaultRequire": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinDebugHud"
"client.MixinDebugHud",
"client.MixinClientConnection"
],
"injectors": {
"defaultRequire": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinDebugHud"
"client.MixinDebugHud",
"client.MixinClientConnection"
],
"injectors": {
"defaultRequire": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinDebugHud"
"client.MixinDebugHud",
"client.MixinClientConnection"
],
"injectors": {
"defaultRequire": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinDebugHud"
"client.MixinDebugHud",
"client.MixinClientConnection"
],
"injectors": {
"defaultRequire": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"client": [
"client.MixinClientConnectionAccessor",
"client.MixinDebugHud"
"client.MixinDebugHud",
"client.MixinClientConnection"
],
"injectors": {
"defaultRequire": 0
Expand Down

0 comments on commit 36a41fd

Please sign in to comment.