Class WorldApi
java.lang.Object
com.shanebeestudios.nms.api.world.WorldApi
API methods relating to
Worlds-
Method Summary
Modifier and TypeMethodDescriptionstatic voidfillBiome(@NotNull Location location, @NotNull Location location2, @NotNull NamespacedKey biomeKey) Fill a Biome between 2 locations.static voidfillBiome(@NotNull Location location, @NotNull Location location2, @NotNull NamespacedKey biomeKey, @Nullable NamespacedKey replaceKey) Fill a Biome between 2 locations with an option to only replace a specific Biome.static voidfillBlocks(@NotNull Location location, @NotNull Location location2, @NotNull BlockData data, @Nullable BlockData replace) Fill blocks within 2 locationsstatic @NotNull NamespacedKeyGet theNamespacedKeyof aBiomeat a specific location.static @NotNull List<NamespacedKey> Get a list of all available biomes asNamespacedKeysIncludes custom biomes as wellstatic booleanisWithinVillage(Location location) Check if a location is within a villagestatic @Nullable LocationlocateBiome(@NotNull NamespacedKey biomeKey, @NotNull Location center) Locate a biome in a radius of a locationstatic @Nullable LocationlocateBiome(@NotNull NamespacedKey biomeKey, @NotNull Location center, int radius, int step) Locate a biome in a radius of a locationstatic voidsetBiome(@NotNull Location location, @NotNull NamespacedKey biomeKey) Set a biome at a location, including custom biomes.
-
Method Details
-
getBiome
Get theNamespacedKeyof aBiomeat a specific location. This will include custom biomes as well.- Parameters:
location- Location to grab biome at- Returns:
- Key of biome
-
setBiome
public static void setBiome(@NotNull @NotNull Location location, @NotNull @NotNull NamespacedKey biomeKey) Set a biome at a location, including custom biomes.Will not send biome updates to players.
- Parameters:
location- Location of biome to changebiomeKey- Key of biome
-
fillBiome
public static void fillBiome(@NotNull @NotNull Location location, @NotNull @NotNull Location location2, @NotNull @NotNull NamespacedKey biomeKey) Fill a Biome between 2 locations.Will also send biome updates to players.
- Parameters:
location- First cornerlocation2- Second cornerbiomeKey- Key of biome
-
fillBiome
public static void fillBiome(@NotNull @NotNull Location location, @NotNull @NotNull Location location2, @NotNull @NotNull NamespacedKey biomeKey, @Nullable @Nullable NamespacedKey replaceKey) Fill a Biome between 2 locations with an option to only replace a specific Biome.Will also send biome updates to players.
- Parameters:
location- First cornerlocation2- Second cornerbiomeKey- Key of biomereplaceKey- Key of biome to replace
-
locateBiome
@Nullable public static @Nullable Location locateBiome(@NotNull @NotNull NamespacedKey biomeKey, @NotNull @NotNull Location center) Locate a biome in a radius of a locationDefaults to 6400 radius with 8 steps
- Parameters:
biomeKey- NamespacedKey of biome to findcenter- Where to look from- Returns:
- Location if a biome is found, null otherwise
-
locateBiome
@Nullable public static @Nullable Location locateBiome(@NotNull @NotNull NamespacedKey biomeKey, @NotNull @NotNull Location center, int radius, int step) Locate a biome in a radius of a location- Parameters:
biomeKey- NamespacedKey of biome to findcenter- Where to look fromradius- Max radius to searchstep- How many blocks to check in steps- Returns:
- Location if a biome is found, null otherwise
-
getBiomeKeys
Get a list of all available biomes asNamespacedKeysIncludes custom biomes as well- Returns:
- List of biomes
-
isWithinVillage
Check if a location is within a village- Parameters:
location- Location to check if in village- Returns:
- True if location is within a village
-
fillBlocks
public static void fillBlocks(@NotNull @NotNull Location location, @NotNull @NotNull Location location2, @NotNull @NotNull BlockData data, @Nullable @Nullable BlockData replace) Fill blocks within 2 locationsSimilar system to Minecraft's fill command
- Parameters:
location- Corner 1location2- Corner 2data- BlockData to setreplace- BlockData to replace (can be null)
-