本文整理汇总了Java中cn.nukkit.plugin.Plugin.isEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.isEnabled方法的具体用法?Java Plugin.isEnabled怎么用?Java Plugin.isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.nukkit.plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.isEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAttachment
import cn.nukkit.plugin.Plugin; //导入方法依赖的package包/类
@Override
public PermissionAttachment addAttachment(Plugin plugin, String name, Boolean value) {
if (plugin == null) {
throw new PluginException("Plugin cannot be null");
} else if (!plugin.isEnabled()) {
throw new PluginException("Plugin " + plugin.getDescription().getName() + " is disabled");
}
PermissionAttachment result = new PermissionAttachment(plugin, this.parent != null ? this.parent : this);
this.attachments.add(result);
if (name != null && value != null) {
result.setPermission(name, value);
}
this.recalculatePermissions();
return result;
}
示例2: PermissionAttachment
import cn.nukkit.plugin.Plugin; //导入方法依赖的package包/类
public PermissionAttachment(Plugin plugin, Permissible permissible) {
if (!plugin.isEnabled()) {
throw new PluginException("Plugin " + plugin.getDescription().getName() + " is disabled");
}
this.permissible = permissible;
this.plugin = plugin;
}
示例3: addAttachment
import cn.nukkit.plugin.Plugin; //导入方法依赖的package包/类
@Override
public PermissionAttachment addAttachment(Plugin plugin, String name, Boolean value) {
if (!plugin.isEnabled()) {
throw new PluginException("Plugin " + plugin.getDescription().getName() + " is disabled");
}
PermissionAttachment result = new PermissionAttachment(plugin, this.parent != null ? this.parent : this);
this.attachments.add(result);
if (name != null && value != null) {
result.setPermission(name, value);
}
this.recalculatePermissions();
return result;
}
示例4: enablePlugins
import cn.nukkit.plugin.Plugin; //导入方法依赖的package包/类
public void enablePlugins(PluginLoadOrder type) {
for (Plugin plugin : new ArrayList<>(this.pluginManager.getPlugins().values())) {
if (!plugin.isEnabled() && type == plugin.getDescription().getOrder()) {
this.enablePlugin(plugin);
}
}
if (type == PluginLoadOrder.POSTWORLD) {
this.commandMap.registerServerAliases();
DefaultPermissions.registerCorePermissions();
}
}
示例5: sendPluginList
import cn.nukkit.plugin.Plugin; //导入方法依赖的package包/类
private void sendPluginList(CommandSender sender) {
String list = "";
Map<String, Plugin> plugins = sender.getServer().getPluginManager().getPlugins();
for (Plugin plugin : plugins.values()) {
if (list.length() > 0) {
list += TextFormat.WHITE + ", ";
}
list += plugin.isEnabled() ? TextFormat.GREEN : TextFormat.RED;
list += plugin.getDescription().getFullName();
}
sender.sendMessage(new TranslationContainer("nukkit.command.plugins.success", new String[]{String.valueOf(plugins.size()), list}));
}