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

Workaround for missing Protocol1_9to1_8

Dieser Commit ist enthalten in:
Myles 2020-05-30 21:31:28 +01:00
Ursprung 796a42c981
Commit a60340f330
2 geänderte Dateien mit 18 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -143,12 +143,16 @@ public class BungeeServerHandler implements Listener {
if (protocolId <= ProtocolVersion.v1_8.getId()) { // 1.8 doesn't have BossBar packet
if (storage.getBossbar() != null) {
// TODO: Verify whether this packet needs to be sent when 1.8 -> 1.9 protocol isn't present in the pipeline
// This ensures we can encode it properly as only the 1.9 protocol is currently implemented.
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9To1_8.class)) {
for (UUID uuid : storage.getBossbar()) {
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
wrapper.write(Type.UUID, uuid);
wrapper.write(Type.VAR_INT, 1); // remove
wrapper.send(Protocol1_9To1_8.class, true, true);
}
}
storage.getBossbar().clear();
}
}

Datei anzeigen

@ -103,12 +103,16 @@ public class VelocityServerHandler {
if (protocolId <= ProtocolVersion.MINECRAFT_1_8.getProtocol()) { // 1.8 doesn't have BossBar packet
if (storage.getBossbar() != null) {
// TODO: Verify whether this packet needs to be sent when 1.8 -> 1.9 protocol isn't present in the pipeline
// This ensures we can encode it properly as only the 1.9 protocol is currently implemented.
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9To1_8.class)) {
for (UUID uuid : storage.getBossbar()) {
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
wrapper.write(Type.UUID, uuid);
wrapper.write(Type.VAR_INT, 1); // remove
wrapper.send(Protocol1_9To1_8.class, true, true);
}
}
storage.getBossbar().clear();
}
}