当前位置: 首页>>代码示例>>Java>>正文


Java Plugin.isEnabled方法代码示例

本文整理汇总了Java中org.bukkit.plugin.Plugin.isEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.isEnabled方法的具体用法?Java Plugin.isEnabled怎么用?Java Plugin.isEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.plugin.Plugin的用法示例。


在下文中一共展示了Plugin.isEnabled方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onTabComplete

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
@Override
public List<String> onTabComplete(CommandSender sender, String[] args) {
	if (args.length <= 1) {
		return COMPLETION_LIST;
	}

	// 延迟加载, 因为此类构造方法被调用时, 插件可能还没全部 enable
	if (pluginNames == null) {
		pluginNames = new ArrayList<>();
		for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
			if (plugin.isEnabled()) {
				pluginNames.add(plugin.getName());
			}
		}
	}

	return pluginNames;
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:19,代码来源:CommandTimings.java

示例2: enablePlugins

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:28,代码来源:CraftServer.java

示例3: getGenerator

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public ChunkGenerator getGenerator(String world) {
    ConfigurationSection section = configuration.getConfigurationSection("worlds");
    ChunkGenerator result = null;

    if (section != null) {
        section = section.getConfigurationSection(world);

        if (section != null) {
            String name = section.getString("generator");

            if ((name != null) && (!name.equals(""))) {
                String[] split = name.split(":", 2);
                String id = (split.length > 1) ? split[1] : null;
                Plugin plugin = pluginManager.getPlugin(split[0]);

                if (plugin == null) {
                    getLogger().severe("Could not set generator for default world '" + world + "': Plugin '" + split[0] + "' does not exist");
                } else if (!plugin.isEnabled()) {
                    getLogger().severe("Could not set generator for default world '" + world + "': Plugin '" + plugin.getDescription().getFullName() + "' is not enabled yet (is it load:STARTUP?)");
                } else {
                    try {
                        result = plugin.getDefaultWorldGenerator(world, id);
                        if (result == null) {
                            getLogger().severe("Could not set generator for default world '" + world + "': Plugin '" + plugin.getDescription().getFullName() + "' lacks a default world generator");
                        }
                    } catch (Throwable t) {
                        plugin.getLogger().log(Level.SEVERE, "Could not set generator for default world '" + world + "': Plugin '" + plugin.getDescription().getFullName(), t);
                    }
                }
            }
        }
    }

    return result;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:36,代码来源:CraftServer.java

示例4: validate

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
private static void validate(final Plugin plugin, final Object task) {
    Validate.notNull(plugin, "Plugin cannot be null");
    Validate.notNull(task, "Task cannot be null");
    if (!plugin.isEnabled()) {
        throw new IllegalPluginAccessException("Plugin attempted to register task while disabled");
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:8,代码来源:CraftScheduler.java

示例5: disable

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public static void disable() {
	enable = false;
	for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
		if (plugin != null && plugin.isEnabled()) {
			EventExecutorInjector.uninject(plugin);
			SchedulerTaskInjector.uninject(plugin);
			CommandInjector.uninject(plugin);
		}
	}
}
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:11,代码来源:MonitorUtils.java

示例6: enable

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public static void enable() {
	enable = true;
	enable_time = System.currentTimeMillis();
	for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
		if (plugin != null && plugin.isEnabled()) {
			EventExecutorInjector.inject(plugin);
			SchedulerTaskInjector.inject(plugin);
			CommandInjector.inject(plugin);
		}
	}
}
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:12,代码来源:MonitorUtils.java

示例7: isDynmapEnabled

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
/**
 * @return
 * if Dynmap layers shall be enabled
 */
public boolean isDynmapEnabled() {
    Plugin dynmap = Bukkit.getServer().getPluginManager().getPlugin("dynmap");
    if (dynmap == null || !dynmap.isEnabled()) {
        return false;
    } else {
        return dynmapEnabled;
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:13,代码来源:FConfig.java

示例8: onEnable

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
@Override
public void onEnable() {
	File file = new File(getDataFolder(), "config.yml");
	if(!file.exists()) {
		this.getConfig().options().copyDefaults(true);
		this.saveConfig();
	}
    Cooldowns.createCooldown("medic_cooldown");

    HCF.plugin = this;
    BasePlugin.getPlugin().init(this);

    ProtocolLibHook.hook(this);

    Plugin wep = getServer().getPluginManager().getPlugin("WorldEdit");
    this.worldEdit = wep instanceof WorldEditPlugin && wep.isEnabled() ? (WorldEditPlugin) wep : null;
    CustomEntityRegistration.registerCustomEntities();

    SettingsYML.init(this);
    this.effectRestorer = new EffectRestorer(this);
    this.registerConfiguration();
    this.registerCommands();
    this.registerManagers();
    this.registerListeners();
    
    this.resetGlowstoneMountain();

    new BukkitRunnable() {
        @Override
        public void run() {
            getServer().broadcast(ChatColor.GREEN.toString() + ChatColor.BOLD + "Saving!" + "\n" + ChatColor.GREEN + "Saved all faction and player data to the database." + "\n" + ChatColor.GRAY + "Current TPS: " + ChatColor.GRAY, "hcf.seesaves");
            saveData();
        }
    }.runTaskTimerAsynchronously(plugin, TimeUnit.MINUTES.toMillis(10L), TimeUnit.MINUTES.toMillis(10L));
    
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:37,代码来源:HCF.java

示例9: onEnable

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
@Override
public void onEnable() {
    Cooldowns.createCooldown("medic_cooldown");

    HCF.plugin = this;
    BasePlugin.getPlugin().init(this);

    ProtocolLibHook.hook(this);

    Plugin wep = getServer().getPluginManager().getPlugin("WorldEdit");
    this.worldEdit = wep instanceof WorldEditPlugin && wep.isEnabled() ? (WorldEditPlugin) wep : null;
    CustomEntityRegistration.registerCustomEntities();
    
    this.craftBukkitVersion = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];

    SettingsYML.init(this);
    this.effectRestorer = new EffectRestorer(this);
    this.registerConfiguration();
    this.registerCommands();
    this.registerManagers();
    this.registerListeners();
    
    this.setupPermissions();

    new BukkitRunnable() {
        @Override
        public void run() {
            getServer().broadcast(ChatColor.GREEN.toString() + ChatColor.BOLD + "Saving!" + "\n" + ChatColor.GREEN + "Saved all faction and player data to the database." + "\n" + ChatColor.GRAY + "Current TPS: " + ChatColor.GRAY, "hcf.seesaves");
            saveData();
        }
    }.runTaskTimerAsynchronously(plugin, TimeUnit.MINUTES.toMillis(10L), TimeUnit.MINUTES.toMillis(10L));
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:33,代码来源:HCF.java

示例10: setPermsSystem

import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public void setPermsSystem() {
	PluginManager pm = Bukkit.getServer().getPluginManager();
	for(Plugin pl : pm.getPlugins()){
		if(pl.isEnabled()){
			String plName = pl.getName();
			if(app.contains(plName)){
				permsPlugin = pm.getPlugin(plName);
			}
		}
	}
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:12,代码来源:PermsManager.java


注:本文中的org.bukkit.plugin.Plugin.isEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。