Class AdvancedSubSchematics
java.lang.Object
com.ryandw11.structure.structure.properties.AdvancedSubSchematics
The advanced SubSchematic feature.
-
Constructor Summary
ConstructorDescriptionAdvancedSubSchematics(boolean enabled)
Construct the AdvancedSubSchematic feature programmatically.AdvancedSubSchematics(@NotNull org.bukkit.configuration.file.FileConfiguration configuration, @NotNull CustomStructures plugin)
Get the sub schematics from a configuration file. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCategory(String name, RandomCollection<SubSchematic> schematics)
Add a category to the advanced sub schematic section.void
addSchematicToCategory(String categoryName, SubSchematic subSchematic)
Add a sub-schematic to a category.boolean
containsCategory(String name)
Check if a category exists.getCategory(String name)
Get a category.Get a list with the names of every category.Get the list of sub schematics.boolean
If sub schematics are enabled.void
setEnabled(boolean enabled)
Only enable this via code if you are certain the formatting is right with the schematic list.
-
Constructor Details
-
AdvancedSubSchematics
public AdvancedSubSchematics(@NotNull @NotNull org.bukkit.configuration.file.FileConfiguration configuration, @NotNull @NotNull CustomStructures plugin)Get the sub schematics from a configuration file.- Parameters:
configuration
- The configuration file.plugin
- The instance of custom structures. (CustomStructures.getInstance()).
-
AdvancedSubSchematics
public AdvancedSubSchematics(boolean enabled)Construct the AdvancedSubSchematic feature programmatically.- Parameters:
enabled
- If this feature should be enabled.
-
-
Method Details
-
isEnabled
public boolean isEnabled()If sub schematics are enabled.- Returns:
- If sub schematics are enabled.
-
setEnabled
public void setEnabled(boolean enabled)Only enable this via code if you are certain the formatting is right with the schematic list. The plugin does no additional checks after the construction of the object.- Parameters:
enabled
- If you want the feature to be enabled.
-
getSchematicCategories
Get the list of sub schematics.- Returns:
- The list of sub schematics.
-
getCategory
Get a category.- Parameters:
name
- The name of the category to get.- Returns:
- The category.
-
containsCategory
Check if a category exists.- Parameters:
name
- The name of the category to check.- Returns:
- If the category exists.
-
getCategoryNames
Get a list with the names of every category.- Returns:
- The list with the names of every category.
-
addCategory
Add a category to the advanced sub schematic section.- Parameters:
name
- The name of the category to add.schematics
- The random collection of sub-schematics.
-
addSchematicToCategory
Add a sub-schematic to a category.- Parameters:
categoryName
- The category the sub-schematic should belong to.subSchematic
- The sub-schematic with weight specified.- Throws:
IllegalArgumentException
- If the specified category does not exist or the sub-schematic weight is zero.
-