Search in sources :

Example 1 with TownyFeature

use of com.fastasyncworldedit.bukkit.regions.TownyFeature in project FastAsyncWorldEdit by IntellectualSites.

the class FaweBukkit method getMaskManagers.

/**
 * A mask manager handles region restrictions e.g., PlotSquared plots / WorldGuard regions
 */
@Override
public Collection<FaweMaskManager> getMaskManagers() {
    final Plugin worldguardPlugin = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard");
    final ArrayList<FaweMaskManager> managers = new ArrayList<>();
    if (worldguardPlugin != null && worldguardPlugin.isEnabled()) {
        try {
            managers.add(new WorldGuardFeature(worldguardPlugin));
            LOGGER.info("Attempting to use plugin 'WorldGuard'");
        } catch (Throwable ignored) {
        }
    }
    final Plugin townyPlugin = Bukkit.getServer().getPluginManager().getPlugin("Towny");
    if (townyPlugin != null && townyPlugin.isEnabled()) {
        try {
            managers.add(new TownyFeature(townyPlugin));
            LOGGER.info("Attempting to use plugin 'Towny'");
        } catch (Throwable ignored) {
        }
    }
    final Plugin residencePlugin = Bukkit.getServer().getPluginManager().getPlugin("Residence");
    if (residencePlugin != null && residencePlugin.isEnabled()) {
        try {
            managers.add(new ResidenceFeature(residencePlugin, this));
            LOGGER.info("Attempting to use plugin 'Residence'");
        } catch (Throwable ignored) {
        }
    }
    final Plugin griefpreventionPlugin = Bukkit.getServer().getPluginManager().getPlugin("GriefPrevention");
    if (griefpreventionPlugin != null && griefpreventionPlugin.isEnabled()) {
        try {
            managers.add(new GriefPreventionFeature(griefpreventionPlugin));
            LOGGER.info("Attempting to use plugin 'GriefPrevention'");
        } catch (Throwable ignored) {
        }
    }
    final Plugin griefdefenderPlugin = Bukkit.getServer().getPluginManager().getPlugin("GriefDefender");
    if (griefdefenderPlugin != null && griefdefenderPlugin.isEnabled()) {
        try {
            managers.add(new GriefDefenderFeature(griefdefenderPlugin));
            LOGGER.info("Attempting to use plugin 'GriefDefender'");
        } catch (Throwable ignored) {
        }
    }
    return managers;
}
Also used : GriefDefenderFeature(com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature) WorldGuardFeature(com.fastasyncworldedit.bukkit.regions.WorldGuardFeature) GriefPreventionFeature(com.fastasyncworldedit.bukkit.regions.GriefPreventionFeature) TownyFeature(com.fastasyncworldedit.bukkit.regions.TownyFeature) ArrayList(java.util.ArrayList) FaweMaskManager(com.fastasyncworldedit.core.regions.FaweMaskManager) Plugin(org.bukkit.plugin.Plugin) ResidenceFeature(com.fastasyncworldedit.bukkit.regions.ResidenceFeature)

Aggregations

GriefDefenderFeature (com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature)1 GriefPreventionFeature (com.fastasyncworldedit.bukkit.regions.GriefPreventionFeature)1 ResidenceFeature (com.fastasyncworldedit.bukkit.regions.ResidenceFeature)1 TownyFeature (com.fastasyncworldedit.bukkit.regions.TownyFeature)1 WorldGuardFeature (com.fastasyncworldedit.bukkit.regions.WorldGuardFeature)1 FaweMaskManager (com.fastasyncworldedit.core.regions.FaweMaskManager)1 ArrayList (java.util.ArrayList)1 Plugin (org.bukkit.plugin.Plugin)1