Class CodeConfiguration
java.lang.Object
org.bukkit.configuration.MemorySection
org.bukkit.configuration.MemoryConfiguration
org.bukkit.configuration.file.FileConfiguration
org.bukkit.configuration.file.YamlConfiguration
ua.mcchickenstudio.opencreative.coding.CodeConfiguration
- All Implemented Interfaces:
org.bukkit.configuration.Configuration, org.bukkit.configuration.ConfigurationSection, CodeStorage
public class CodeConfiguration
extends org.bukkit.configuration.file.YamlConfiguration
implements CodeStorage
CodeConfiguration
This class represents a code configuration, that has methods to save executor and action blocks.-
Field Summary
Fields inherited from class org.bukkit.configuration.file.YamlConfiguration
BLANK_CONFIG, COMMENT_PREFIXFields inherited from class org.bukkit.configuration.MemoryConfiguration
defaults, optionsFields inherited from class org.bukkit.configuration.MemorySection
map -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetBlockNumber(org.bukkit.block.Block block) @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.Methods inherited from class org.bukkit.configuration.file.YamlConfiguration
loadConfiguration, loadConfiguration, loadFromString, options, saveToStringMethods inherited from class org.bukkit.configuration.file.FileConfiguration
buildHeader, load, load, load, save, saveMethods inherited from class org.bukkit.configuration.MemoryConfiguration
addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultsMethods inherited from class org.bukkit.configuration.MemorySection
contains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, set, setComments, setInlineComments, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CodeStorage
setMethods inherited from interface org.bukkit.configuration.ConfigurationSection
getComponent, getComponent, getRichMessage, getRichMessage, setComponent, setRichMessage
-
Constructor Details
-
CodeConfiguration
public CodeConfiguration()
-
-
Method Details
-
loadCode
Description copied from interface:CodeStorageLoads 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.
- Specified by:
loadCodein interfaceCodeStorage- Parameters:
file- Input file
-
removeExecutorBlock
public void removeExecutorBlock(@NotNull @NotNull org.bukkit.block.Block block, boolean notDependsOnHeight) Description copied from interface:CodeStorageRemoves executor block data from configuration file, if it exists.- Specified by:
removeExecutorBlockin interfaceCodeStorage- Parameters:
block- executor coding block.notDependsOnHeight- whether its horizontal or vertical platformer.
-
saveExecutorBlock
public void saveExecutorBlock(@NotNull @NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull @NotNull ExecutorCategory category, @NotNull @NotNull Executor executor, boolean debug) Description copied from interface:CodeStorageSaves executor block data in configuration file.- Specified by:
saveExecutorBlockin interfaceCodeStorage- Parameters:
block- executor coding block.category- category of executor.executor- executor.debug- should print debug logs or not.
-
saveExecutorBlock
public void saveExecutorBlock(@NotNull @NotNull org.bukkit.block.Block block, boolean notDependsOnHeight, @NotNull @NotNull ExecutorCategory category, @NotNull @NotNull Executor executor) Description copied from interface:CodeStorageSaves executor block data in configuration file.- Specified by:
saveExecutorBlockin interfaceCodeStorage- Parameters:
block- executor coding block.category- category of executor.executor- executor.
-
saveActionBlock
public 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) Description copied from interface:CodeStorageSaves action block data in configuration file.- Specified by:
saveActionBlockin interfaceCodeStorage- Parameters:
multiActions- list of multi actions.actionBlock- action coding block.category- category of action.type- type of action.target- target for action.
-
saveArguments
public 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) Description copied from interface:CodeStorageSaves arguments for action block in configuration file.- Specified by:
saveArgumentsin interfaceCodeStorage- Parameters:
multiActions- list of multi actions.actionBlock- action block to set arguments.argument- argument to set.value- value of argument.type- value type.
-
saveToFile
Description copied from interface:CodeStorageSaves code to file.- Specified by:
saveToFilein interfaceCodeStorage- Parameters:
file- file to save in.- Throws:
IOException
-
getSection
@Nullable public @Nullable org.bukkit.configuration.ConfigurationSection getSection(@NotNull @NotNull String path) Description copied from interface:CodeStorageReturns configuration section, or null - if not exists.- Specified by:
getSectionin interfaceCodeStorage- Parameters:
path- path of section.- Returns:
- configuration section, or null.
-
getBlockNumber
public int getBlockNumber(org.bukkit.block.Block block)
-