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 TypeMethodDescription@Nullable org.bukkit.configuration.ConfigurationSectiongetSection(@NotNull String path) Returns configuration section, or null - if not exists.voidLoads data from file.voidremoveExecutorBlock(@NotNull org.bukkit.block.Block block, boolean notDependsOnHeight) Removes executor block data from configuration file, if it exists.voidsaveActionBlock(@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.voidsaveArguments(@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.voidsaveExecutorBlock(@NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull ExecutorCategory category, @NotNull Executor executor) Saves executor block data in configuration file.voidsaveExecutorBlock(@NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull ExecutorCategory category, @NotNull Executor executor, boolean debug) Saves executor block data in configuration file.voidsaveToFile(@NotNull File file) Saves code to file.voidSets value in path.
-
Method Details
-
loadCode
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
-
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
Saves code to file.- Parameters:
file- file to save in.- Throws:
IOException
-