Fixed incompatibility with an amazing mod

This commit is contained in:
FlorianMichael 2023-04-20 00:06:04 +02:00
parent 12cc6399f5
commit 5515d4eefc
3 changed files with 17 additions and 3 deletions

View File

@ -72,7 +72,6 @@ It should work fine with most if not all mods and modpacks.
### Known incompatibilities:
- ***[ViaFabric](https://github.com/ViaVersion/ViaFabric)***
- ***[multiconnect](https://github.com/Earthcomputer/multiconnect)***
- ***[Krypton](https://github.com/astei/krypton)***
## Supported Server versions
- Release (1.0.0 - 1.20 [23w14a])

View File

@ -18,6 +18,7 @@
package de.florianmichael.viafabricplus.protocolhack.netty;
import com.viaversion.viaversion.api.connection.UserConnection;
import de.florianmichael.viafabricplus.ViaFabricPlus;
import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.DisconnectHandle;
import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.PingEncapsulationCodec;
@ -26,8 +27,10 @@ import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.libra
import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.library_fix.FixedUnconnectedPongDecoder;
import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.netty.VLBPipeline;
import de.florianmichael.vialoadingbase.netty.event.CompressionReorderEvent;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import net.lenni0451.reflect.stream.RStream;
import net.raphimc.viabedrock.api.BedrockProtocolVersion;
import net.raphimc.viabedrock.netty.BatchLengthCodec;
import net.raphimc.viabedrock.netty.PacketEncapsulationCodec;
@ -112,6 +115,19 @@ public class ViaFabricPlusVLBPipeline extends VLBPipeline {
}
}
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
// Bypass, because Krypton overwrites the entire compression instead of modifying the handlers.
if (evt.getClass().getName().equals("me.steinborn.krypton.mod.shared.misc.KryptonPipelineEvent")) {
if (evt.toString().equals("COMPRESSION_ENABLED")) {
super.userEventTriggered(ctx, new CompressionReorderEvent());
ViaFabricPlus.LOGGER.info("Compression has been re-sorted after \"Krypton\"");
return;
}
}
super.userEventTriggered(ctx, evt);
}
@Override
public String getDecoderHandlerName() {
return "decoder";

View File

@ -34,7 +34,6 @@
},
"breaks": {
"viafabric": "*",
"multiconnect": "*",
"krypton": "*"
"multiconnect": "*"
}
}