Search in sources :

Example 1 with RegionQuery

use of com.sk89q.worldguard.protection.regions.RegionQuery in project EliteMobs by MagmaGuy.

the class WorldGuardFlagChecker method doExplosionRegenFlag.

public static boolean doExplosionRegenFlag(Location location) {
    com.sk89q.worldedit.util.Location wgLocation = BukkitAdapter.adapt(location);
    RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
    RegionQuery query = container.createQuery();
    ApplicableRegionSet set = query.getApplicableRegions(wgLocation);
    return set.testState(null, WorldGuardCompatibility.getEliteMobsExplosionRegen());
}
Also used : RegionContainer(com.sk89q.worldguard.protection.regions.RegionContainer) RegionQuery(com.sk89q.worldguard.protection.regions.RegionQuery) ApplicableRegionSet(com.sk89q.worldguard.protection.ApplicableRegionSet)

Example 2 with RegionQuery

use of com.sk89q.worldguard.protection.regions.RegionQuery in project EliteMobs by MagmaGuy.

the class WorldGuardFlagChecker method checkFlag.

public static boolean checkFlag(Location location, StateFlag stateFlag) {
    com.sk89q.worldedit.util.Location wgLocation = BukkitAdapter.adapt(location);
    RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
    RegionQuery query = container.createQuery();
    ApplicableRegionSet set = query.getApplicableRegions(wgLocation);
    return set.testState(null, stateFlag);
}
Also used : RegionContainer(com.sk89q.worldguard.protection.regions.RegionContainer) RegionQuery(com.sk89q.worldguard.protection.regions.RegionQuery) ApplicableRegionSet(com.sk89q.worldguard.protection.ApplicableRegionSet)

Example 3 with RegionQuery

use of com.sk89q.worldguard.protection.regions.RegionQuery in project EliteMobs by MagmaGuy.

the class WorldGuardFlagChecker method doMobSpawnFlag.

public static boolean doMobSpawnFlag(Location location) {
    com.sk89q.worldedit.util.Location wgLocation = BukkitAdapter.adapt(location);
    RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
    RegionQuery query = container.createQuery();
    ApplicableRegionSet set = query.getApplicableRegions(wgLocation);
    return set.testState(null, Flags.MOB_SPAWNING);
}
Also used : RegionContainer(com.sk89q.worldguard.protection.regions.RegionContainer) RegionQuery(com.sk89q.worldguard.protection.regions.RegionQuery) ApplicableRegionSet(com.sk89q.worldguard.protection.ApplicableRegionSet)

Example 4 with RegionQuery

use of com.sk89q.worldguard.protection.regions.RegionQuery in project EliteMobs by MagmaGuy.

the class WorldGuardFlagChecker method getIntegerFlagValue.

@Nullable
public static Integer getIntegerFlagValue(Location location, Flag flag) {
    com.sk89q.worldedit.util.Location wgLocation = BukkitAdapter.adapt(location);
    RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
    RegionQuery query = container.createQuery();
    ApplicableRegionSet set = query.getApplicableRegions(wgLocation);
    Object object = set.queryValue(null, flag);
    return object == null ? null : (Integer) object;
}
Also used : RegionContainer(com.sk89q.worldguard.protection.regions.RegionContainer) RegionQuery(com.sk89q.worldguard.protection.regions.RegionQuery) ApplicableRegionSet(com.sk89q.worldguard.protection.ApplicableRegionSet) Nullable(javax.annotation.Nullable)

Example 5 with RegionQuery

use of com.sk89q.worldguard.protection.regions.RegionQuery in project EliteMobs by MagmaGuy.

the class WorldGuardFlagChecker method doEventFlag.

public static boolean doEventFlag(Location location) {
    com.sk89q.worldedit.util.Location wgLocation = BukkitAdapter.adapt(location);
    RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
    RegionQuery query = container.createQuery();
    ApplicableRegionSet set = query.getApplicableRegions(wgLocation);
    return set.testState(null, WorldGuardCompatibility.getEliteMobsEventsFlag());
}
Also used : RegionContainer(com.sk89q.worldguard.protection.regions.RegionContainer) RegionQuery(com.sk89q.worldguard.protection.regions.RegionQuery) ApplicableRegionSet(com.sk89q.worldguard.protection.ApplicableRegionSet)

Aggregations

ApplicableRegionSet (com.sk89q.worldguard.protection.ApplicableRegionSet)6 RegionContainer (com.sk89q.worldguard.protection.regions.RegionContainer)6 RegionQuery (com.sk89q.worldguard.protection.regions.RegionQuery)6 Nullable (javax.annotation.Nullable)1