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