3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-17 13:30:14 +01:00
Dieser Commit ist enthalten in:
Nassim Jahnke 2023-06-06 13:31:12 +02:00
Ursprung ceb08c1e55
Commit 63a3908b53
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
3 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ plugins {
allprojects {
group = "com.viaversion"
version = "4.7.0-1.20-rc1-SNAPSHOT"
version = "4.7.0"
description = "Allow older clients to join newer server versions."
}

Datei anzeigen

@ -32,6 +32,7 @@ import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ServerboundPac
import com.viaversion.viaversion.protocols.protocol1_20to1_19_4.Protocol1_20To1_19_4;
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter;
import java.util.Arrays;
public final class Protocol1_19_4To1_20 extends BackwardsProtocol<ClientboundPackets1_19_4, ClientboundPackets1_19_4, ServerboundPackets1_19_4, ServerboundPackets1_19_4> {
@ -69,6 +70,14 @@ public final class Protocol1_19_4To1_20 extends BackwardsProtocol<ClientboundPac
translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.DISGUISED_CHAT);
translatableRewriter.registerPing();
registerClientbound(ClientboundPackets1_19_4.UPDATE_ENABLED_FEATURES, wrapper -> {
String[] enabledFeatures = wrapper.read(Type.STRING_ARRAY);
final int length = enabledFeatures.length;
enabledFeatures = Arrays.copyOf(enabledFeatures, length + 1);
enabledFeatures[length] = "minecraft:update_1_20";
wrapper.write(Type.STRING_ARRAY, enabledFeatures);
});
registerClientbound(ClientboundPackets1_19_4.COMBAT_END, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Duration
wrapper.write(Type.INT, -1); // Killer ID - unused (who knows for how long?)