Package com.massivecraft.factions
Class FLocation
- java.lang.Object
-
- com.massivecraft.factions.FLocation
-
- All Implemented Interfaces:
java.io.Serializable
public class FLocation extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Method Summary
Modifier and Type Method Description static int
blockToChunk(int blockVal)
static int
blockToRegion(int blockVal)
static int
chunkToBlock(int chunkVal)
static int
chunkToRegion(int chunkVal)
boolean
equals(java.lang.Object obj)
static FLocation
fromString(java.lang.String string)
static java.util.HashSet<FLocation>
getArea(FLocation from, FLocation to)
org.bukkit.Chunk
getChunk()
java.util.Set<FLocation>
getCircle(double radius)
java.lang.String
getCoordString()
double
getDistanceSquaredTo(FLocation that)
double
getDistanceTo(FLocation that)
FLocation
getRelative(int dx, int dz)
org.bukkit.World
getWorld()
java.lang.String
getWorldName()
long
getX()
long
getZ()
int
hashCode()
boolean
isInChunk(org.bukkit.Location loc)
boolean
isOutsideWorldBorder(int buffer)
Checks if the chunk represented by this FLocation is outside the world borderstatic int
regionToBlock(int regionVal)
static int
regionToChunk(int regionVal)
void
setWorldName(java.lang.String worldName)
void
setX(int x)
void
setZ(int z)
java.lang.String
toString()
-
-
-
Constructor Detail
-
FLocation
public FLocation()
-
FLocation
public FLocation(java.lang.String worldName, int x, int z)
-
FLocation
public FLocation(org.bukkit.Location location)
-
FLocation
public FLocation(org.bukkit.entity.Player player)
-
FLocation
public FLocation(FPlayer fplayer)
-
FLocation
public FLocation(org.bukkit.block.Block block)
-
-
Method Detail
-
fromString
public static FLocation fromString(java.lang.String string)
-
blockToChunk
public static int blockToChunk(int blockVal)
-
blockToRegion
public static int blockToRegion(int blockVal)
-
chunkToRegion
public static int chunkToRegion(int chunkVal)
-
chunkToBlock
public static int chunkToBlock(int chunkVal)
-
regionToBlock
public static int regionToBlock(int regionVal)
-
regionToChunk
public static int regionToChunk(int regionVal)
-
getChunk
public org.bukkit.Chunk getChunk()
-
getWorldName
public java.lang.String getWorldName()
-
setWorldName
public void setWorldName(java.lang.String worldName)
-
getWorld
public org.bukkit.World getWorld()
-
getX
public long getX()
-
setX
public void setX(int x)
-
getZ
public long getZ()
-
setZ
public void setZ(int z)
-
getCoordString
public java.lang.String getCoordString()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getRelative
public FLocation getRelative(int dx, int dz)
-
getDistanceTo
public double getDistanceTo(FLocation that)
-
getDistanceSquaredTo
public double getDistanceSquaredTo(FLocation that)
-
isInChunk
public boolean isInChunk(org.bukkit.Location loc)
-
isOutsideWorldBorder
public boolean isOutsideWorldBorder(int buffer)
Checks if the chunk represented by this FLocation is outside the world border- Parameters:
buffer
- the number of chunks from the border that will be treated as "outside"- Returns:
- whether this location is outside of the border
-
getCircle
public java.util.Set<FLocation> getCircle(double radius)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-