From 941bb91be8b8d0535aa189d4bd8220576e7cfb38 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 20 Jul 2022 18:45:09 +0200 Subject: [PATCH] 1.19.1-pre6 --- build.gradle.kts | 2 +- .../com/viaversion/viabackwards/BukkitPlugin.java | 5 +++++ .../viabackwards/api/ViaBackwardsPlatform.java | 14 +++++++++++--- .../Protocol1_18_2To1_19_1.java | 12 ++++++++---- .../packets/EntityPackets1_19.java | 6 +----- .../viabackwards/data/translation-mappings.json | 2 +- gradle/libs.versions.toml | 2 +- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2e68f9b9..8b276ae0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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." } diff --git a/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java b/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java index b8baf673..74c8fd70 100644 --- a/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java +++ b/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java @@ -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()) { diff --git a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java index 2dd2b80b..058095e0 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java @@ -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; } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19_1/Protocol1_18_2To1_19_1.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19_1/Protocol1_18_2To1_19_1.java index e64e42e2..df6f1351 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19_1/Protocol1_18_2To1_19_1.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19_1/Protocol1_18_2To1_19_1.java @@ -208,7 +208,7 @@ public final class Protocol1_18_2To1_19_1 extends BackwardsProtocol 64) { @@ -223,7 +223,8 @@ public final class Protocol1_18_2To1_19_1 extends BackwardsProtocol