mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-21 11:35:16 +01:00
1.18-pre1, fix #161 ?
This commit is contained in:
parent
7436b2c6da
commit
51ac0be637
@ -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"
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ public abstract class AbstractFabricPlatform implements ViaPlatform<UUID> {
|
||||
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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -5,7 +5,7 @@ import net.minecraft.SharedConstants;
|
||||
|
||||
public class FabricNativeVersionProvider implements NativeVersionProvider {
|
||||
@Override
|
||||
public int getServerProtocolVersion() {
|
||||
public int getNativeServerVersion() {
|
||||
return SharedConstants.getGameVersion().getProtocolVersion();
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import net.minecraft.SharedConstants;
|
||||
|
||||
public class FabricNativeVersionProvider implements NativeVersionProvider {
|
||||
@Override
|
||||
public int getServerProtocolVersion() {
|
||||
public int getNativeServerVersion() {
|
||||
return SharedConstants.getGameVersion().getProtocolVersion();
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import net.minecraft.SharedConstants;
|
||||
|
||||
public class FabricNativeVersionProvider implements NativeVersionProvider {
|
||||
@Override
|
||||
public int getServerProtocolVersion() {
|
||||
public int getNativeServerVersion() {
|
||||
return SharedConstants.getGameVersion().getProtocolVersion();
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import net.minecraft.SharedConstants;
|
||||
|
||||
public class FabricNativeVersionProvider implements NativeVersionProvider {
|
||||
@Override
|
||||
public int getServerProtocolVersion() {
|
||||
public int getNativeServerVersion() {
|
||||
return SharedConstants.getGameVersion().getProtocolVersion();
|
||||
}
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import net.minecraft.SharedConstants;
|
||||
|
||||
public class FabricNativeVersionProvider implements NativeVersionProvider {
|
||||
@Override
|
||||
public int getServerProtocolVersion() {
|
||||
public int getNativeServerVersion() {
|
||||
return SharedConstants.getGameVersion().getProtocolVersion();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user