Class StructureLocation
java.lang.Object
com.ryandw11.structure.structure.properties.StructureLocation
- All Implemented Interfaces:
StructureProperty
The configuration section for the Structure Location.
-
Constructor Summary
ConstructorDescriptionConstruct the Structure Location using default values.StructureLocation(StructureBuilder sb, org.bukkit.configuration.file.FileConfiguration configuration)
Deprecated.StructureLocation(List<String> worlds, StructureYSpawning spawnSettings, List<String> biomes)
Construct the StructureLocation properties without a config.StructureLocation(org.bukkit.configuration.file.FileConfiguration fileConfiguration)
Create the Structure Location configuration section. -
Method Summary
Modifier and TypeMethodDescriptionGet the list of biomes.double
Get the minimum distance from other structures.double
Get the minimum distance from other structures of the same time.Get the Y Spawn settings.Get the list of worlds the structure can spawn in.int
Get the X-Axis limitation.int
Get the Z-Axis limitation.boolean
hasBiome(org.bukkit.block.Biome b)
Check if the biomes list contains a biome.void
saveToFile(org.bukkit.configuration.ConfigurationSection configurationSection)
Saves the property to the specified configuration section.void
Set the list of biomes.void
setDistanceFromOthers(double distance)
Set the minimum distance from other structures.void
setDistanceFromSame(double distance)
Set the distance requirement for the same structures.void
setSpawnSettings(StructureYSpawning spawnY)
Set the Spawn Y Settings.void
Set the list of worlds.void
setXLimitation(int x)
Set the X-axis limitation.void
setZLimitation(int z)
Set the Z-Axis limitation.
-
Constructor Details
-
StructureLocation
@Deprecated public StructureLocation(StructureBuilder sb, org.bukkit.configuration.file.FileConfiguration configuration)Deprecated.UseStructureLocation(FileConfiguration)
instead.Create the Structure Location configuration section.- Parameters:
sb
- The Structure Builder.configuration
- The File Configuration.
-
StructureLocation
public StructureLocation(org.bukkit.configuration.file.FileConfiguration fileConfiguration)Create the Structure Location configuration section.- Parameters:
fileConfiguration
- The file configuration to grab the section from.
-
StructureLocation
public StructureLocation(List<String> worlds, StructureYSpawning spawnSettings, List<String> biomes)Construct the StructureLocation properties without a config.Other values can be edited using setter methods.
- Parameters:
worlds
- The worlds.spawnSettings
- The y setting.biomes
- The list of biomes.
-
StructureLocation
public StructureLocation()Construct the Structure Location using default values.
-
-
Method Details
-
getWorlds
Get the list of worlds the structure can spawn in.- Returns:
- The list of worlds.
-
getSpawnSettings
Get the Y Spawn settings.- Returns:
- The Y Spawn settings.
-
getBiomes
Get the list of biomes.- Returns:
- The list of biomes.
-
setWorlds
Set the list of worlds.- Parameters:
worlds
- The list of worlds to set.
-
setSpawnSettings
Set the Spawn Y Settings.- Parameters:
spawnY
- The spawn y settings.
-
setBiomes
Set the list of biomes.An empty list is assumed to mean all biomes.
- Parameters:
biomes
- The list of biomes to set.
-
hasBiome
public boolean hasBiome(org.bukkit.block.Biome b)Check if the biomes list contains a biome.An empty list is assumed to mean all biomes.
- Parameters:
b
- The biome to check for.- Returns:
- If the biome is in the list (or if the list is empty).
-
setXLimitation
public void setXLimitation(int x)Set the X-axis limitation.- Parameters:
x
- The X-Axis limitation.
-
getXLimitation
public int getXLimitation()Get the X-Axis limitation.- Returns:
- The X-Axis limitation.
-
setZLimitation
public void setZLimitation(int z)Set the Z-Axis limitation.- Parameters:
z
- The Z-Axis limitation.
-
getZLimitation
public int getZLimitation()Get the Z-Axis limitation.- Returns:
- The Z-Axis limitation.
-
getDistanceFromOthers
public double getDistanceFromOthers()Get the minimum distance from other structures.- Returns:
- The minimum distance from other structures.
-
setDistanceFromOthers
public void setDistanceFromOthers(double distance)Set the minimum distance from other structures.- Parameters:
distance
- The distance desired (Must be positive).
-
getDistanceFromSame
public double getDistanceFromSame()Get the minimum distance from other structures of the same time.- Returns:
- Minimum distance from structures.
-
setDistanceFromSame
public void setDistanceFromSame(double distance)Set the distance requirement for the same structures.- Parameters:
distance
- Minimum distance from other structures of the same type.
-
saveToFile
public void saveToFile(org.bukkit.configuration.ConfigurationSection configurationSection)Saves the property to the specified configuration section.- Specified by:
saveToFile
in interfaceStructureProperty
- Parameters:
configurationSection
- The configuration section to save the property to.
-
StructureLocation(FileConfiguration)
instead.