Class StructureLocation

java.lang.Object
com.ryandw11.structure.structure.properties.StructureLocation
All Implemented Interfaces:
StructureProperty

public class StructureLocation extends Object implements StructureProperty
The configuration section for the Structure Location.
  • Constructor Details

    • StructureLocation

      @Deprecated public StructureLocation(StructureBuilder sb, org.bukkit.configuration.file.FileConfiguration configuration)
      Deprecated.
      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

      public List<String> getWorlds()
      Get the list of worlds the structure can spawn in.
      Returns:
      The list of worlds.
    • getSpawnSettings

      public StructureYSpawning getSpawnSettings()
      Get the Y Spawn settings.
      Returns:
      The Y Spawn settings.
    • getBiomes

      public List<String> getBiomes()
      Get the list of biomes.
      Returns:
      The list of biomes.
    • setWorlds

      public void setWorlds(List<String> worlds)
      Set the list of worlds.
      Parameters:
      worlds - The list of worlds to set.
    • setSpawnSettings

      public void setSpawnSettings(StructureYSpawning spawnY)
      Set the Spawn Y Settings.
      Parameters:
      spawnY - The spawn y settings.
    • setBiomes

      public void setBiomes(List<String> biomes)
      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 interface StructureProperty
      Parameters:
      configurationSection - The configuration section to save the property to.