Class MapScheme
java.lang.Object
studio.magemonkey.codex.mccore.gui.MapScheme
A scheme used by a menu
-
Method Summary
Modifier and TypeMethodDescriptionstatic MapSchemeCreates the schemes for the given plugin using the root folder as the place to load images for schemes from.voiddefineColor(String key, String colorHex) Defines a color used by the scheme if the scheme is not already finalizedvoiddefineFont(String key, MapFont defaultFont) Defines a font used by the scheme if the scheme is not already finalized.voidDefines an image used by the scheme if the scheme is not already finalized.voidDefines an image used by the scheme if the scheme is not already finalized.voidfinalize()Finalizes the scheme and loads all other schemesstatic MapSchemeRetrieves a scheme for the pluginbyteRetrieves a color for the schemeRetrieves a font from the schemeRetrieves an image from the schemegetKey()Retrieves the key for the schemelist(org.bukkit.plugin.java.JavaPlugin plugin) Retrieves a list of schemes for the plugin.
-
Method Details
-
create
Creates the schemes for the given plugin using the root folder as the place to load images for schemes from.- Parameters:
plugin- plugin referenceroot- the root folder for scheme images- Returns:
- the created map scheme
-
get
Retrieves a scheme for the plugin- Parameters:
plugin- plugin to get the scheme forname- name of the scheme- Returns:
- the plugin's scheme or the default scheme if not found
-
list
Retrieves a list of schemes for the plugin. If the plugin never set up a scheme, this will return an empty list instead.- Parameters:
plugin- plugin schemes- Returns:
- list of schemes for the plugin
-
getKey
Retrieves the key for the scheme- Returns:
- scheme key
-
getImage
Retrieves an image from the scheme- Parameters:
key- image key- Returns:
- the image for the scheme
-
getFont
Retrieves a font from the scheme- Parameters:
key- font key- Returns:
- the font of the scheme
-
getColor
Retrieves a color for the scheme- Parameters:
key- color key- Returns:
- the color for the scheme
-
defineImg
Defines an image used by the scheme if the scheme is not already finalized. The image name will be used as the access key.- Parameters:
image- name of the embedded image resource to use
-
defineImg
Defines an image used by the scheme if the scheme is not already finalized.- Parameters:
key- key to use for the imageimage- name of the embedded image resource to use
-
defineFont
Defines a font used by the scheme if the scheme is not already finalized.- Parameters:
key- key to use for the fontdefaultFont- default font to use
-
defineColor
Defines a color used by the scheme if the scheme is not already finalized- Parameters:
key- key to use for the colorcolorHex- hex code of the default color
-
finalize
public void finalize()Finalizes the scheme and loads all other schemes
-