Search in sources :

Example 56 with PluginManager

use of org.bukkit.plugin.PluginManager in project PlayerTimeLimit by Ajneb97.

the class PlayerTimeLimit method registerEvents.

public void registerEvents() {
    PluginManager pm = getServer().getPluginManager();
    pm.registerEvents(new PlayerListener(this), this);
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) PlayerListener(ptl.ajneb97.listeners.PlayerListener)

Example 57 with PluginManager

use of org.bukkit.plugin.PluginManager in project FastAsyncWorldEdit by IntellectualSites.

the class FaweBukkit method getImageViewer.

@Override
public synchronized ImageViewer getImageViewer(com.sk89q.worldedit.entity.Player player) {
    try {
        listeningImages = true;
        PluginManager manager = Bukkit.getPluginManager();
        if (manager.getPlugin("PacketListenerApi") == null) {
            LOGGER.error("PacketListener not found! Please install PacketListenerAPI v3.7.6 or above before attempting to " + "complete image-related edits");
        }
        if (manager.getPlugin("MapManager") == null) {
            LOGGER.error("MapManager not found! Please install PacketListenerAPI v1.7.8 or above before attempting to " + "complete image-related edits");
        }
        return new BukkitImageViewer(BukkitAdapter.adapt(player));
    } catch (Throwable ignored) {
    }
    return null;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) BukkitImageViewer(com.fastasyncworldedit.bukkit.util.image.BukkitImageViewer)

Example 58 with PluginManager

use of org.bukkit.plugin.PluginManager in project CombatLogX by SirBlobman.

the class TownyRegionHandler method isSafeZone.

@Override
public boolean isSafeZone(Player player, Location location, TagType tagType) {
    if (tagType != TagType.PLAYER) {
        return false;
    }
    RegionExpansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    TownBlock townBlock = getTownBlock(location);
    if (townBlock == null) {
        return false;
    }
    if (configuration.getBoolean("prevent-all-town-entries", false)) {
        if (isOwnTown(townBlock, player)) {
            return true;
        }
    }
    TownyWorld townyWorld = townBlock.getWorld();
    if (townyWorld == null || townyWorld.isForcePVP()) {
        return false;
    }
    Town town;
    try {
        town = townBlock.getTown();
        if (town == null || town.isPVP() || town.isAdminEnabledPVP() || town.hasActiveWar()) {
            return false;
        }
    } catch (NotRegisteredException ex) {
        return false;
    }
    PluginManager pluginManager = Bukkit.getPluginManager();
    if (pluginManager.isPluginEnabled("FlagWar")) {
        if (FlagWarAPI.isUnderAttack(town)) {
            return false;
        }
    }
    TownyPermission townBlockPermissions = townBlock.getPermissions();
    return !townBlockPermissions.pvp;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) TownyPermission(com.palmergames.bukkit.towny.object.TownyPermission) RegionExpansion(com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion) NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) Town(com.palmergames.bukkit.towny.object.Town) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) TownyWorld(com.palmergames.bukkit.towny.object.TownyWorld) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager) TownBlock(com.palmergames.bukkit.towny.object.TownBlock)

Example 59 with PluginManager

use of org.bukkit.plugin.PluginManager in project CombatLogX by SirBlobman.

the class RewardExpansion method usePlaceholderAPI.

public boolean usePlaceholderAPI() {
    ConfigurationManager configurationManager = getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    boolean usePlaceholderAPI = configuration.getBoolean("hooks.placeholderapi");
    if (usePlaceholderAPI) {
        PluginManager pluginManager = Bukkit.getPluginManager();
        return pluginManager.isPluginEnabled("PlaceholderAPI");
    }
    return false;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 60 with PluginManager

use of org.bukkit.plugin.PluginManager in project CombatLogX by SirBlobman.

the class RewardExpansion method useMVdWPlaceholderAPI.

public boolean useMVdWPlaceholderAPI() {
    ConfigurationManager configurationManager = getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    boolean useMVdWPlaceholderAPI = configuration.getBoolean("hooks.mvdwplaceholderapi");
    if (useMVdWPlaceholderAPI) {
        PluginManager pluginManager = Bukkit.getPluginManager();
        return pluginManager.isPluginEnabled("MVdWPlaceholderAPI");
    }
    return false;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Aggregations

PluginManager (org.bukkit.plugin.PluginManager)148 Plugin (org.bukkit.plugin.Plugin)33 JavaPlugin (org.bukkit.plugin.java.JavaPlugin)20 Permission (org.bukkit.permissions.Permission)16 MetricsWrapper (com.earth2me.essentials.metrics.MetricsWrapper)14 Player (org.bukkit.entity.Player)14 Test (org.junit.Test)13 SimplePluginManager (org.bukkit.plugin.SimplePluginManager)12 Map (java.util.Map)11 File (java.io.File)9 IOException (java.io.IOException)9 World (org.bukkit.World)9 PluginCommand (org.bukkit.command.PluginCommand)9 Command (org.bukkit.command.Command)8 Listener (org.bukkit.event.Listener)8 PluginDescriptionFile (org.bukkit.plugin.PluginDescriptionFile)8 HashMap (java.util.HashMap)7 EventHandler (org.bukkit.event.EventHandler)7 ArrayList (java.util.ArrayList)6 Bukkit (org.bukkit.Bukkit)6