mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-25 17:27:52 +01:00
1.19.1-pre6
This commit is contained in:
parent
fb334c6c14
commit
941bb91be8
@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
allprojects {
|
||||
group = "com.viaversion"
|
||||
version = "4.4.0-1.19.1-pre5-SNAPSHOT"
|
||||
version = "4.4.0-1.19.1-pre6-SNAPSHOT"
|
||||
description = "Allow older clients to join newer server versions."
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,11 @@ public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform {
|
||||
}
|
||||
|
||||
private void onServerLoaded() {
|
||||
if (isOutdatedPostLoad()) {
|
||||
disable();
|
||||
return;
|
||||
}
|
||||
|
||||
BukkitViaLoader loader = (BukkitViaLoader) Via.getManager().getLoader();
|
||||
int protocolVersion = Via.getAPI().getServerVersion().highestSupportedVersion();
|
||||
if (protocolVersion >= ProtocolVersion.v1_16.getVersion()) {
|
||||
|
@ -70,7 +70,10 @@ public interface ViaBackwardsPlatform {
|
||||
|
||||
ViaBackwards.init(this, config);
|
||||
|
||||
if (isOutdated()) return;
|
||||
if (isOutdated()) {
|
||||
disable();
|
||||
return;
|
||||
}
|
||||
|
||||
Via.getManager().getSubPlatforms().add(IMPL_VERSION);
|
||||
|
||||
@ -133,11 +136,16 @@ public interface ViaBackwardsPlatform {
|
||||
getLogger().severe("LINK: https://ci.viaversion.com/");
|
||||
getLogger().severe("VIABACKWARDS WILL NOW DISABLE");
|
||||
getLogger().severe("================================");
|
||||
|
||||
disable();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isOutdatedPostLoad() {
|
||||
if (!Via.getPlatform().isProxy() && Via.getAPI().getServerVersion().highestSupportedVersion() == ProtocolVersion.v1_19.getVersion()) {
|
||||
// Print a warning but still allow it
|
||||
getLogger().warning("This version of ViaBackwards does not fully support 1.19 servers. Please downgrade to ViaBackwards 4.3.1 for better support of that version.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ public final class Protocol1_18_2To1_19_1 extends BackwardsProtocol<ClientboundP
|
||||
final PlayerMessageSignature signature = wrapper.read(Type.PLAYER_MESSAGE_SIGNATURE);
|
||||
|
||||
// Store message signature for last seen
|
||||
if (!signature.uuid().equals(ZERO_UUID)) {
|
||||
if (!signature.uuid().equals(ZERO_UUID) && signature.signatureBytes().length != 0) {
|
||||
final ReceivedMessagesStorage messagesStorage = wrapper.user().get(ReceivedMessagesStorage.class);
|
||||
messagesStorage.add(signature);
|
||||
if (messagesStorage.tickUnacknowledged() > 64) {
|
||||
@ -223,7 +223,8 @@ public final class Protocol1_18_2To1_19_1 extends BackwardsProtocol<ClientboundP
|
||||
}
|
||||
|
||||
// Send the unsigned message if present, otherwise the signed message
|
||||
JsonElement message = wrapper.read(Type.COMPONENT); // Plain message
|
||||
String plainMessage = wrapper.read(Type.STRING); // Plain message
|
||||
JsonElement message = null;
|
||||
JsonElement decoratedMessage = wrapper.read(Type.OPTIONAL_COMPONENT);
|
||||
if (decoratedMessage != null) {
|
||||
message = decoratedMessage;
|
||||
@ -238,6 +239,11 @@ public final class Protocol1_18_2To1_19_1 extends BackwardsProtocol<ClientboundP
|
||||
if (unsignedMessage != null) {
|
||||
message = unsignedMessage;
|
||||
}
|
||||
if (message == null) {
|
||||
// If no decorated or unsigned message is given, use the plain one
|
||||
message = GsonComponentSerializer.gson().serializeToTree(Component.text(plainMessage));
|
||||
}
|
||||
|
||||
wrapper.write(Type.COMPONENT, message);
|
||||
|
||||
final int chatTypeId = wrapper.read(Type.VAR_INT);
|
||||
@ -285,8 +291,6 @@ public final class Protocol1_18_2To1_19_1 extends BackwardsProtocol<ClientboundP
|
||||
}
|
||||
wrapper.write(Type.BOOLEAN, false); // No signed preview
|
||||
|
||||
// Write last seen messages - even though we don't actually need to send them since everything will be unsigned,
|
||||
// we'll try and play nice with sending them anyway.
|
||||
final ReceivedMessagesStorage messagesStorage = wrapper.user().get(ReceivedMessagesStorage.class);
|
||||
messagesStorage.resetUnacknowledgedCount();
|
||||
wrapper.write(Type.PLAYER_MESSAGE_SIGNATURE_ARRAY, messagesStorage.lastSignatures());
|
||||
|
@ -231,11 +231,7 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
}
|
||||
|
||||
// Remove public profile signature
|
||||
if (wrapper.read(Type.BOOLEAN)) {
|
||||
wrapper.read(Type.LONG); // Timestamp
|
||||
wrapper.read(Type.BYTE_ARRAY_PRIMITIVE); // Key
|
||||
wrapper.read(Type.BYTE_ARRAY_PRIMITIVE); // Signature
|
||||
}
|
||||
wrapper.read(Type.OPTIONAL_PROFILE_KEY);
|
||||
} else if (action == 1 || action == 2) { // Update gamemode/update latency
|
||||
wrapper.passthrough(Type.VAR_INT);
|
||||
} else if (action == 3) { // Update display name
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"1.19": {
|
||||
"1.19.1": {
|
||||
"selectWorld.loading_list": "Loading world list",
|
||||
"flat_world_preset.unknown": "???",
|
||||
"flat_world_preset.minecraft.classic_flat": "Classic Flat",
|
||||
|
@ -3,7 +3,7 @@ metadata.format.version = "1.1"
|
||||
[versions]
|
||||
|
||||
# ViaVersion
|
||||
viaver = "4.4.0-1.19.1-pre5-SNAPSHOT"
|
||||
viaver = "4.4.0-1.19.1-pre6-SNAPSHOT"
|
||||
|
||||
# Common provided
|
||||
netty = "4.0.20.Final"
|
||||
|
Loading…
Reference in New Issue
Block a user