diff --git a/build.gradle b/build.gradle index 15706b2..9fd76e0 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ plugins { } def ENV = System.getenv() -def vvVer = "4.1.0-21w44a-SNAPSHOT" +def vvVer = "4.1.0-1.18-pre1-SNAPSHOT" def yamlVer = "1.29" description = "Client-side and server-side ViaVersion implementation for Fabric" diff --git a/src/main/java/com/viaversion/fabric/common/platform/NativeVersionProvider.java b/src/main/java/com/viaversion/fabric/common/platform/NativeVersionProvider.java index 8366e7f..ced2e6d 100644 --- a/src/main/java/com/viaversion/fabric/common/platform/NativeVersionProvider.java +++ b/src/main/java/com/viaversion/fabric/common/platform/NativeVersionProvider.java @@ -3,5 +3,5 @@ package com.viaversion.fabric.common.platform; import com.viaversion.viaversion.api.platform.providers.Provider; public interface NativeVersionProvider extends Provider { - int getServerProtocolVersion(); + int getNativeServerVersion(); } diff --git a/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java b/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java index acd59ba..6d5957d 100644 --- a/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java +++ b/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java @@ -183,7 +183,7 @@ public abstract class AbstractFabricPlatform implements ViaPlatform { platformSpecific.add("mods", mods); NativeVersionProvider ver = Via.getManager().getProviders().get(NativeVersionProvider.class); if (ver != null) { - platformSpecific.addProperty("native version", ver.getServerProtocolVersion()); + platformSpecific.addProperty("native version", ver.getNativeServerVersion()); } return platformSpecific; } diff --git a/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricVersionProvider.java b/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricVersionProvider.java index edefef7..386f8bf 100644 --- a/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricVersionProvider.java +++ b/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricVersionProvider.java @@ -105,7 +105,7 @@ public abstract class AbstractFabricVersionProvider extends BaseVersionProvider } NativeVersionProvider natProvider = Via.getManager().getProviders().get(NativeVersionProvider.class); if (natProvider != null) { - return natProvider.getServerProtocolVersion(); + return ProtocolVersion.getProtocol(natProvider.getNativeServerVersion()).getVersion(); } return super.getClosestServerProtocol(connection); } diff --git a/src/main/java/com/viaversion/fabric/common/util/ProtocolUtils.java b/src/main/java/com/viaversion/fabric/common/util/ProtocolUtils.java index 3f318c9..55f4d80 100644 --- a/src/main/java/com/viaversion/fabric/common/util/ProtocolUtils.java +++ b/src/main/java/com/viaversion/fabric/common/util/ProtocolUtils.java @@ -11,7 +11,7 @@ public class ProtocolUtils { public static boolean isSupportedClientSide(int server) { return isSupported(server, Via.getManager().getProviders() .get(NativeVersionProvider.class) - .getServerProtocolVersion()); + .getNativeServerVersion()); } public static boolean isSupported(int server, int client) { diff --git a/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/platform/FabricNativeVersionProvider.java b/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/platform/FabricNativeVersionProvider.java index 8f996c3..c5b180c 100644 --- a/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/platform/FabricNativeVersionProvider.java +++ b/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/platform/FabricNativeVersionProvider.java @@ -5,7 +5,7 @@ import net.minecraft.SharedConstants; public class FabricNativeVersionProvider implements NativeVersionProvider { @Override - public int getServerProtocolVersion() { + public int getNativeServerVersion() { return SharedConstants.getGameVersion().getProtocolVersion(); } } diff --git a/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/platform/FabricNativeVersionProvider.java b/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/platform/FabricNativeVersionProvider.java index 7ab6a71..c21e7f2 100644 --- a/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/platform/FabricNativeVersionProvider.java +++ b/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/platform/FabricNativeVersionProvider.java @@ -5,7 +5,7 @@ import net.minecraft.SharedConstants; public class FabricNativeVersionProvider implements NativeVersionProvider { @Override - public int getServerProtocolVersion() { + public int getNativeServerVersion() { return SharedConstants.getGameVersion().getProtocolVersion(); } } diff --git a/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/platform/FabricNativeVersionProvider.java b/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/platform/FabricNativeVersionProvider.java index 8e580ed..043d8f7 100644 --- a/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/platform/FabricNativeVersionProvider.java +++ b/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/platform/FabricNativeVersionProvider.java @@ -5,7 +5,7 @@ import net.minecraft.SharedConstants; public class FabricNativeVersionProvider implements NativeVersionProvider { @Override - public int getServerProtocolVersion() { + public int getNativeServerVersion() { return SharedConstants.getGameVersion().getProtocolVersion(); } } diff --git a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/platform/FabricNativeVersionProvider.java b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/platform/FabricNativeVersionProvider.java index 0c7ba6f..ad94a1e 100644 --- a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/platform/FabricNativeVersionProvider.java +++ b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/platform/FabricNativeVersionProvider.java @@ -5,7 +5,7 @@ import net.minecraft.SharedConstants; public class FabricNativeVersionProvider implements NativeVersionProvider { @Override - public int getServerProtocolVersion() { + public int getNativeServerVersion() { return SharedConstants.getGameVersion().getProtocolVersion(); } } diff --git a/viafabric-mc118/build.gradle.kts b/viafabric-mc118/build.gradle.kts index 6f661f6..bc39b77 100644 --- a/viafabric-mc118/build.gradle.kts +++ b/viafabric-mc118/build.gradle.kts @@ -1,7 +1,7 @@ dependencies { - minecraft("com.mojang:minecraft:21w44a") - mappings("net.fabricmc:yarn:21w44a+build.4:v2") + minecraft("com.mojang:minecraft:1.18-pre1") + mappings("net.fabricmc:yarn:1.18-pre1+build.5:v2") - modImplementation("net.fabricmc.fabric-api:fabric-api:0.42.0+1.18") + modImplementation("net.fabricmc.fabric-api:fabric-api:0.42.2+1.18") modImplementation("com.terraformersmc:modmenu:3.0.0") } diff --git a/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/platform/FabricNativeVersionProvider.java b/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/platform/FabricNativeVersionProvider.java index f4c97fb..e1ec98a 100644 --- a/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/platform/FabricNativeVersionProvider.java +++ b/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/platform/FabricNativeVersionProvider.java @@ -5,7 +5,7 @@ import net.minecraft.SharedConstants; public class FabricNativeVersionProvider implements NativeVersionProvider { @Override - public int getServerProtocolVersion() { + public int getNativeServerVersion() { return SharedConstants.getGameVersion().getProtocolVersion(); } } diff --git a/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/platform/FabricNativeVersionProvider.java b/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/platform/FabricNativeVersionProvider.java index b72002a..cf267a9 100644 --- a/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/platform/FabricNativeVersionProvider.java +++ b/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/platform/FabricNativeVersionProvider.java @@ -10,7 +10,7 @@ import net.minecraft.server.MinecraftServer; public class FabricNativeVersionProvider implements NativeVersionProvider { @Override - public int getServerProtocolVersion() { + public int getNativeServerVersion() { if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) { return getClientProtocol(); }