mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-22 21:42:44 +01:00
added Debugging decoder
This commit is contained in:
parent
80b93de586
commit
dce621a30b
@ -5,8 +5,8 @@ import com.viaversion.viaversion.connection.UserConnectionImpl;
|
||||
import com.viaversion.viaversion.protocol.ProtocolPipelineImpl;
|
||||
import de.florianmichael.viafabricplus.ViaFabricPlus;
|
||||
import de.florianmichael.viafabricplus.platform.PreNettyConstants;
|
||||
import de.florianmichael.viafabricplus.platform.VFPVLBViaDecodeHandler;
|
||||
import de.florianmichael.vialoadingbase.ViaLoadingBase;
|
||||
import de.florianmichael.vialoadingbase.netty.VLBViaDecodeHandler;
|
||||
import de.florianmichael.vialoadingbase.netty.VLBViaEncodeHandler;
|
||||
import de.florianmichael.vialoadingbase.netty.NettyConstants;
|
||||
import io.netty.channel.Channel;
|
||||
@ -40,7 +40,7 @@ public class MixinClientConnection_1 {
|
||||
new ProtocolPipelineImpl(user);
|
||||
|
||||
channel.pipeline().addBefore("encoder", NettyConstants.HANDLER_ENCODER_NAME, new VLBViaEncodeHandler(user));
|
||||
channel.pipeline().addBefore("decoder", NettyConstants.HANDLER_DECODER_NAME, new VLBViaDecodeHandler(user));
|
||||
channel.pipeline().addBefore("decoder", NettyConstants.HANDLER_DECODER_NAME, new VFPVLBViaDecodeHandler(user));
|
||||
|
||||
if (ViaLoadingBase.getClassWrapper().getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||
user.getProtocolInfo().getPipeline().add(PreNettyBaseProtocol.INSTANCE);
|
||||
|
@ -15,9 +15,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@Mixin(InGameHud.class)
|
||||
public abstract class MixinInGameHud {
|
||||
|
||||
@Shadow
|
||||
protected abstract int getHeartCount(LivingEntity entity);
|
||||
|
||||
@Shadow
|
||||
private int scaledWidth;
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
package de.florianmichael.viafabricplus.platform;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.exception.CancelCodecException;
|
||||
import com.viaversion.viaversion.util.PipelineUtil;
|
||||
import de.florianmichael.vialoadingbase.netty.VLBViaDecodeHandler;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class VFPVLBViaDecodeHandler extends VLBViaDecodeHandler {
|
||||
|
||||
public VFPVLBViaDecodeHandler(UserConnection info) {
|
||||
super(info);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf bytebuf, List<Object> out) throws Exception {
|
||||
try {
|
||||
super.decode(ctx, bytebuf, out);
|
||||
} catch (Throwable e) {
|
||||
if (PipelineUtil.containsCause(e, CancelCodecException.class)) throw e;
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "ViaLoadingBase Packet Error occurred", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ public class VisualSettings extends SettingGroup {
|
||||
public final static VisualSettings self = new VisualSettings();
|
||||
|
||||
// 1.19.2 -> 1.19
|
||||
public final ProtocolSyncBooleanSetting disableSecureChatWarning = new ProtocolSyncBooleanSetting(this, "Disable secure chat warning", ProtocolRange.andOlder(ProtocolVersion.v1_19));
|
||||
public final ProtocolSyncBooleanSetting disableSecureChatWarning = new ProtocolSyncBooleanSetting(this, "Disable secure chat warning", ProtocolRange.andOlder(ProtocolVersion.v1_19));
|
||||
|
||||
// 1.19 -> 1.18.2
|
||||
public final ProtocolSyncBooleanSetting hideSignatureIndicator = new ProtocolSyncBooleanSetting(this, "Hide signature indicator", ProtocolRange.andOlder(ProtocolVersion.v1_18_2));
|
||||
|
Loading…
Reference in New Issue
Block a user