public interface NucleusWarpService
Modifier and Type | Method and Description |
---|---|
List<Warp> |
getAllWarps()
Gets all the warps available.
|
List<Warp> |
getUncategorisedWarps()
Get all warps that have not been given a category.
|
Optional<Warp> |
getWarp(String warpName)
Gets the location for the specified warp.
|
Optional<WarpCategory> |
getWarpCategory(String category)
Gets the data associated with a warp category.
|
Set<String> |
getWarpNames()
Gets the names of all the warp that are available.
|
List<Warp> |
getWarpsForCategory(String category)
Gets all warps that hae been given the specified category.
|
default Map<WarpCategory,List<Warp>> |
getWarpsWithCategories()
Gets all warps that have categories.
|
Map<WarpCategory,List<Warp>> |
getWarpsWithCategories(Predicate<Warp> warpDataPredicate)
Gets all warps that have categories.
|
boolean |
removeWarp(String warpName)
Removes a warp.
|
boolean |
removeWarpCost(String warpName)
Removes the cost of a warp.
|
boolean |
setWarp(String warpName,
Location<World> location,
Vector3d rotation)
Sets a warp, will not overwrite current warp.
|
boolean |
setWarpCategory(String warpName,
String category)
Sets a warp's category
|
boolean |
setWarpCategoryDescription(String category,
Text description)
Sets the description of a warp category.
|
boolean |
setWarpCategoryDisplayName(String category,
Text displayName)
Sets the display name of a warp category.
|
boolean |
setWarpCost(String warpName,
double cost)
Sets the cost of a warp.
|
boolean |
setWarpDescription(String warpName,
Text description)
Sets a warp's description.
|
default boolean |
warpExists(String name)
Gets whether a warp exists.
|
Optional<Warp> getWarp(String warpName)
warpName
- The name of the warp to check.Location
of the warp, or Optional.empty()
otherwise.boolean removeWarp(String warpName)
warpName
- The name of the warp.true
if the warp was there and removed, false
if the warp never existed.boolean setWarp(String warpName, Location<World> location, Vector3d rotation)
warpName
- The name of the warp to set.location
- The location of the warp.rotation
- The rotation of the warp.true
if set, false
otherwise.List<Warp> getAllWarps()
If you just want to display the names, use getWarpNames()
instead.
List<Warp> getUncategorisedWarps()
Warp
s without a category.List<Warp> getWarpsForCategory(String category)
category
- The category.default Map<WarpCategory,List<Warp>> getWarpsWithCategories()
Map<WarpCategory,List<Warp>> getWarpsWithCategories(Predicate<Warp> warpDataPredicate)
warpDataPredicate
- The filtering predicate to return the subset of warps required.boolean removeWarpCost(String warpName)
warpName
- The name of the warp to remove the cost from.true
if the cost removal succeeds.boolean setWarpCost(String warpName, double cost)
warpName
- The name of the warp to change the cost of.cost
- The cost to use the warp. Set to zero (or negative) to disable.true
if the cost is set, false
otherwise.boolean setWarpCategory(String warpName, @Nullable String category)
warpName
- The name of the warp.category
- The name of the category.true
if successfulboolean setWarpDescription(String warpName, @Nullable Text description)
warpName
- The name of the warp.description
- The description, or null
to clear.true
if successfulSet<String> getWarpNames()
default boolean warpExists(String name)
name
- The name to check for.true
if it exists, false
otherwise.Optional<WarpCategory> getWarpCategory(String category)
category
- The name of the category to get.Optional
containing the category, if it exists.boolean setWarpCategoryDisplayName(String category, @Nullable Text displayName)
category
- The name of the category.displayName
- The display name. Set to null to revert to the category name.true
if the category exists and this is successful.boolean setWarpCategoryDescription(String category, @Nullable Text description)
category
- The name of the category.description
- The description. Set to null to remove the description.true
if the category exists and this is successful.