Class StructureApi
java.lang.Object
com.shanebeestudios.nms.api.world.StructureApi
API methods relating to Structures
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull List
<NamespacedKey> Get a list of all registered configured featuresstatic @NotNull List
<NamespacedKey> Get a list of all registered placed featuresstatic @NotNull List
<NamespacedKey> Get a list of available structuresstatic List
<NamespacedKey> Get a list of available structure templatesstatic @Nullable Location
locateNearestStructure
(@NotNull NamespacedKey structureKey, @NotNull Location location) Locate the nearest placed structurestatic @Nullable Location
locateNearestStructure
(@NotNull NamespacedKey structureKey, @NotNull Location location, int radius, boolean findUnexplored) Locate the nearest placed structurestatic boolean
placeConfiguredFeature
(@NotNull NamespacedKey featureKey, @NotNull Location location) Place a configured featurestatic boolean
placePlacedFeature
(@NotNull NamespacedKey featureKey, @NotNull Location location) Place a placed feature
-
Method Details
-
placeConfiguredFeature
public static boolean placeConfiguredFeature(@NotNull @NotNull NamespacedKey featureKey, @NotNull @NotNull Location location) Place a configured feature- Parameters:
featureKey
- Key of feature to placelocation
- Location to place at- Returns:
- True if feature was placed, otherwise false if failed
- See Also:
-
placePlacedFeature
public static boolean placePlacedFeature(@NotNull @NotNull NamespacedKey featureKey, @NotNull @NotNull Location location) Place a placed feature- Parameters:
featureKey
- Key of feature to placelocation
- Location to place at- Returns:
- True if feature was placed, otherwise false if failed
- See Also:
-
locateNearestStructure
@Nullable public static @Nullable Location locateNearestStructure(@NotNull @NotNull NamespacedKey structureKey, @NotNull @NotNull Location location) Locate the nearest placed structureThis does not mean a StructureBlock Structure, this means a structure placed in a world, such as a village. Will default to a radius of 6400 and true for findUnexplored.
- Parameters:
structureKey
- Key of structure to findlocation
- Location to center search from- Returns:
- Location of structure if found, otherwise null
-
locateNearestStructure
@Nullable public static @Nullable Location locateNearestStructure(@NotNull @NotNull NamespacedKey structureKey, @NotNull @NotNull Location location, int radius, boolean findUnexplored) Locate the nearest placed structureThis does not mean a StructureBlock Structure, this means a structure placed in a world, such as a village.
- Parameters:
structureKey
- Key of structure to findlocation
- Location to center search fromradius
- Max radius to search infindUnexplored
- Whether to look for structures that haven't generated yet- Returns:
- Location of structure if found, otherwise null
-
getConfiguredFeatures
Get a list of all registered configured features- Returns:
- List of all registered configured features
-
getPlacedFeatures
Get a list of all registered placed features- Returns:
- List of all registered placed features
-
getStructures
Get a list of available structuresThis does not mean StructureBlock Structures, this means structures placed in a world, such as a village.
- Returns:
- List of available structures
-
getStructureTemplates
Get a list of available structure templatesYou can load via
StructureManager.getStructure(NamespacedKey)
, and place into world viaStructure.place(Location, boolean, StructureRotation, Mirror, int, float, Random)
- Returns:
- List of available structure templates
-