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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations