Search in sources :

Example 6 with VFLoader

use of com.viaversion.fabric.mc117.platform.VFLoader 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 7 with VFLoader

use of com.viaversion.fabric.mc117.platform.VFLoader 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)

Aggregations

VFConfig (com.viaversion.fabric.common.config.VFConfig)7 FabricInjector (com.viaversion.fabric.common.platform.FabricInjector)7 ViaManagerImpl (com.viaversion.viaversion.ViaManagerImpl)7 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 FabricPlatform (com.viaversion.fabric.mc119.platform.FabricPlatform)1