use of com.sk89q.worldguard.protection.regions.RegionContainer 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());
}
use of com.sk89q.worldguard.protection.regions.RegionContainer 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);
}
use of com.sk89q.worldguard.protection.regions.RegionContainer 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);
}
use of com.sk89q.worldguard.protection.regions.RegionContainer in project MyPet by xXKeyleXx.
the class WorldGuardHook method getDoubleValue.
public Collection<Double> getDoubleValue(Location loc, Player player, DoubleFlag flag) {
if (is7) {
RegionContainer rc = WorldGuard.getInstance().getPlatform().getRegionContainer();
return rc.createQuery().queryAllValues(BukkitAdapter.adapt(loc), player != null ? WorldGuardPlugin.inst().wrapPlayer(player) : null, flag);
} else {
try {
RegionManager mgr = (RegionManager) METHOD_getRegionManager.invoke(wgp, loc.getWorld());
ApplicableRegionSet set = (ApplicableRegionSet) METHOD_getApplicableRegions.invoke(mgr, loc);
return set.queryAllValues(player != null ? wgp.wrapPlayer(player) : null, flag);
} catch (Exception ignored) {
return Collections.emptyList();
}
}
}
use of com.sk89q.worldguard.protection.regions.RegionContainer in project MyPet by xXKeyleXx.
the class WorldGuardHook method getState.
public StateFlag.State getState(Location loc, Player player, StateFlag... flags) {
if (is7) {
RegionContainer rc = WorldGuard.getInstance().getPlatform().getRegionContainer();
if (rc != null) {
return rc.createQuery().queryState(BukkitAdapter.adapt(loc), player != null ? WorldGuardPlugin.inst().wrapPlayer(player) : null, flags);
}
} else {
try {
RegionManager mgr = (RegionManager) METHOD_getRegionManager.invoke(wgp, loc.getWorld());
ApplicableRegionSet set = (ApplicableRegionSet) METHOD_getApplicableRegions.invoke(mgr, loc);
return set.queryState(player != null ? wgp.wrapPlayer(player) : null, flags);
} catch (Exception ignored) {
}
}
return StateFlag.State.ALLOW;
}
Aggregations