Package dev.kitteh.factions
Record Class FLocation
java.lang.Object
java.lang.Record
dev.kitteh.factions.FLocation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.ChunkasChunk()Returns the chunk x value, a comma, and the chunk z value, without spaces.static intblockToChunk(int blockVal) static intchunkToBlock(int chunkVal) booleancontains(LazyLocation loc) booleancontains(org.bukkit.Location loc) booleanIndicates whether some other object is "equal to" this one.faction()inthashCode()Returns a hash code value for this object.booleanisOutsideWorldBorder(int buffer) Checks if the chunk represented by this FLocation is outside the world borderrelative(int dx, int dz) toString()Returns a string representation of this record class.org.bukkit.Worldworld()Returns the value of theworldNamerecord component.intx()Returns the value of thexrecord component.intz()Returns the value of thezrecord component.zone()
-
Constructor Details
-
FLocation
public FLocation() -
FLocation
public FLocation(org.bukkit.Location location) -
FLocation
-
FLocation
public FLocation(org.bukkit.Chunk chunk) -
FLocation
public FLocation(org.bukkit.entity.Player player) -
FLocation
public FLocation(org.bukkit.block.Block block) -
FLocation
Creates an instance of aFLocationrecord class.- Parameters:
worldName- the value for theworldNamerecord componentx- the value for thexrecord componentz- the value for thezrecord component
-
-
Method Details
-
world
public org.bukkit.World world() -
faction
-
zone
-
asCoordString
Returns the chunk x value, a comma, and the chunk z value, without spaces.- Returns:
- coordinate string
-
asChunk
public org.bukkit.Chunk asChunk() -
blockToChunk
public static int blockToChunk(int blockVal) -
chunkToBlock
public static int chunkToBlock(int chunkVal) -
relative
-
contains
public boolean contains(org.bukkit.Location loc) -
contains
-
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 the border
-
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
worldName
Returns the value of theworldNamerecord component.- Returns:
- the value of the
worldNamerecord component
-
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-