3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

Fix injectors, should work with Spigot/Paper 1.20.5 now

Dieser Commit ist enthalten in:
onebeastchris 2024-04-28 23:41:13 +02:00
Ursprung 9217414c8c
Commit 9b1e45007a
5 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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());
} }
} }
}) })

Datei anzeigen

@ -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());
} }
} }
}) })

Datei anzeigen

@ -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(

Datei anzeigen

@ -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());

Datei anzeigen

@ -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(