Class SelectionTool

java.lang.Object
redempt.redlib.region.SelectionTool
All Implemented Interfaces:
org.bukkit.event.Listener

public class SelectionTool extends Object implements org.bukkit.event.Listener
A tool which can be given to players and used to select a Region, or just any two points
  • Constructor Summary

    Constructors
    Constructor
    Description
    SelectionTool(org.bukkit.inventory.ItemStack item)
    Create a SelectionTool with the given item
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.inventory.ItemStack
    Gets the item used by this SelectionTool
    org.bukkit.Location[]
    Get the locations selected by the given player
    List<org.bukkit.Location>
    getPath(UUID uuid)
    Creates a path of Locations, one block apart, based on the locations selected by the player
    Creates and returns a Region based on the locations selected by the player
    void
    onClick(org.bukkit.event.player.PlayerInteractEvent e)
     
    void
    onPluginDisable(org.bukkit.event.server.PluginDisableEvent e)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SelectionTool

      public SelectionTool(org.bukkit.inventory.ItemStack item)
      Create a SelectionTool with the given item
      Parameters:
      item - The item to use
  • Method Details

    • onPluginDisable

      public void onPluginDisable(org.bukkit.event.server.PluginDisableEvent e)
    • onClick

      public void onClick(org.bukkit.event.player.PlayerInteractEvent e)
    • getItem

      public org.bukkit.inventory.ItemStack getItem()
      Gets the item used by this SelectionTool
      Returns:
      The item
    • getLocations

      public org.bukkit.Location[] getLocations(UUID uuid)
      Get the locations selected by the given player
      Parameters:
      uuid - The UUID of the player
      Returns:
      The locations selected by the given player
    • getRegion

      public CuboidRegion getRegion(UUID uuid)
      Creates and returns a Region based on the locations selected by the player
      Parameters:
      uuid - The UUID of the player
      Returns:
      The Region selected by the player, or null if the player has not selected 2 locations
    • getPath

      public List<org.bukkit.Location> getPath(UUID uuid)
      Creates a path of Locations, one block apart, based on the locations selected by the player
      Parameters:
      uuid - The UUID of the player
      Returns:
      The Path selected by the player, or null if the player has not selected 2 locations