Class MapScheme

java.lang.Object
studio.magemonkey.codex.mccore.gui.MapScheme

public class MapScheme extends Object
A scheme used by a menu
  • Method Details

    • create

      public static MapScheme create(org.bukkit.plugin.java.JavaPlugin plugin, File root)
      Creates the schemes for the given plugin using the root folder as the place to load images for schemes from.
      Parameters:
      plugin - plugin reference
      root - the root folder for scheme images
      Returns:
      the created map scheme
    • get

      public static MapScheme get(org.bukkit.plugin.java.JavaPlugin plugin, String name)
      Retrieves a scheme for the plugin
      Parameters:
      plugin - plugin to get the scheme for
      name - name of the scheme
      Returns:
      the plugin's scheme or the default scheme if not found
    • list

      public static ArrayList<MapScheme> list(org.bukkit.plugin.java.JavaPlugin plugin)
      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

      public String getKey()
      Retrieves the key for the scheme
      Returns:
      scheme key
    • getImage

      public MapImage getImage(String key)
      Retrieves an image from the scheme
      Parameters:
      key - image key
      Returns:
      the image for the scheme
    • getFont

      public MapFont getFont(String key)
      Retrieves a font from the scheme
      Parameters:
      key - font key
      Returns:
      the font of the scheme
    • getColor

      public byte getColor(String key)
      Retrieves a color for the scheme
      Parameters:
      key - color key
      Returns:
      the color for the scheme
    • defineImg

      public void defineImg(String image)
      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

      public void defineImg(String key, String image)
      Defines an image used by the scheme if the scheme is not already finalized.
      Parameters:
      key - key to use for the image
      image - name of the embedded image resource to use
    • defineFont

      public void defineFont(String key, MapFont defaultFont)
      Defines a font used by the scheme if the scheme is not already finalized.
      Parameters:
      key - key to use for the font
      defaultFont - default font to use
    • defineColor

      public void defineColor(String key, String colorHex)
      Defines a color used by the scheme if the scheme is not already finalized
      Parameters:
      key - key to use for the color
      colorHex - hex code of the default color
    • finalize

      public void finalize()
      Finalizes the scheme and loads all other schemes
      Overrides:
      finalize in class Object