org.bukkit.plugin.PluginLoadOrder Java Examples

The following examples show how to use org.bukkit.plugin.PluginLoadOrder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PGMServer.java    From PGM with GNU Affero General Public License v3.0 6 votes vote down vote up
protected void setupPlugins() {
  server.loadPlugins();

  final RuntimePluginLoader loader = new RuntimePluginLoader(server);

  // TODO: Investigate why ViaRewind needs to be enabled explicitly
  final Plugin rewind = server.getPluginManager().getPlugin("ViaRewind");
  if (rewind != null) {
    loader.togglePlugin(rewind, true);
  }

  for (PluginDescriptionFile plugin : plugins) {
    loader.loadPlugin(plugin);
  }
  server.enablePlugins(PluginLoadOrder.POSTWORLD);
}
 
Example #2
Source File: CraftServer.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public void enablePlugins(PluginLoadOrder type) {
    // Cauldron start - initialize mod wrappers
    org.bukkit.craftbukkit.block.CraftBlock.initMappings();
    org.bukkit.craftbukkit.entity.CraftEntity.initMappings();
    // Cauldron end
    if (type == PluginLoadOrder.STARTUP) {
        helpMap.clear();
        helpMap.initializeGeneralTopics();
    }

    Plugin[] plugins = pluginManager.getPlugins();

    for (Plugin plugin : plugins) {
        if ((!plugin.isEnabled()) && (plugin.getDescription().getLoad() == type)) {
            loadPlugin(plugin);
        }
    }

    if (type == PluginLoadOrder.POSTWORLD) {
        commandMap.setFallbackCommands();
        setVanillaCommands();
        commandMap.registerServerAliases();
        loadCustomPermissions();
        DefaultPermissions.registerCorePermissions();
        helpMap.initializeCommands();
    }
}