Class LocationSpigot

java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.util.implementations.LocationSpigot
All Implemented Interfaces:
ILocation

public final class LocationSpigot extends Object implements ILocation
Represents an implementation of ILocation for the Spigot platform.
  • Constructor Details

    • LocationSpigot

      public LocationSpigot(IWorld world, @Nullable org.bukkit.World bukkitWorld, double x, double y, double z)
    • LocationSpigot

      public LocationSpigot(IWorld world, double x, double y, double z)
    • LocationSpigot

      public LocationSpigot(org.bukkit.World world, double x, double y, double z)
    • LocationSpigot

      public LocationSpigot(org.bukkit.Location location)
  • Method Details

    • getChunk

      @CheckReturnValue @Contract(pure=true) public Vector2Di getChunk()
      Description copied from interface: ILocation
      Gets the chunk coordinates of the chunk this location is in.
      Specified by:
      getChunk in interface ILocation
      Returns:
      The chunk coordinates of this location.
    • getBlockX

      @CheckReturnValue @Contract(pure=true) public int getBlockX()
      Description copied from interface: ILocation
      Gets the X value of this location.
      Specified by:
      getBlockX in interface ILocation
      Returns:
      The X value of this location.
    • getBlockY

      @CheckReturnValue @Contract(pure=true) public int getBlockY()
      Description copied from interface: ILocation
      Gets the Y value of this location.
      Specified by:
      getBlockY in interface ILocation
      Returns:
      The Y value of this location.
    • getBlockZ

      @CheckReturnValue @Contract(pure=true) public int getBlockZ()
      Description copied from interface: ILocation
      Gets the Z value of this location.
      Specified by:
      getBlockZ in interface ILocation
      Returns:
      The Z value of this location.
    • getX

      @CheckReturnValue @Contract(pure=true) public double getX()
      Description copied from interface: ILocation
      Gets the X value of this location.
      Specified by:
      getX in interface ILocation
      Returns:
      The X value of this location.
    • getY

      @CheckReturnValue @Contract(pure=true) public double getY()
      Description copied from interface: ILocation
      Gets the Y value of this location.
      Specified by:
      getY in interface ILocation
      Returns:
      The Y value of this location.
    • getZ

      @CheckReturnValue @Contract(pure=true) public double getZ()
      Description copied from interface: ILocation
      Gets the Z value of this location.
      Specified by:
      getZ in interface ILocation
      Returns:
      The Z value of this location.
    • setX

      @CheckReturnValue @Contract(pure=true) public ILocation setX(double newVal)
      Description copied from interface: ILocation
      Changes the x coordinate.
      Specified by:
      setX in interface ILocation
      Parameters:
      newVal - The new coordinate.
      Returns:
      A new ILocation.
    • setY

      @CheckReturnValue @Contract(pure=true) public ILocation setY(double newVal)
      Description copied from interface: ILocation
      Changes the y coordinate.
      Specified by:
      setY in interface ILocation
      Parameters:
      newVal - The new coordinate.
      Returns:
      A new ILocation.
    • setZ

      @CheckReturnValue @Contract(pure=true) public ILocation setZ(double newVal)
      Description copied from interface: ILocation
      Changes the z coordinate.@CheckReturnValue
      Specified by:
      setZ in interface ILocation
      Parameters:
      newVal - The new coordinate.
      Returns:
      A new ILocation.
    • add

      @CheckReturnValue @Contract(pure=true) public ILocation add(double x, double y, double z)
      Description copied from interface: ILocation
      Adds values to the coordinates of this location.
      Specified by:
      add in interface ILocation
      Parameters:
      x - The value to add to the x coordinate.
      y - The value to add to the y coordinate.
      z - The value to add to the z coordinate.
      Returns:
      A new ILocation.
    • add

      @CheckReturnValue @Contract(pure=true) public ILocation add(Vector3Di vector)
      Description copied from interface: ILocation
      Adds values to the coordinates of this location.
      Specified by:
      add in interface ILocation
      Parameters:
      vector - The vector to add to the coordinates.
      Returns:
      A new ILocation.
    • add

      @CheckReturnValue @Contract(pure=true) public ILocation add(Vector3Dd vector)
      Description copied from interface: ILocation
      Adds values to the coordinates of this location.
      Specified by:
      add in interface ILocation
      Parameters:
      vector - The vector to add to the coordinates.
      Returns:
      A new ILocation.
    • getBlock

      @CheckReturnValue @Contract(pure=true) public org.bukkit.block.Block getBlock()
      Gets the Block at the given location.

      See Location.getBlock().

      Returns:
      The block at this location.
    • getBukkitLocation

      @CheckReturnValue @Contract(pure=true) public org.bukkit.Location getBukkitLocation()
      Gets the bukkit location represented by this ILocation
      Returns:
      The Bukkit location.
    • toString

      @CheckReturnValue @Contract(pure=true) public String toString()
      Overrides:
      toString in class Object
    • equals

      @CheckReturnValue @Contract(pure=true) public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      @CheckReturnValue @Contract(pure=true) public int hashCode()
      Overrides:
      hashCode in class Object
    • getWorld

      @CheckReturnValue @Contract(pure=true) public IWorld getWorld()
      Description copied from interface: ILocation
      Gets the world of this location.
      Specified by:
      getWorld in interface ILocation
      Returns:
      The world of this location.