Interface SchematicCache
public interface SchematicCache
A cache which provides schematics based on filters or other factors.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintGet directory countgetMatchingDirectories(Player player, String dir, int count) Returns a list of matching directories.getMatchingSchematics(Player player, String name, int count) Returns a list of matching schematics.getSchematicsByDirectory(Player player, String name, String filter) If a directory matches the full name, all schematics inside this directory will be returned directly.getSchematicsByName(Player player, String name) Get a list of schematics which match a name or regexvoidinit()Init method which will be executed when registered viaRegistry.register(Nameable, Object)voidreload()Reload all schematics of the cache.intGet schematic countdefault voidshutdown()Called when the plugin gets shutdown and the cache is unregistered.
-
Field Details
-
STORAGE
The nameable key for the default cache
-
-
Method Details
-
init
void init()Init method which will be executed when registered viaRegistry.register(Nameable, Object) -
reload
void reload()Reload all schematics of the cache. -
getSchematicsByName
Get a list of schematics which match a name or regex- Parameters:
player- playername- name which will be parsed to a regex.- Returns:
- A brush config builder with assigned schematics.
-
getSchematicsByDirectory
If a directory matches the full name, all schematics inside this directory will be returned directly.- Parameters:
player- the player requesting the schematicsname- name of the schematic. may be a regexfilter- additional filter which may be an regex- Returns:
- all schematics inside the directory
-
getMatchingDirectories
Returns a list of matching directories.- Parameters:
player- the player requesting the schematicsdir- string for lookupcount- amount of returned directories- Returns:
- list of directory names with size of count or shorter
-
getMatchingSchematics
Returns a list of matching schematics.- Parameters:
player- the player requesting the schematicsname- string for lookupcount- 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.
-