Interface SchematicCache


public interface SchematicCache
A cache which provides schematics based on filters or other factors.
  • Field Details

    • STORAGE

      static final Nameable STORAGE
      The nameable key for the default cache
  • Method Details

    • init

      void init()
      Init method which will be executed when registered via Registry.register(Nameable, Object)
    • reload

      void reload()
      Reload all schematics of the cache.
    • getSchematicsByName

      Set<Schematic> getSchematicsByName(Player player, String name)
      Get a list of schematics which match a name or regex
      Parameters:
      player - player
      name - name which will be parsed to a regex.
      Returns:
      A brush config builder with assigned schematics.
    • getSchematicsByDirectory

      Set<Schematic> getSchematicsByDirectory(Player player, String name, String filter)
      If a directory matches the full name, all schematics inside this directory will be returned directly.
      Parameters:
      player - the player requesting the schematics
      name - name of the schematic. may be a regex
      filter - additional filter which may be an regex
      Returns:
      all schematics inside the directory
    • getMatchingDirectories

      List<String> getMatchingDirectories(Player player, String dir, int count)
      Returns a list of matching directories.
      Parameters:
      player - the player requesting the schematics
      dir - string for lookup
      count - amount of returned directories
      Returns:
      list of directory names with size of count or shorter
    • getMatchingSchematics

      List<String> getMatchingSchematics(Player player, String name, int count)
      Returns a list of matching schematics.
      Parameters:
      player - the player requesting the schematics
      name - string for lookup
      count - amount of returned schematics
      Returns:
      list of schematics names with size of count or shorter
    • schematicCount

      int schematicCount()
      Get schematic count
      Returns:
      schematic count
    • directoryCount

      int directoryCount()
      Get directory count
      Returns:
      directory count
    • shutdown

      default void shutdown()
      Called when the plugin gets shutdown and the cache is unregistered.