use of org.bukkit.plugin.PluginManager in project Essentials by EssentialsX.
the class PermissionsDefaults method registerAllHatDefaults.
public static void registerAllHatDefaults() {
final PluginManager pluginManager = Bukkit.getPluginManager();
final Permission hatPerm = pluginManager.getPermission(Commandhat.PERM_PREFIX + "*");
if (hatPerm != null) {
return;
}
final ImmutableMap.Builder<String, Boolean> children = ImmutableMap.builder();
for (final Material mat : Material.values()) {
final String matPerm = Commandhat.PERM_PREFIX + mat.name().toLowerCase();
children.put(matPerm, true);
pluginManager.addPermission(new Permission(matPerm, "Prevent using " + mat + " as a type of hat.", PermissionDefault.FALSE));
}
pluginManager.addPermission(new Permission(Commandhat.PERM_PREFIX + "*", "Prevent all types of hats", PermissionDefault.FALSE, children.build()));
}
use of org.bukkit.plugin.PluginManager in project Essentials by EssentialsX.
the class Jails method registerListeners.
private void registerListeners() {
enabled = true;
final PluginManager pluginManager = ess.getServer().getPluginManager();
final JailListener blockListener = new JailListener();
pluginManager.registerEvents(blockListener, ess);
if (ess.getSettings().isDebug()) {
LOGGER.log(Level.INFO, "Registering Jail listener");
}
}
use of org.bukkit.plugin.PluginManager in project Essentials by EssentialsX.
the class EssentialsChat method onEnable.
@Override
public void onEnable() {
final PluginManager pluginManager = getServer().getPluginManager();
ess = (IEssentials) pluginManager.getPlugin("Essentials");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tl("versionMismatchAll"));
}
if (!ess.isEnabled()) {
this.setEnabled(false);
return;
}
final Map<AsyncPlayerChatEvent, ChatStore> chatStore = Collections.synchronizedMap(new HashMap<>());
final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatStore);
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatStore);
final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatStore);
pluginManager.registerEvents(playerListenerLowest, this);
pluginManager.registerEvents(playerListenerNormal, this);
pluginManager.registerEvents(playerListenerHighest, this);
if (metrics == null) {
metrics = new MetricsWrapper(this, 3814, false);
}
}
use of org.bukkit.plugin.PluginManager in project Essentials by EssentialsX.
the class EssentialsGeoIP method onEnable.
@Override
public void onEnable() {
final PluginManager pm = getServer().getPluginManager();
final IEssentials ess = (IEssentials) pm.getPlugin("Essentials");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tl("versionMismatchAll"));
}
if (!ess.isEnabled()) {
this.setEnabled(false);
return;
}
Logger.getLogger(com.fasterxml.jackson.databind.ext.Java7Support.class.getName()).setLevel(Level.SEVERE);
final EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder(), ess);
pm.registerEvents(playerListener, this);
getLogger().log(Level.INFO, "This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com/.");
if (metrics == null) {
metrics = new MetricsWrapper(this, 3815, false);
}
}
use of org.bukkit.plugin.PluginManager in project Essentials by EssentialsX.
the class EssentialsProtect method onEnable.
@Override
public void onEnable() {
final PluginManager pm = this.getServer().getPluginManager();
final Plugin essPlugin = pm.getPlugin("Essentials");
if (essPlugin == null || !essPlugin.isEnabled()) {
enableEmergencyMode(pm);
return;
}
initialize(pm, essPlugin);
if (metrics == null) {
metrics = new MetricsWrapper(this, 3816, false);
}
}
Aggregations