Adds per faction warps functionality from #72.
Default max warps per faction is 5. It can be changed in the config.yml.
You can now use {warps} in the info board to show how many warps a faction has when you walk into their territory.
Only faction mods+ can set faction warps.
This commit is contained in:
@@ -2,6 +2,7 @@ package com.massivecraft.factions;
|
||||
|
||||
import com.massivecraft.factions.util.MiscUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -149,6 +150,14 @@ public class FLocation implements Serializable {
|
||||
return dx * dx + dz * dz;
|
||||
}
|
||||
|
||||
public boolean isInChunk(Location loc) {
|
||||
if (loc == null) {
|
||||
return false;
|
||||
}
|
||||
Chunk chunk = loc.getChunk();
|
||||
return loc.getWorld().getName().equalsIgnoreCase(getWorldName()) && chunk.getX() == x && chunk.getZ() == z;
|
||||
}
|
||||
|
||||
//----------------------------------------------//
|
||||
// Some Geometry
|
||||
//----------------------------------------------//
|
||||
|
||||
Reference in New Issue
Block a user