use of com.viaversion.viaversion.ViaManagerImpl in project ViaVersion by ViaVersion.
the class DummyInitializer method init.
public static void init() {
Via.init(new ViaManagerImpl(new TestPlatform(), null, null, null));
((ProtocolManagerImpl) Via.getManager().getProtocolManager()).registerProtocols();
}
use of com.viaversion.viaversion.ViaManagerImpl in project ViaFabric by ViaVersion.
the class ViaFabric method onInitialize.
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder().injector(new FabricInjector()).loader(new VFLoader()).commandHandler(new VRCommandHandler()).platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
FabricLoader.getInstance().getEntrypoints("viafabric:via_api_initialized", Runnable.class).forEach(Runnable::run);
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric").resolve("viafabric.yml").toFile());
INIT_FUTURE.complete(null);
}
use of com.viaversion.viaversion.ViaManagerImpl in project ViaFabric by ViaVersion.
the class ViaFabric method onInitialize.
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder().injector(new FabricInjector()).loader(new VFLoader()).commandHandler(new VRCommandHandler()).platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
((ViaManagerImpl) Via.getManager()).init();
Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
ProtocolVersion.register(-2, "AUTO");
FabricLoader.getInstance().getEntrypoints("viafabric:via_api_initialized", Runnable.class).forEach(Runnable::run);
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric").resolve("viafabric.yml").toFile());
INIT_FUTURE.complete(null);
}
use of com.viaversion.viaversion.ViaManagerImpl in project LiquidBouncePlus by WYSI-Foundation.
the class ViaForge method start.
public void start() {
ThreadFactory factory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("ViaForge-%d").build();
asyncExecutor = Executors.newFixedThreadPool(8, factory);
eventLoop = new LocalEventLoopGroup(1, factory).next();
eventLoop.submit(initFuture::join);
setVersion(SHARED_VERSION);
this.file = new File("ViaForge");
if (this.file.mkdir())
this.getjLogger().info("Creating ViaForge Folder");
Via.init(ViaManagerImpl.builder().injector(new Injector()).loader(new ProviderLoader()).platform(new Platform(file)).build());
MappingDataLoader.enableMappingsCache();
((ViaManagerImpl) Via.getManager()).init();
new BackwardsLoader(file);
new RewindLoader(file);
initFuture.complete(null);
}
Aggregations