1.19.1-pre2 (at least an initial pass)

This commit is contained in:
Nassim Jahnke 2022-06-28 12:26:55 +02:00
parent 54507c6175
commit 7173bbbbce
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
4 changed files with 34 additions and 3 deletions

View File

@ -5,7 +5,7 @@ plugins {
allprojects {
group = "com.viaversion"
version = "4.3.1-1.19.1-pre1-SNAPSHOT"
version = "4.3.1-1.19.1-pre2-SNAPSHOT"
description = "Allow older clients to join newer server versions."
}

View File

@ -269,7 +269,7 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
@Override
public void registerMap() {
map(Type.STRING); // Name
create(Type.BOOLEAN, false); // No public key - requiring this has to be disabled on the server
create(Type.OPTIONAL_PROFILE_KEY, null); // No public key - requiring this has to be disabled on the server
}
});

View File

@ -20,7 +20,11 @@ package com.viaversion.viabackwards.protocol.protocol1_19to1_19_1;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.protocol.protocol1_19to1_19_1.packets.EntityPackets1_19_1;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
import com.viaversion.viaversion.protocols.base.ServerboundLoginPackets;
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ClientboundPackets1_19;
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ServerboundPackets1_19;
@ -31,6 +35,33 @@ public final class Protocol1_19To1_19_1 extends BackwardsProtocol<ClientboundPac
@Override
protected void registerPackets() {
entityRewriter.register();
// Skip 1.19 and assume 1.19.1->1.18.2 translation
registerClientbound(ClientboundPackets1_19.SYSTEM_CHAT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.COMPONENT);
handler(wrapper -> {
if (wrapper.read(Type.BOOLEAN)) {
wrapper.cancel();
return;
}
wrapper.write(Type.VAR_INT, 0); // TODO
});
}
});
registerServerbound(State.LOGIN, ServerboundLoginPackets.HELLO.getId(), ServerboundLoginPackets.HELLO.getId(), new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // Name
// Write empty profile key and uuid
read(Type.OPTIONAL_PROFILE_KEY);
create(Type.OPTIONAL_PROFILE_KEY, null);
create(Type.OPTIONAL_UUID, null);
}
});
}
@Override

View File

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions]
# ViaVersion
viaver = "4.3.2-1.19.1-pre1-SNAPSHOT"
viaver = "4.3.2-1.19.1-pre2-SNAPSHOT"
# Common provided
netty = "4.0.20.Final"