Class AdvancedSubSchematics

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

public class AdvancedSubSchematics extends Object
The advanced SubSchematic feature.
  • 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

      public Map<String,​RandomCollection<SubSchematic>> getSchematicCategories()
      Get the list of sub schematics.
      Returns:
      The list of sub schematics.
    • getCategory

      public RandomCollection<SubSchematic> getCategory(String name)
      Get a category.
      Parameters:
      name - The name of the category to get.
      Returns:
      The category.
    • containsCategory

      public boolean containsCategory(String name)
      Check if a category exists.
      Parameters:
      name - The name of the category to check.
      Returns:
      If the category exists.
    • getCategoryNames

      public List<String> getCategoryNames()
      Get a list with the names of every category.
      Returns:
      The list with the names of every category.
    • addCategory

      public void addCategory(String name, RandomCollection<SubSchematic> schematics)
      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

      public void addSchematicToCategory(String categoryName, SubSchematic subSchematic)
      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.