Update ViaVersion

This commit is contained in:
Nassim Jahnke 2023-03-12 10:39:52 +01:00
parent 8100a1f463
commit 89b178dbd2
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
9 changed files with 37 additions and 29 deletions

View File

@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xms32M -Xmx3G -XX:+UseG1GC -XX:+UseStringDeduplication
loader_version=0.14.12
viaver_version=4.5.2-SNAPSHOT
viaver_version=4.6.0-1.19.4-rc2-SNAPSHOT
yaml_version=1.33
# example: 1.19.1-rc2

View File

@ -76,6 +76,14 @@ public abstract class AbstractFabricPlatform implements ViaPlatform<UUID> {
}));
}
@Override
public FutureTaskId runRepeatingAsync(Runnable runnable, long ticks) {
return new FutureTaskId(eventLoop()
.scheduleAtFixedRate(() -> runAsync(runnable), 0, ticks * 50, TimeUnit.MILLISECONDS)
.addListener(errorLogger())
);
}
@Override
public FutureTaskId runSync(Runnable runnable, long ticks) {
// ViaVersion seems to not need to run delayed tasks on main thread

View File

@ -14,7 +14,6 @@ import com.viaversion.fabric.mc114.platform.FabricPlatform;
import com.viaversion.fabric.mc114.platform.VFLoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
@ -67,9 +66,8 @@ public class ViaFabric implements ModInitializer {
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
ViaManagerImpl manager = (ViaManagerImpl) Via.getManager();
manager.init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
@ -81,6 +79,8 @@ public class ViaFabric implements ModInitializer {
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
manager.onServerLoaded();
INIT_FUTURE.complete(null);
}

View File

@ -14,7 +14,6 @@ import com.viaversion.fabric.mc115.platform.FabricPlatform;
import com.viaversion.fabric.mc115.platform.VFLoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
@ -67,9 +66,8 @@ public class ViaFabric implements ModInitializer {
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
ViaManagerImpl manager = (ViaManagerImpl) Via.getManager();
manager.init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
@ -81,6 +79,8 @@ public class ViaFabric implements ModInitializer {
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
manager.onServerLoaded();
INIT_FUTURE.complete(null);
}

View File

@ -14,7 +14,6 @@ import com.viaversion.fabric.mc116.platform.FabricPlatform;
import com.viaversion.fabric.mc116.platform.VFLoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer {
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
ViaManagerImpl manager = (ViaManagerImpl) Via.getManager();
manager.init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer {
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
manager.onServerLoaded();
INIT_FUTURE.complete(null);
}

View File

@ -14,7 +14,6 @@ import com.viaversion.fabric.mc117.platform.FabricPlatform;
import com.viaversion.fabric.mc117.platform.VFLoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer {
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
ViaManagerImpl manager = (ViaManagerImpl) Via.getManager();
manager.init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer {
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
manager.onServerLoaded();
INIT_FUTURE.complete(null);
}

View File

@ -14,7 +14,6 @@ import com.viaversion.fabric.mc118.platform.FabricPlatform;
import com.viaversion.fabric.mc118.platform.VFLoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer {
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
ViaManagerImpl manager = (ViaManagerImpl) Via.getManager();
manager.init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer {
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
manager.onServerLoaded();
INIT_FUTURE.complete(null);
}

View File

@ -14,7 +14,6 @@ import com.viaversion.fabric.mc119.platform.FabricPlatform;
import com.viaversion.fabric.mc119.platform.VFLoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer {
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
ViaManagerImpl manager = (ViaManagerImpl) Via.getManager();
manager.init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer {
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
manager.onServerLoaded();
INIT_FUTURE.complete(null);
}

View File

@ -12,7 +12,6 @@ import com.viaversion.fabric.mc18.platform.FabricPlatform;
import com.viaversion.fabric.mc18.platform.VFLoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.channel.EventLoop;
import io.netty.channel.local.LocalEventLoopGroup;
@ -53,9 +52,8 @@ public class ViaFabric implements ModInitializer {
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
ViaManagerImpl manager = (ViaManagerImpl) Via.getManager();
manager.init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
@ -67,6 +65,8 @@ public class ViaFabric implements ModInitializer {
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
manager.onServerLoaded();
INIT_FUTURE.complete(null);
}