Package redempt.redlib.region
Class SelectionTool
java.lang.Object
redempt.redlib.region.SelectionTool
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionSelectionTool
(org.bukkit.inventory.ItemStack item) Create a SelectionTool with the given item -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
getItem()
Gets the item used by this SelectionToolorg.bukkit.Location[]
getLocations
(UUID uuid) Get the locations selected by the given playerList<org.bukkit.Location>
Creates a path of Locations, one block apart, based on the locations selected by the playerCreates and returns a Region based on the locations selected by the playervoid
onClick
(org.bukkit.event.player.PlayerInteractEvent e) void
onPluginDisable
(org.bukkit.event.server.PluginDisableEvent e)
-
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
Get the locations selected by the given player- Parameters:
uuid
- The UUID of the player- Returns:
- The locations selected by the given player
-
getRegion
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
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
-