crwdns118009:0crwdne118009:0

crwdns118011:0:javadoc:crwdne118011:0

crwdns118013:0crwdne118013:0

crwdns118015:0:javadoc:crwdnd118015:0:javadoc:crwdne118015:0

crwdns118017:0crwdne118017:0

crwdns118019:0crwdne118019:0

crwdns118021:0crwdne118021:0

Tip

crwdns118023:0:doc:crwdne118023:0

crwdns118025:0crwdne118025:0

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

@Inject
private PluginManager pluginManager;

crwdns118027:0crwdne118027:0

Tip

crwdns118029:0:doc:crwdne118029:0

crwdns118031:0:javadoc:crwdne118031:0

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

crwdns118033:0crwdne118033:0

Tip

crwdns118035:0:javadoc:crwdne118035:0

crwdns118037:0crwdne118037:0

private PluginManager pluginManager = game.getPluginManager();

crwdns118039:0crwdne118039:0

crwdns118041:0crwdne118041:0

crwdns118043:0:javadoc:crwdne118043:0

import org.spongepowered.api.Sponge;

private PluginManager pluginManager = Sponge.getPluginManager();

crwdns118045:0crwdne118045:0

crwdns118047:0crwdne118047:0

crwdns118049:0crwdne118049:0

crwdns118051:0crwdne118051:0

import org.spongepowered.api.plugin.PluginContainer;

import java.util.Collection;

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

crwdns118053:0crwdne118053:0

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

crwdns118055:0crwdne118055:0

crwdns118057:0crwdne118057:0

crwdns118059:0:javadoc:crwdne118059:0

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

Note

crwdns118061:0:javadoc:crwdne118061:0