Add WorldBorder support

- Uses API in spigot to get world border
- Blocks faction claims that are outside the world border

Improved border detection

This is the updated border detection, this method is extremely accurate
and does not over partition claim space like before.

Takes the border and divides by two, and then converts the block
distance into a chunk distance.
Ex. Border = 100, Chunks = 6 vertically, 6 horizontally.

We get the absolute value difference between the center chunk and the
claim chunk, for both X and Z. We add both diffs, and if they are
greater than the limit, then we know the chunk is outside the border!
This commit is contained in:
Nick Porillo
2015-02-13 20:37:52 -05:00
committed by drtshock
parent e6aa3116ac
commit 5a9112ad37
5 changed files with 32 additions and 0 deletions

View File

@@ -45,6 +45,9 @@ public abstract class Board {
// Is this coord connected to any coord claimed by the specified faction?
public abstract boolean isConnectedLocation(FLocation flocation, Faction faction);
// Is this location outside the world border?
public abstract boolean isOutsideWorldBorder(FLocation flocation);
public abstract boolean hasFactionWithin(FLocation flocation, Faction faction, int radius);
//----------------------------------------------//