Search in sources :

Example 6 with ViaManagerImpl

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();
}
Also used : ViaManagerImpl(com.viaversion.viaversion.ViaManagerImpl) ProtocolManagerImpl(com.viaversion.viaversion.protocol.ProtocolManagerImpl)

Example 7 with ViaManagerImpl

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);
}
Also used : VFLoader(com.viaversion.fabric.mc116.platform.VFLoader) FabricInjector(com.viaversion.fabric.common.platform.FabricInjector) ViaManagerImpl(com.viaversion.viaversion.ViaManagerImpl) VRCommandHandler(com.viaversion.fabric.mc116.commands.VRCommandHandler) FabricPlatform(com.viaversion.fabric.mc116.platform.FabricPlatform) VFConfig(com.viaversion.fabric.common.config.VFConfig)

Example 8 with ViaManagerImpl

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);
}
Also used : VFLoader(com.viaversion.fabric.mc115.platform.VFLoader) FabricInjector(com.viaversion.fabric.common.platform.FabricInjector) ViaManagerImpl(com.viaversion.viaversion.ViaManagerImpl) VRCommandHandler(com.viaversion.fabric.mc115.commands.VRCommandHandler) FabricPlatform(com.viaversion.fabric.mc115.platform.FabricPlatform) VFConfig(com.viaversion.fabric.common.config.VFConfig)

Example 9 with ViaManagerImpl

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);
}
Also used : ThreadFactory(java.util.concurrent.ThreadFactory) LocalEventLoopGroup(io.netty.channel.local.LocalEventLoopGroup) Platform(de.enzaxd.viaforge.platform.Platform) ViaManagerImpl(com.viaversion.viaversion.ViaManagerImpl) Injector(de.enzaxd.viaforge.platform.Injector) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) BackwardsLoader(de.enzaxd.viaforge.loader.BackwardsLoader) File(java.io.File) ProviderLoader(de.enzaxd.viaforge.platform.ProviderLoader) RewindLoader(de.enzaxd.viaforge.loader.RewindLoader)

Aggregations

ViaManagerImpl (com.viaversion.viaversion.ViaManagerImpl)9 VFConfig (com.viaversion.fabric.common.config.VFConfig)7 FabricInjector (com.viaversion.fabric.common.platform.FabricInjector)7 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 VRCommandHandler (com.viaversion.fabric.mc114.commands.VRCommandHandler)1 FabricPlatform (com.viaversion.fabric.mc114.platform.FabricPlatform)1 VFLoader (com.viaversion.fabric.mc114.platform.VFLoader)1 VRCommandHandler (com.viaversion.fabric.mc115.commands.VRCommandHandler)1 FabricPlatform (com.viaversion.fabric.mc115.platform.FabricPlatform)1 VFLoader (com.viaversion.fabric.mc115.platform.VFLoader)1 VRCommandHandler (com.viaversion.fabric.mc116.commands.VRCommandHandler)1 FabricPlatform (com.viaversion.fabric.mc116.platform.FabricPlatform)1 VFLoader (com.viaversion.fabric.mc116.platform.VFLoader)1 VRCommandHandler (com.viaversion.fabric.mc117.commands.VRCommandHandler)1 FabricPlatform (com.viaversion.fabric.mc117.platform.FabricPlatform)1 VFLoader (com.viaversion.fabric.mc117.platform.VFLoader)1 VRCommandHandler (com.viaversion.fabric.mc118.commands.VRCommandHandler)1 FabricPlatform (com.viaversion.fabric.mc118.platform.FabricPlatform)1 VFLoader (com.viaversion.fabric.mc118.platform.VFLoader)1 VRCommandHandler (com.viaversion.fabric.mc119.commands.VRCommandHandler)1