Package me.c7dev.dexterity.api
Class DexterityAPI
java.lang.Object
me.c7dev.dexterity.api.DexterityAPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckSchematicExists(String name) Returns true if a schematic with this name exists in the schematics foldervoidDeletes all marker points and marker vectorsCreates a clone of the passed in display or selection and returns the clone.convertBlocks(org.bukkit.Location l1, org.bukkit.Location l2) Converts all of the blocks inside the cuboid defined by the two locations into Block DisplaysconvertBlocks(org.bukkit.Location l1, org.bukkit.Location l2, ConvertTransaction t) Converts all of the blocks inside the cuboid defined by the two locations into Block DisplaysconvertBlocks(org.bukkit.Location l1, org.bukkit.Location l2, ConvertTransaction t, int limit) Converts all of the blocks inside the cuboid defined by the two locations into Block DisplaysList<org.bukkit.entity.BlockDisplay> getBlockDisplaysInRegion(org.bukkit.Location l1r, org.bukkit.Location l2r) Retrieves all of the block display entities within the cuboid defined by the two integer block locationsList<org.bukkit.entity.BlockDisplay> getBlockDisplaysInRegionContinuous(org.bukkit.Location l1r, org.bukkit.Location l2r, org.bukkit.util.Vector l1o, org.bukkit.util.Vector l2o) Retrieves all of the block display entities within the precise cuboid defined by the two continuous locationsgetDisplay(String label) Retrieves a savedDexterityDisplayin any world by its raw label nameReturns all names of displays that are saved across all worldsgetDisplayLabels(org.bukkit.entity.Player p) Returns all names of displays that are saved and owned by the player across all worldsReturns all displays that have been saved across all worldsstatic DexterityAPIgetLookingAt(org.bukkit.entity.Player p) Calculates the precise block display entity that the player is currently looking at with their cursorgetPhysicalBlockLookingAt(org.bukkit.entity.Player p) Calculates the precise placed block that the player is currently looking at with their cursorgetPhysicalBlockLookingAtRaw(org.bukkit.entity.Player p, double stepMultiplier, double maxDist) Calculates the precise placed block that the player is currently looking at with their cursorReturns an instance of the plugin main classgetSession(UUID u) Retrieves the edit session for the player with the specified UUID.getSession(org.bukkit.entity.Player p) Retrieves the specified player's edit session if it existsbooleanisInProcess(UUID u) Check if the UUID of a block display is a marker point that will be removed in the future.booleanisMarkerPoint(UUID uuid) Check if an entity UUID is a Dexterity marker pointbooleanisMarkerPoint(org.bukkit.entity.Entity entity) Check if an entity is a Dexterity marker pointorg.bukkit.entity.BlockDisplaymarkerPoint(org.bukkit.Location loc, org.bukkit.Color glow, double seconds) Creates a very small block display with a glow to illustrate a location with precision.org.bukkit.entity.BlockDisplay[]markerVector(org.bukkit.Location from_loc, org.bukkit.Location to_loc, org.bukkit.Color glow, double seconds) Creates a small block display between the from_loc to the to_loc with precision.org.bukkit.entity.BlockDisplay[]markerVector(org.bukkit.Location fromLoc, org.bukkit.Location toLoc, org.bukkit.Material mat, org.bukkit.Color glow, double seconds) Creates a small block display between the from_loc to the to_loc with precision.org.bukkit.entity.BlockDisplay[]markerVector(org.bukkit.Location from_loc, org.bukkit.util.Vector delta, org.bukkit.Color glow, double seconds) Creates a small block display between from_loc and a second location defined by a vector offset.org.bukkit.entity.BlockDisplay[]markerVector(org.bukkit.Location fromLoc, org.bukkit.util.Vector delta, org.bukkit.Material mat, org.bukkit.Color glow, double seconds) Creates a small block display between from_loc and a second location defined by a vector offset.voidremoveMarker(org.bukkit.entity.BlockDisplay b) Removes a marker point before the timer expiresvoidremoveMarker(org.bukkit.entity.BlockDisplay[] v) Removes a marker vector before the timer expiresselectFromLocations(org.bukkit.Location l1, org.bukkit.Location l2) Create a newDexterityDisplayof valid block displays within the precise cuboid defined by the two locations.selectFromLocations(org.bukkit.Location l1, org.bukkit.Location l2, Mask mask) Create a newDexterityDisplayof valid block displays within the precise cuboid defined by the two locations.selectFromLocations(org.bukkit.Location l1, org.bukkit.Location l2, Mask mask, org.bukkit.util.Vector scaleOffset1, org.bukkit.util.Vector scaleOffset2) Create a newDexterityDisplayof valid block displays within the precise cuboid defined by the two locations.voidtempHighlight(DexterityDisplay d, int ticks) Temporarily makes aDexterityDisplayglow for a period of time if it is not glowing already.voidtempHighlight(DexterityDisplay d, int ticks, org.bukkit.Color c) Temporarily makes aDexterityDisplayglow for a period of time if it is not glowing already.voidtempHighlight(org.bukkit.entity.BlockDisplay block, int ticks, org.bukkit.Color c) Temporarily makes a block display glow for a period of time if it is not glowing already.voidUndo any temporarily glow for a selection.
-
Constructor Details
-
DexterityAPI
-
-
Method Details
-
getPlugin
Returns an instance of the plugin main class- Returns:
-
getInstance
-
getDisplayLabels
Returns all names of displays that are saved across all worlds- Returns:
- Unmodifiable set of label strings
-
getDisplayLabels
Returns all names of displays that are saved and owned by the player across all worlds- Parameters:
p-- Returns:
-
getDisplays
Returns all displays that have been saved across all worlds- Returns:
- Unmodifiable collection of
DexterityDisplaythat have been saved
-
getDisplay
Retrieves a savedDexterityDisplayin any world by its raw label name- Parameters:
label- Label of the saved display- Returns:
- The saved display if it exists, otherwise null
-
getSession
Retrieves the specified player's edit session if it exists- Parameters:
p- The online player whose session is to be retrieved- Returns:
- The player's session if it exists, otherwise null
-
getSession
Retrieves the edit session for the player with the specified UUID. Can be used if the player is offline but the session has not been automatically deleted yet.- Parameters:
u- The UUID of the player whose session is to be retrieved- Returns:
- The edit session of the player with the specified UUID if it exists, otherwise null
-
convertBlocks
Converts all of the blocks inside the cuboid defined by the two locations into Block Displays- Parameters:
l1- First locationl2- Second location- Returns:
- A
DexterityDisplayselection of the newly created block displays
-
convertBlocks
public DexterityDisplay convertBlocks(org.bukkit.Location l1, org.bukkit.Location l2, ConvertTransaction t) Converts all of the blocks inside the cuboid defined by the two locations into Block Displays- Parameters:
l1- First locationl2- Second location- Returns:
- A
DexterityDisplayselection of the newly created block displays
-
convertBlocks
public DexterityDisplay convertBlocks(org.bukkit.Location l1, org.bukkit.Location l2, ConvertTransaction t, int limit) Converts all of the blocks inside the cuboid defined by the two locations into Block Displays- Parameters:
l1- First locationl2- Second locationt- Transaction to add blockslimit- Maximum number to convert for safety- Returns:
- A
DexterityDisplayselection of the newly created block displays
-
checkSchematicExists
Returns true if a schematic with this name exists in the schematics folder- Parameters:
name-- Returns:
-
getLookingAt
Calculates the precise block display entity that the player is currently looking at with their cursor- Parameters:
p- Player- Returns:
- Unmodifiable data object containing the entity, entity's center, block face, location on the block face, and basis vectors.
-
getPhysicalBlockLookingAt
Calculates the precise placed block that the player is currently looking at with their cursor- Parameters:
p-- Returns:
- Unmodifiable data object containing the block and distance (in block units) away.
-
getPhysicalBlockLookingAtRaw
public ClickedBlock getPhysicalBlockLookingAtRaw(org.bukkit.entity.Player p, double stepMultiplier, double maxDist) Calculates the precise placed block that the player is currently looking at with their cursor- Parameters:
p-stepMultiplier- Defines the step size, and thus the precision to checkmaxDist- Defines the maximum radius, in blocks, to search- Returns:
- Unmodifiable data object containing the block and distance (in block units) away.
-
clone
Creates a clone of the passed in display or selection and returns the clone. Does not merge the new clone.- Parameters:
d- The display or selection to clone
-
isMarkerPoint
public boolean isMarkerPoint(org.bukkit.entity.Entity entity) Check if an entity is a Dexterity marker point- Parameters:
entity-- Returns:
-
isMarkerPoint
Check if an entity UUID is a Dexterity marker point- Parameters:
uuid-- Returns:
-
markerPoint
public org.bukkit.entity.BlockDisplay markerPoint(org.bukkit.Location loc, org.bukkit.Color glow, double seconds) Creates a very small block display with a glow to illustrate a location with precision. Useful for debugging or verifying location variables.- Parameters:
loc-glow- The color of the marker pointseconds- The number of seconds until the marker point is removed, negative if permanent- Returns:
- The
BlockDisplayof the created marker point
-
markerVector
public org.bukkit.entity.BlockDisplay[] markerVector(org.bukkit.Location fromLoc, org.bukkit.util.Vector delta, org.bukkit.Material mat, org.bukkit.Color glow, double seconds) Creates a small block display between from_loc and a second location defined by a vector offset. Useful for debugging or verifying location variables.- Parameters:
fromLoc-delta-mat- Required material typeglow- The color of the vectorseconds- The number of seconds until marker vector is removed, negative if permanent- Returns:
- The BlockDisplays used in the created marker vector, formatted as {body, head}
-
markerVector
public org.bukkit.entity.BlockDisplay[] markerVector(org.bukkit.Location from_loc, org.bukkit.util.Vector delta, org.bukkit.Color glow, double seconds) Creates a small block display between from_loc and a second location defined by a vector offset. Useful for debugging or verifying location variables.- Parameters:
from_loc-delta-glow- The color of the vectorseconds- The number of seconds until marker vector is removed, negative if permanent- Returns:
- The BlockDisplays used in the created marker vector, formatted as {body, head}
-
markerVector
public org.bukkit.entity.BlockDisplay[] markerVector(org.bukkit.Location from_loc, org.bukkit.Location to_loc, org.bukkit.Color glow, double seconds) Creates a small block display between the from_loc to the to_loc with precision. Useful for debugging or verifying location variables.- Parameters:
from_loc-to_loc-glow- The color of the vectorseconds- The number of seconds until marker vector is removed, negative if permanent- Returns:
- The BlockDisplays used in the created marker vector, formatted as {body, head}
-
markerVector
public org.bukkit.entity.BlockDisplay[] markerVector(org.bukkit.Location fromLoc, org.bukkit.Location toLoc, org.bukkit.Material mat, org.bukkit.Color glow, double seconds) Creates a small block display between the from_loc to the to_loc with precision. Useful for debugging or verifying location variables.- Parameters:
fromLoc-toLoc-mat- Required material typeglow- The color of the vectorseconds- The number of seconds until marker vector is removed, negative if permanent- Returns:
- The BlockDisplays used in the created marker vector, formatted as {body, head}
-
removeMarker
public void removeMarker(org.bukkit.entity.BlockDisplay b) Removes a marker point before the timer expires- Parameters:
b- Marker point block display entity
-
removeMarker
public void removeMarker(org.bukkit.entity.BlockDisplay[] v) Removes a marker vector before the timer expires- Parameters:
v- Marker point block display entity
-
clearAllMarkers
public void clearAllMarkers()Deletes all marker points and marker vectors -
getAuthor
-
tempHighlight
Temporarily makes aDexterityDisplayglow for a period of time if it is not glowing already. Helpful for debugging or to visualize a selection.- Parameters:
d-ticks- The number of ticks (0.05 of a second) until the highlighting is reset.
-
tempHighlight
Temporarily makes aDexterityDisplayglow for a period of time if it is not glowing already. Helpful for debugging or to visualize a selection.- Parameters:
d-ticks- The number of ticks (0.05 of a second) until the highlighting is reset.c- The glow color to highlight with
-
tempHighlight
public void tempHighlight(org.bukkit.entity.BlockDisplay block, int ticks, org.bukkit.Color c) Temporarily makes a block display glow for a period of time if it is not glowing already. Helpful for debugging or to visualize a selection.- Parameters:
block- The block display to highlight withticks- The number of ticks (0.05 of a second) until the highlighting is reset.c- The color to highlight with.
-
unTempHighlight
Undo any temporarily glow for a selection.- Parameters:
d- The selection or display to remove temporary highlighting from
-
isInProcess
Check if the UUID of a block display is a marker point that will be removed in the future. Used to check that a repeating process does not go into an infinite loop if it can create marker points.- Parameters:
u-- Returns:
- true if the entity with that UUID is a marker point or otherwise will be removed in the near future.
-
getBlockDisplaysInRegion
public List<org.bukkit.entity.BlockDisplay> getBlockDisplaysInRegion(org.bukkit.Location l1r, org.bukkit.Location l2r) Retrieves all of the block display entities within the cuboid defined by the two integer block locations- Parameters:
l1r- The first block locationl2r- The second block location- Returns:
- Unmodifiable list of Block Display entities that are within the cuboid
-
getBlockDisplaysInRegionContinuous
public List<org.bukkit.entity.BlockDisplay> getBlockDisplaysInRegionContinuous(org.bukkit.Location l1r, org.bukkit.Location l2r, org.bukkit.util.Vector l1o, org.bukkit.util.Vector l2o) Retrieves all of the block display entities within the precise cuboid defined by the two continuous locations- Parameters:
l1r- The first locationl2r- The second locationl1o- The offset added to the minimum of the coordinatesl2o- The offset added to the maximum of the coordinates- Returns:
- Unmodifiable list of Block Display entities that are within the cuboid
-
selectFromLocations
Create a newDexterityDisplayof valid block displays within the precise cuboid defined by the two locations. Equivalent to using the wand to select in-game.- Parameters:
l1- The first locationl2- The second location- Returns:
- A new DexterityDisplay representing the selection made by the two locations.
-
selectFromLocations
public DexterityDisplay selectFromLocations(org.bukkit.Location l1, org.bukkit.Location l2, Mask mask) Create a newDexterityDisplayof valid block displays within the precise cuboid defined by the two locations. Equivalent to using the wand to select in-game.- Parameters:
l1- The first locationl2- The second locationmask- A mask to use, or null for no mask- Returns:
- A new DexterityDisplay representing the selection made by the two locations.
-
selectFromLocations
public DexterityDisplay selectFromLocations(org.bukkit.Location l1, org.bukkit.Location l2, Mask mask, org.bukkit.util.Vector scaleOffset1, org.bukkit.util.Vector scaleOffset2) Create a newDexterityDisplayof valid block displays within the precise cuboid defined by the two locations. Equivalent to using the wand to select in-game.- Parameters:
l1- The first locationl2- The second locationmask- A mask to use, or null for no maskscaleOffset1- The offset added to the minimum of the coordinatesscaleOffset2- The offset added to the maximum of the coordinates- Returns:
- A new DexterityDisplay representing the selection made by the two locations.
-