crwdns19591:0crwdne19591:0

crwdns19592:0:javadoc:crwdne19592:0

crwdns19593:0crwdne19593:0

crwdns42601:0:javadoc:crwdnd42601:0:javadoc:crwdne42601:0

crwdns19595:0crwdne19595:0

crwdns19596:0crwdne19596:0

crwdns19597:0crwdne19597:0

Tip

crwdns19598:0:doc:crwdne19598:0

crwdns19599:0crwdne19599:0

import com.google.inject.Inject;
import org.spongepowered.api.plugin.PluginManager;

@Inject
private PluginManager pluginManager;

crwdns19600:0crwdne19600:0

Tip

crwdns19601:0:doc:crwdne19601:0

crwdns19602:0:javadoc:crwdne19602:0

private PluginManager pluginManager = serviceManager.provideUnchecked(PluginManager.class);

crwdns19603:0crwdne19603:0

Tip

crwdns19604:0:javadoc:crwdne19604:0

crwdns19605:0crwdne19605:0

private PluginManager pluginManager = game.getPluginManager();

crwdns19606:0crwdne19606:0

crwdns19607:0crwdne19607:0

crwdns19608:0:javadoc:crwdne19608:0

import org.spongepowered.api.Sponge;

private PluginManager pluginManager = Sponge.getPluginManager();

crwdns19609:0crwdne19609:0

crwdns19610:0crwdne19610:0

crwdns19611:0crwdne19611:0

crwdns19612:0crwdne19612:0

import org.spongepowered.api.plugin.PluginContainer;

import java.util.Collection;

private Collection<PluginContainer> plugins = pluginManager.getPlugins();

crwdns19613:0crwdne19613:0

private PluginContainer myOtherPlugin = pluginManager.getPlugin("myOtherPluginId").orElse(null);

crwdns19614:0crwdne19614:0

crwdns19615:0crwdne19615:0

crwdns19616:0:javadoc:crwdne19616:0

private PluginContainer myOtherPlugin = pluginManager.getPlugin("myOtherPluginId").orElse(null);
private MyOtherPlugin pluginInstance = (MyOtherPlugin) myOtherPlugin.getInstance().orElse(null);

Note

crwdns19617:0:javadoc:crwdne19617:0