本文整理匯總了Java中org.bukkit.event.server.PluginEnableEvent.getPlugin方法的典型用法代碼示例。如果您正苦於以下問題:Java PluginEnableEvent.getPlugin方法的具體用法?Java PluginEnableEvent.getPlugin怎麽用?Java PluginEnableEvent.getPlugin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.event.server.PluginEnableEvent
的用法示例。
在下文中一共展示了PluginEnableEvent.getPlugin方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void onPluginEnable(PluginEnableEvent event) {
// Make sure the plugin instance isn't null
if (event.getPlugin() == null) {
return;
}
final String pluginName = event.getPlugin().getName();
// Call the onPluginEnable method in the permissions manager
permissionsManager.onPluginEnable(pluginName);
if ("Essentials".equalsIgnoreCase(pluginName)) {
pluginHookService.tryHookToEssentials();
} else if ("Multiverse-Core".equalsIgnoreCase(pluginName)) {
pluginHookService.tryHookToMultiverse();
} else if ("EssentialsSpawn".equalsIgnoreCase(pluginName)) {
spawnLoader.loadEssentialsSpawn();
} else if ("CMI".equalsIgnoreCase(pluginName)) {
pluginHookService.tryHookToCmi();
spawnLoader.loadCmiSpawn();
} else if ("ProtocolLib".equalsIgnoreCase(pluginName)) {
protocolLibService.setup();
}
}
示例2: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
Plugin p = event.getPlugin();
String name = p.getDescription().getName();
if (name.equals("dynmap") || name.equals("WorldGuard")) {
if (this.cubitDynmap.dynmap.isEnabled() && CubitBukkitPlugin.inst().getWorldGuardPlugin().isEnabled())
this.cubitDynmap.initialize();
}
}
示例3: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority=EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
Plugin p = event.getPlugin();
String name = p.getDescription().getName();
if(name.equals("dynmap")) {
if(dynmap.isEnabled())
activate(dynmap);
}
}
示例4: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true)
public void onPluginEnable(final PluginEnableEvent event) {
final Plugin plugin = event.getPlugin();
if (!plugin.getName().equals("Vault")) return;
this.factionsHook.deinit();
this.factionsHook.init();
}
示例5: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true)
public void onPluginEnable(final PluginEnableEvent event) {
final Plugin plugin = event.getPlugin();
if (!plugin.getName().equals("Vault")) return;
this.vaultHook.deinit();
this.vaultHook.init();
}
示例6: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(final PluginEnableEvent event) {
final Plugin p = event.getPlugin();
final String name = p.getDescription().getName();
if (name.equals("dynmap")) {
if (this.dynmap.isEnabled() && this.plot2.isEnabled()) {
initialize();
}
}
}
示例7: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOW)
public void onPluginEnable(PluginEnableEvent event) {
if (event.getPlugin() != plugin) {
// Try to load again!
Perms.onOtherPluginEnable();
plugin.getTreasury().onOtherPluginEnable();
}
}
示例8: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
void onPluginEnable(PluginEnableEvent event) {
if (ENABLED || !event.getPlugin().getName().equals("WorldGuard")) return;
try {
ENABLED = event.getPlugin() instanceof WorldGuardPlugin;
} catch (Exception ignored) {
}
}
示例9: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(final PluginEnableEvent event) {
if (this.economy.economy == null) {
final Plugin ec = event.getPlugin();
if (ec.getClass().getName().equals("org.royaldev.royaleconomy.RoyalEconomy")) {
final String version = ec.getDescription().getVersion();
VaultConnector.this.name += version;
this.economy.economy = (RoyalEconomy) ec;
VaultConnector.this.plugin.getLogger().info("Hooked into Vault!");
}
}
}
示例10: onPluginEnabled
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler
public void onPluginEnabled(PluginEnableEvent event) {
if(event.getPlugin()==this) return;
PluginDescriptionFile desc = event.getPlugin().getDescription();
String name = this.getName();
if( this.containsIgnoreCase(desc.getDepend(), name) || this.containsIgnoreCase(desc.getSoftDepend(), name)) {
this.usedBy.add(desc.getFullName());
}
}
示例11: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event)
{
if (perms == null)
{
Plugin p = event.getPlugin();
if (p.getDescription().getName().equals("BungeePerms"))
{
perms = BungeePerms.getInstance();
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
}
}
}
示例12: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event)
{
if (perms == null)
{
Plugin p = event.getPlugin();
if (p.getDescription().getName().equals("BungeePerms"))
{
perms = BungeePerms.getInstance();
log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name));
}
}
}
示例13: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
void onPluginEnable(PluginEnableEvent event) {
if (ENABLED || !event.getPlugin().getName().equals("WorldGuard")) return;
try {
ENABLED = event.getPlugin() instanceof WorldGuardPlugin;
if (ENABLED) {
for (Flag<?> flag : flags.values())
registerFlag(flag);
callOnEnable();
}
} catch (Exception ignored) {
}
}
示例14: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
if (manager == null) {
Plugin permPlugin = event.getPlugin();
if (permPlugin.getDescription().getName().equals(name)) {
totalperms = (TotalPermissions) permPlugin;
manager = totalperms.getManager();
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
}
}
}
示例15: onPluginEnable
import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
if (!hooked) {
Plugin p = event.getPlugin();
if(p.getDescription().getName().equals("bPermissions") && p.isEnabled()) {
hooked = true;
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
}
}
}