Package dev.aurelium.slate.option
Class SlateOptionsBuilder
java.lang.Object
dev.aurelium.slate.option.SlateOptionsBuilder
Builder for creating
SlateOptions to pass to the Slate constructor.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theSlateOptionsobject.isMock(boolean isMock) itemMetaParser(String name, ItemMetaParser parser) Adds a custom item meta parser.itemMetaParsers(Map<String, ItemMetaParser> parsers) Adds multiple custom item meta parsers.keyedItemProvider(KeyedItemProvider keyedItemProvider) Sets the provider for keyed items.loreWrappingWidth(int loreWrappingWidth) Sets the number of characters in a line before lore wraps to the next line.mainDirectory(File mainDirectory) Sets the main directory where menu files are located.mergeDirectories(List<File> mergeDirectories) Sets the directories to merge with the main directory.removalProtection(boolean removalProtection)
-
Constructor Details
-
SlateOptionsBuilder
public SlateOptionsBuilder()
-
-
Method Details
-
mainDirectory
Sets the main directory where menu files are located. This is a required option. Only menu files that are present on the server will be loaded.- Parameters:
mainDirectory- the main directory- Returns:
- the builder
-
mergeDirectories
Sets the directories to merge with the main directory. Menu files in merge directories that match a file in the main directory will be merged together. New files in merge directories will be loaded as new menus.- Parameters:
mergeDirectories- the merge directories- Returns:
- the builder
-
loreWrappingWidth
Sets the number of characters in a line before lore wraps to the next line. This only applies to text lore that has wrap: true in the menu file. Default is 40.- Parameters:
loreWrappingWidth- the lore wrapping width- Returns:
- the builder
-
keyedItemProvider
Sets the provider for keyed items. This is used to provide complex ItemStack instances for items in the menu file that define a key option instead of a material.- Parameters:
keyedItemProvider- the keyed item provider- Returns:
- the builder
-
itemMetaParser
Adds a custom item meta parser. This is used to parse custom item meta options for base items in the menu file.- Parameters:
name- the config key of the node to parseparser- theItemMetaParserparser function- Returns:
- the builder
-
itemMetaParsers
Adds multiple custom item meta parsers. This is used to parse custom item meta options for base items in the menu file.- Parameters:
parsers- the map of config keys toItemMetaParserparser functions- Returns:
- the builder
-
removalProtection
-
isMock
-
build
Builds theSlateOptionsobject.- Returns:
- the slate options
-