mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix injectors, should work with Spigot/Paper 1.20.5 now
This commit is contained in:
parent
9217414c8c
commit
9b1e45007a
5 changed files with 11 additions and 2 deletions
|
@ -93,8 +93,11 @@ public class GeyserModInjector extends GeyserInjector {
|
||||||
protected void initChannel(@NonNull Channel ch) throws Exception {
|
protected void initChannel(@NonNull Channel ch) throws Exception {
|
||||||
initChannel.invoke(childHandler, ch);
|
initChannel.invoke(childHandler, ch);
|
||||||
|
|
||||||
|
int index = ch.pipeline().names().indexOf("encoder");
|
||||||
|
String baseName = index != -1 ? "encoder" : "outbound_config";
|
||||||
|
|
||||||
if (bootstrap.getGeyserConfig().isDisableCompression()) {
|
if (bootstrap.getGeyserConfig().isDisableCompression()) {
|
||||||
ch.pipeline().addAfter("encoder", "geyser-compression-disabler", new GeyserModCompressionDisabler());
|
ch.pipeline().addAfter(baseName, "geyser-compression-disabler", new GeyserModCompressionDisabler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -119,8 +119,11 @@ public class GeyserSpigotInjector extends GeyserInjector {
|
||||||
protected void initChannel(@NonNull Channel ch) throws Exception {
|
protected void initChannel(@NonNull Channel ch) throws Exception {
|
||||||
initChannel.invoke(childHandler, ch);
|
initChannel.invoke(childHandler, ch);
|
||||||
|
|
||||||
|
int index = ch.pipeline().names().indexOf("encoder");
|
||||||
|
String baseName = index != -1 ? "encoder" : "outbound_config";
|
||||||
|
|
||||||
if (bootstrap.getGeyserConfig().isDisableCompression() && GeyserSpigotCompressionDisabler.ENABLED) {
|
if (bootstrap.getGeyserConfig().isDisableCompression() && GeyserSpigotCompressionDisabler.ENABLED) {
|
||||||
ch.pipeline().addAfter("encoder", "geyser-compression-disabler", new GeyserSpigotCompressionDisabler());
|
ch.pipeline().addAfter(baseName, "geyser-compression-disabler", new GeyserSpigotCompressionDisabler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -33,6 +33,7 @@ import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.Serverbound
|
||||||
|
|
||||||
@Translator(packet = ClientboundCookieRequestPacket.class)
|
@Translator(packet = ClientboundCookieRequestPacket.class)
|
||||||
public class JavaCookieRequestTranslator extends PacketTranslator<ClientboundCookieRequestPacket> {
|
public class JavaCookieRequestTranslator extends PacketTranslator<ClientboundCookieRequestPacket> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translate(GeyserSession session, ClientboundCookieRequestPacket packet) {
|
public void translate(GeyserSession session, ClientboundCookieRequestPacket packet) {
|
||||||
ServerboundCookieResponsePacket responsePacket = new ServerboundCookieResponsePacket(
|
ServerboundCookieResponsePacket responsePacket = new ServerboundCookieResponsePacket(
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.Clientbound
|
||||||
|
|
||||||
@Translator(packet = ClientboundStoreCookiePacket.class)
|
@Translator(packet = ClientboundStoreCookiePacket.class)
|
||||||
public class JavaStoreCookieTranslator extends PacketTranslator<ClientboundStoreCookiePacket> {
|
public class JavaStoreCookieTranslator extends PacketTranslator<ClientboundStoreCookiePacket> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translate(GeyserSession session, ClientboundStoreCookiePacket packet) {
|
public void translate(GeyserSession session, ClientboundStoreCookiePacket packet) {
|
||||||
session.getCookies().put(packet.getKey(), packet.getPayload());
|
session.getCookies().put(packet.getKey(), packet.getPayload());
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.Clientbound
|
||||||
|
|
||||||
@Translator(packet = ClientboundTransferPacket.class)
|
@Translator(packet = ClientboundTransferPacket.class)
|
||||||
public class JavaTransferPacketTranslator extends PacketTranslator<ClientboundTransferPacket> {
|
public class JavaTransferPacketTranslator extends PacketTranslator<ClientboundTransferPacket> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translate(GeyserSession session, ClientboundTransferPacket packet) {
|
public void translate(GeyserSession session, ClientboundTransferPacket packet) {
|
||||||
ServerTransferEvent event = new ServerTransferEvent(
|
ServerTransferEvent event = new ServerTransferEvent(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue