3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01:00

Tell the server we loaded the resource pack (#4183)

* Tell the server we loaded the resource pack
* Decline resource packs if they are not required

---------

Co-authored-by: onebeastchris <github@onechris.mozmail.com>
Dieser Commit ist enthalten in:
rtm516 2023-10-07 21:38:44 +01:00 committet von GitHub
Ursprung e8eccc64be
Commit 30cca70e56
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -38,6 +38,11 @@ public class JavaClientboundResourcePacksPacket extends PacketTranslator<Clientb
@Override @Override
public void translate(GeyserSession session, ClientboundResourcePackPacket packet) { public void translate(GeyserSession session, ClientboundResourcePackPacket packet) {
// We need to "answer" this to avoid timeout issues related to resource packs // We need to "answer" this to avoid timeout issues related to resource packs
// If packs are required, we need to lie to the server that we accepted them, as we get kicked otherwise.
if (packet.isRequired()) {
session.sendDownstreamPacket(new ServerboundResourcePackPacket(ResourcePackStatus.SUCCESSFULLY_LOADED));
} else {
session.sendDownstreamPacket(new ServerboundResourcePackPacket(ResourcePackStatus.DECLINED)); session.sendDownstreamPacket(new ServerboundResourcePackPacket(ResourcePackStatus.DECLINED));
} }
}
} }