4.7.0 Release

This commit is contained in:
Nassim Jahnke 2023-06-06 13:31:12 +02:00
parent ceb08c1e55
commit 63a3908b53
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
3 changed files with 10 additions and 1 deletions

View File

@ -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."
}

View File

@ -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?)