mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-12-19 15:57:37 +01:00
return native version on server-side, allow untested mc versions
closes #165
This commit is contained in:
parent
0035c47d2a
commit
db57ced2bb
@ -1,11 +1,15 @@
|
||||
package com.viaversion.fabric.common.platform;
|
||||
|
||||
import com.viaversion.fabric.common.handler.CommonTransformer;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.platform.ViaInjector;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.IntLinkedOpenHashSet;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.IntSortedSet;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.IntSortedSets;
|
||||
import com.viaversion.viaversion.libs.gson.JsonObject;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
public class FabricInjector implements ViaInjector {
|
||||
@Override
|
||||
@ -35,6 +39,10 @@ public class FabricInjector implements ViaInjector {
|
||||
|
||||
@Override
|
||||
public IntSortedSet getServerProtocolVersions() {
|
||||
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER) {
|
||||
int version = Via.getManager().getProviders().get(NativeVersionProvider.class).getNativeServerVersion();
|
||||
return IntSortedSets.singleton(version);
|
||||
}
|
||||
// On client-side we can connect to any server version
|
||||
IntSortedSet versions = new IntLinkedOpenHashSet();
|
||||
versions.add(ProtocolVersion.v1_7_1.getOriginalVersion());
|
||||
|
@ -13,7 +13,7 @@
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.10.0",
|
||||
"minecraft": ["1.8.9", "1.14.4", "1.15.2", "1.16.5", "1.17.1", "1.18.x"],
|
||||
"minecraft": ["1.8.x", "1.14.x", "1.15.x", "1.16.x", "1.17.x", "1.18.x"],
|
||||
"viaversion": ">=4.0.0"
|
||||
},
|
||||
"environment": "*",
|
||||
|
Loading…
Reference in New Issue
Block a user