Record Class FLocation

java.lang.Object
java.lang.Record
dev.kitteh.factions.FLocation

@AvailableSince("4.0.0") @NullMarked public record FLocation(String worldName, int x, int z) extends Record
  • Constructor Details

    • FLocation

      public FLocation()
    • FLocation

      public FLocation(org.bukkit.Location location)
    • FLocation

      public FLocation(LazyLocation location)
    • FLocation

      public FLocation(org.bukkit.Chunk chunk)
    • FLocation

      public FLocation(org.bukkit.entity.Player player)
    • FLocation

      public FLocation(org.bukkit.block.Block block)
    • FLocation

      public FLocation(String worldName, int x, int z)
      Creates an instance of a FLocation record class.
      Parameters:
      worldName - the value for the worldName record component
      x - the value for the x record component
      z - the value for the z record component
  • Method Details

    • world

      public org.bukkit.World world()
    • faction

      public Faction faction()
    • zone

      public Faction.Zone zone()
    • asCoordString

      public String 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

      public FLocation relative(int dx, int dz)
    • contains

      public boolean contains(org.bukkit.Location loc)
    • contains

      public boolean contains(LazyLocation 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 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public boolean equals(Object obj)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • worldName

      public String worldName()
      Returns the value of the worldName record component.
      Returns:
      the value of the worldName record component
    • x

      public int x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • z

      public int z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component