mirror of
https://github.com/ViaVersion/ViaLegacy.git
synced 2024-11-15 10:45:19 +01:00
Fixed 1.7.2 -> 1.6.4 translation
This commit is contained in:
parent
f84adb5e6c
commit
9bc0af52d5
@ -867,10 +867,21 @@ public class Protocol1_7_2_5to1_6_4 extends StatelessTransitionProtocol<Clientbo
|
||||
this.registerServerboundTransition(ServerboundLoginPackets.HELLO, ServerboundPackets1_6_4.CLIENT_PROTOCOL, wrapper -> {
|
||||
final HandshakeStorage handshakeStorage = wrapper.user().get(HandshakeStorage.class);
|
||||
|
||||
final String name = wrapper.read(Type.STRING); // user name
|
||||
|
||||
wrapper.write(Type.UNSIGNED_BYTE, (short) wrapper.user().getProtocolInfo().serverProtocolVersion().getVersion()); // protocol id
|
||||
wrapper.write(Types1_6_4.STRING, wrapper.read(Type.STRING)); // user name
|
||||
wrapper.write(Types1_6_4.STRING, name); // user name
|
||||
wrapper.write(Types1_6_4.STRING, handshakeStorage.getHostname()); // hostname
|
||||
wrapper.write(Type.INT, handshakeStorage.getPort()); // port
|
||||
|
||||
final ProtocolInfo info = wrapper.user().getProtocolInfo();
|
||||
// Set the information early
|
||||
if (info.getUsername() == null) {
|
||||
info.setUsername(name);
|
||||
}
|
||||
if (info.getUuid() == null) {
|
||||
info.setUuid(ViaLegacy.getConfig().isLegacySkinLoading() ? Via.getManager().getProviders().get(GameProfileFetcher.class).getMojangUUID(name) : new GameProfile(name).uuid);
|
||||
}
|
||||
});
|
||||
this.registerServerboundTransition(ServerboundLoginPackets.ENCRYPTION_KEY, ServerboundPackets1_6_4.SHARED_KEY, null);
|
||||
this.registerServerbound(ServerboundPackets1_7_2.CHAT_MESSAGE, new PacketHandlers() {
|
||||
|
@ -1170,8 +1170,12 @@ public class Protocol1_8to1_7_6_10 extends AbstractProtocol<ClientboundPackets1_
|
||||
final String name = wrapper.passthrough(Type.STRING); // name
|
||||
final ProtocolInfo info = wrapper.user().getProtocolInfo();
|
||||
// Set the information early
|
||||
if (info.getUsername() == null) {
|
||||
info.setUsername(name);
|
||||
}
|
||||
if (info.getUuid() == null) {
|
||||
info.setUuid(ViaLegacy.getConfig().isLegacySkinLoading() ? Via.getManager().getProviders().get(GameProfileFetcher.class).getMojangUUID(name) : new GameProfile(name).uuid);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user