Class StructureLimitations

java.lang.Object
com.ryandw11.structure.structure.properties.StructureLimitations

public class StructureLimitations extends Object
This class represents the StructureLimitations configuration section of a structure.
  • Constructor Details

    • StructureLimitations

      public StructureLimitations(org.bukkit.configuration.file.FileConfiguration configuration)
      Create structure limitations from a file.
      Parameters:
      configuration - The configuration to create from.
    • StructureLimitations

      public StructureLimitations(List<String> whitelistSpawnBlocks, List<String> blacklistSpawnBlocks, BlockLevelLimit blockLevelLimit, Map<org.bukkit.Material,​org.bukkit.Material> blockReplacement)
      Create structure limitations without a config.
      Parameters:
      whitelistSpawnBlocks - The list of whitelisted spawn blocks.
      blacklistSpawnBlocks - The list of blacklisted spawn blocks.
      blockLevelLimit - The block level limit.
      blockReplacement - The block replacement map.
  • Method Details

    • setIterationLimit

      public void setIterationLimit(int iterationLimit)
      Set the iteration limit for the structure.
      Parameters:
      iterationLimit - The iteration limit.
    • getIterationLimit

      public int getIterationLimit()
      Get the iteration limit for the structure.
      Returns:
      The iteration limit.
    • getWhitelistBlocks

      public List<String> getWhitelistBlocks()
      Get the whitelisted blocks.
      Returns:
      The whitelisted blocks.
    • getBlacklistBlocks

      public List<String> getBlacklistBlocks()
      Get the blacklisted blocks.
      Returns:
      The blacklisted blocks.
    • hasWhitelistBlock

      public boolean hasWhitelistBlock(org.bukkit.block.Block b)
      Check to see if the whitelist has a block.
      Parameters:
      b - The block to check
      Returns:
      If the whitelist has the block. (Returns true if there is no whitelist)
    • hasBlacklistBlock

      public boolean hasBlacklistBlock(org.bukkit.block.Block b)
      Check to see if the blacklist has a block.
      Parameters:
      b - The block to check.
      Returns:
      If the blacklist has the block. (Returns false if there is no blacklist)
    • getBlockLevelLimit

      public BlockLevelLimit getBlockLevelLimit()
      The block level limit of the structure.
      Returns:
      The block level limit.
    • getBlockReplacement

      public Map<org.bukkit.Material,​org.bukkit.Material> getBlockReplacement()
      Get the block replacement map.
      Returns:
      The block replacement map.
    • getReplacementBlocksDelay

      public double getReplacementBlocksDelay()
      Get the replacement block delay.
      Returns:
      The replacement block delay.
    • setReplacementBlocksDelay

      public void setReplacementBlocksDelay(double value)
      Set the replacement block delay.
      Parameters:
      value - The replacement block delay.
    • getWorldHeightRestriction

      public int getWorldHeightRestriction()
      Get the World Height Restriction.
      Returns:
      The world height restriction.
    • setWorldHeightRestriction

      public void setWorldHeightRestriction(int structureHeight)
      Set the World Height Restriction property.
      Parameters:
      structureHeight - The structure height.