3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 16:40:10 +01:00

Convert boss bar packets

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-10-13 23:28:16 +10:00
Ursprung 958064b44c
Commit fa7096c5c1

Datei anzeigen

@ -138,6 +138,14 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
}
}
});
registerClientbound(ClientboundPackets1_20_2.BOSSBAR, wrapper -> {
wrapper.passthrough(Type.UUID); // Id
final int action = wrapper.passthrough(Type.VAR_INT);
if (action == 0 || action == 3) {
convertComponent(wrapper);
}
});
registerClientbound(ClientboundPackets1_20_2.PLAYER_CHAT, wrapper -> {
wrapper.passthrough(Type.UUID); // Sender
wrapper.passthrough(Type.VAR_INT); // Index
@ -280,7 +288,6 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
public static @Nullable Tag jsonComponentToTag(@Nullable final JsonElement component) {
try {
// This mostly works:tm:
return convertToTag(component);
} catch (final Exception e) {
Via.getPlatform().getLogger().severe("Error converting component: " + component);