Search in sources :

Example 1 with PlatformManager

use of com.sk89q.worldedit.extension.platform.PlatformManager in project FastAsyncWorldEdit by IntellectualSites.

the class FabricWorldEdit method registerCommands.

private void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher, boolean dedicated) {
    PlatformManager manager = WorldEdit.getInstance().getPlatformManager();
    if (manager.getPlatforms().isEmpty()) {
        // We'll register as part of our platform initialization later.
        return;
    }
    // This is a re-register (due to /reload), we must add our commands now
    Platform commandsPlatform = manager.queryCapability(Capability.USER_COMMANDS);
    if (commandsPlatform != platform || !platform.isHookingEvents()) {
        // We're not in control of commands/events -- do not re-register.
        return;
    }
    platform.setNativeDispatcher(dispatcher);
    platform.registerCommands(manager.getPlatformCommandManager().getCommandManager());
}
Also used : PlatformManager(com.sk89q.worldedit.extension.platform.PlatformManager) Platform(com.sk89q.worldedit.extension.platform.Platform)

Aggregations

Platform (com.sk89q.worldedit.extension.platform.Platform)1 PlatformManager (com.sk89q.worldedit.extension.platform.PlatformManager)1