Class StructureLimitations
java.lang.Object
com.ryandw11.structure.structure.properties.StructureLimitations
This class represents the StructureLimitations configuration section of a structure.
-
Constructor Summary
ConstructorDescriptionStructureLimitations(List<String> whitelistSpawnBlocks, List<String> blacklistSpawnBlocks, BlockLevelLimit blockLevelLimit, Map<org.bukkit.Material,org.bukkit.Material> blockReplacement)
Create structure limitations without a config.StructureLimitations(org.bukkit.configuration.file.FileConfiguration configuration)
Create structure limitations from a file. -
Method Summary
Modifier and TypeMethodDescriptionGet the blacklisted blocks.The block level limit of the structure.Map<org.bukkit.Material,org.bukkit.Material>
Get the block replacement map.int
Get the iteration limit for the structure.double
Get the replacement block delay.Get the whitelisted blocks.int
Get the World Height Restriction.boolean
hasBlacklistBlock(org.bukkit.block.Block b)
Check to see if the blacklist has a block.boolean
hasWhitelistBlock(org.bukkit.block.Block b)
Check to see if the whitelist has a block.void
setIterationLimit(int iterationLimit)
Set the iteration limit for the structure.void
setReplacementBlocksDelay(double value)
Set the replacement block delay.void
setWorldHeightRestriction(int structureHeight)
Set the World Height Restriction property.
-
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
Get the whitelisted blocks.- Returns:
- The whitelisted blocks.
-
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
The block level limit of the structure.- Returns:
- The block level limit.
-
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.
-