Interface CodeStorage

All Known Implementing Classes:
CodeConfiguration

public interface CodeStorage

CodeStorage

This class represents a storage, that stores planet's code.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable org.bukkit.configuration.ConfigurationSection
    getSection(@NotNull String path)
    Returns configuration section, or null - if not exists.
    void
    loadCode(@NotNull File file)
    Loads data from file.
    void
    removeExecutorBlock(@NotNull org.bukkit.block.Block block, boolean notDependsOnHeight)
    Removes executor block data from configuration file, if it exists.
    void
    saveActionBlock(@NotNull org.bukkit.block.Block executorBlock, boolean notDependsOnHeight, @NotNull List<String> multiActions, @NotNull org.bukkit.block.Block actionBlock, @NotNull ActionCategory category, @NotNull ActionType type, @NotNull Target target)
    Saves action block data in configuration file.
    void
    saveArguments(@NotNull org.bukkit.block.Block executorBlock, boolean notDependsOnHeight, @NotNull List<String> multiActions, @NotNull org.bukkit.block.Block actionBlock, @NotNull String argument, @Nullable Object value, @NotNull ValueType type)
    Saves arguments for action block in configuration file.
    void
    saveExecutorBlock(@NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull ExecutorCategory category, @NotNull Executor executor)
    Saves executor block data in configuration file.
    void
    saveExecutorBlock(@NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull ExecutorCategory category, @NotNull Executor executor, boolean debug)
    Saves executor block data in configuration file.
    void
    saveToFile(@NotNull File file)
    Saves code to file.
    void
    set(@NotNull String path, @Nullable Object value)
    Sets value in path.
  • Method Details

    • loadCode

      void loadCode(@NotNull @NotNull File file)
      Loads data from file.

      Any errors loading the Configuration will be logged and then ignored. If the specified input is not a valid config, a blank config will be returned.

      The encoding used may follow the system dependent default.

      Parameters:
      file - Input file
    • removeExecutorBlock

      void removeExecutorBlock(@NotNull @NotNull org.bukkit.block.Block block, boolean notDependsOnHeight)
      Removes executor block data from configuration file, if it exists.
      Parameters:
      block - executor coding block.
      notDependsOnHeight - whether its horizontal or vertical platformer.
    • saveExecutorBlock

      void saveExecutorBlock(@NotNull @NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull @NotNull ExecutorCategory category, @NotNull @NotNull Executor executor, boolean debug)
      Saves executor block data in configuration file.
      Parameters:
      block - executor coding block.
      category - category of executor.
      executor - executor.
      debug - should print debug logs or not.
    • saveExecutorBlock

      void saveExecutorBlock(@NotNull @NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull @NotNull ExecutorCategory category, @NotNull @NotNull Executor executor)
      Saves executor block data in configuration file.
      Parameters:
      block - executor coding block.
      category - category of executor.
      executor - executor.
    • saveActionBlock

      void saveActionBlock(@NotNull @NotNull org.bukkit.block.Block executorBlock, boolean notDependsOnHeight, @NotNull @NotNull List<String> multiActions, @NotNull @NotNull org.bukkit.block.Block actionBlock, @NotNull @NotNull ActionCategory category, @NotNull @NotNull ActionType type, @NotNull @NotNull Target target)
      Saves action block data in configuration file.
      Parameters:
      multiActions - list of multi actions.
      actionBlock - action coding block.
      category - category of action.
      type - type of action.
      target - target for action.
    • saveArguments

      void saveArguments(@NotNull @NotNull org.bukkit.block.Block executorBlock, boolean notDependsOnHeight, @NotNull @NotNull List<String> multiActions, @NotNull @NotNull org.bukkit.block.Block actionBlock, @NotNull @NotNull String argument, @Nullable @Nullable Object value, @NotNull @NotNull ValueType type)
      Saves arguments for action block in configuration file.
      Parameters:
      multiActions - list of multi actions.
      actionBlock - action block to set arguments.
      argument - argument to set.
      value - value of argument.
      type - value type.
    • set

      void set(@NotNull @NotNull String path, @Nullable @Nullable Object value)
      Sets value in path.
      Parameters:
      path - path for value.
      value - new value.
    • getSection

      @Nullable @Nullable org.bukkit.configuration.ConfigurationSection getSection(@NotNull @NotNull String path)
      Returns configuration section, or null - if not exists.
      Parameters:
      path - path of section.
      Returns:
      configuration section, or null.
    • saveToFile

      void saveToFile(@NotNull @NotNull File file) throws IOException
      Saves code to file.
      Parameters:
      file - file to save in.
      Throws:
      IOException