Search in sources :

Example 1 with VelocityCommandHandler

use of com.viaversion.viaversion.velocity.command.VelocityCommandHandler in project ViaVersion by ViaVersion.

the class VelocityPlugin method onProxyInit.

@Subscribe
public void onProxyInit(ProxyInitializeEvent e) {
    if (!hasConnectionEvent()) {
        // No way to disable the plugin :(
        Logger logger = this.loggerslf4j;
        logger.error("      / \\");
        logger.error("     /   \\");
        logger.error("    /  |  \\");
        logger.error("   /   |   \\        VELOCITY 3.0.0 IS REQUIRED");
        logger.error("  /         \\   VIAVERSION WILL NOT WORK AS INTENDED");
        logger.error(" /     o     \\");
        logger.error("/_____________\\");
    }
    PROXY = proxy;
    VelocityCommandHandler commandHandler = new VelocityCommandHandler();
    PROXY.getCommandManager().register("viaver", commandHandler, "vvvelocity", "viaversion");
    api = new VelocityViaAPI();
    conf = new VelocityViaConfig(configDir.toFile());
    logger = new LoggerWrapper(loggerslf4j);
    Via.init(ViaManagerImpl.builder().platform(this).commandHandler(commandHandler).loader(new VelocityViaLoader()).injector(new VelocityViaInjector()).build());
    if (proxy.getPluginManager().getPlugin("viabackwards").isPresent()) {
        MappingDataLoader.enableMappingsCache();
    }
}
Also used : VelocityViaConfig(com.viaversion.viaversion.velocity.platform.VelocityViaConfig) VelocityViaLoader(com.viaversion.viaversion.velocity.platform.VelocityViaLoader) VelocityViaInjector(com.viaversion.viaversion.velocity.platform.VelocityViaInjector) LoggerWrapper(com.viaversion.viaversion.velocity.util.LoggerWrapper) VelocityCommandHandler(com.viaversion.viaversion.velocity.command.VelocityCommandHandler) Logger(org.slf4j.Logger) VelocityViaAPI(com.viaversion.viaversion.velocity.platform.VelocityViaAPI) Subscribe(com.velocitypowered.api.event.Subscribe)

Aggregations

Subscribe (com.velocitypowered.api.event.Subscribe)1 VelocityCommandHandler (com.viaversion.viaversion.velocity.command.VelocityCommandHandler)1 VelocityViaAPI (com.viaversion.viaversion.velocity.platform.VelocityViaAPI)1 VelocityViaConfig (com.viaversion.viaversion.velocity.platform.VelocityViaConfig)1 VelocityViaInjector (com.viaversion.viaversion.velocity.platform.VelocityViaInjector)1 VelocityViaLoader (com.viaversion.viaversion.velocity.platform.VelocityViaLoader)1 LoggerWrapper (com.viaversion.viaversion.velocity.util.LoggerWrapper)1 Logger (org.slf4j.Logger)1