Allow using FLocation object in canClaimForFactionAtLocation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.integration;
|
||||
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
@@ -91,14 +92,26 @@ public class Worldguard {
|
||||
// Returns:
|
||||
// True: Regions found within chunk
|
||||
// False: No regions found within chunk
|
||||
|
||||
public static boolean checkForRegionsInChunk(FLocation floc) {
|
||||
Chunk chunk = floc.getWorld().getChunkAt((int) floc.getX(), (int) floc.getZ());
|
||||
|
||||
return checkForRegionsInChunk(chunk);
|
||||
}
|
||||
|
||||
public static boolean checkForRegionsInChunk(Location loc) {
|
||||
Chunk chunk = loc.getWorld().getChunkAt(loc);
|
||||
|
||||
return checkForRegionsInChunk(chunk);
|
||||
}
|
||||
|
||||
public static boolean checkForRegionsInChunk(Chunk chunk) {
|
||||
if (!enabled) {
|
||||
// No WG hooks so we'll always bypass this check.
|
||||
return false;
|
||||
}
|
||||
|
||||
World world = loc.getWorld();
|
||||
Chunk chunk = world.getChunkAt(loc);
|
||||
World world = chunk.getWorld();
|
||||
int minChunkX = chunk.getX() << 4;
|
||||
int minChunkZ = chunk.getZ() << 4;
|
||||
int maxChunkX = minChunkX + 15;
|
||||
|
||||
Reference in New Issue
Block a user