Class SubsystemConfig<S extends AbstractSubsystem<?,S>>

All Implemented Interfaces:
ObservableConfig, ConfigurationMethods<ConfigurationSection>, ConfigurationSection
Direct Known Subclasses:
FeatureConfig, ModuleConfig

public abstract class SubsystemConfig<S extends AbstractSubsystem<?,S>> extends KamiConfigExt
  • Constructor Details

    • SubsystemConfig

      protected SubsystemConfig(@NotNull S subsystem, @NotNull @NotNull String resourcePath)
    • SubsystemConfig

      protected SubsystemConfig(@NotNull S subsystem, @NotNull @NotNull ConfigSource source, @NotNull @NotNull String resourcePath)
      Constructor for subsystems using ConfigSource (e.g. from a database or other source)
      Parameters:
      subsystem - The parent subsystem
      source - The config source where the yaml contents will be read from
      resourcePath - The resource path to the default config file inside the plugin jar
  • Method Details

    • getIS

      @NotNull public static @NotNull InputStream getIS(@NotNull @NotNull AbstractSubsystem<?,?> subsystem, @NotNull @NotNull String resourcePath)
      Helper method to get a resource InputStream from a subsystem's plugin.
    • getSubsystem

      @NotNull public S getSubsystem()
    • getLocation

      @NotNull public @NotNull Location getLocation(String key) throws IllegalArgumentException
      Reads a Location from the current config file using the standard location format.
      Parameters:
      key - The root key of the location in the config file, e.g. "spawn" which has subkeys: "spawn.x", "spawn.y", etc.
      Throws:
      IllegalArgumentException