Class MapScheme

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

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

    Modifier and Type
    Method
    Description
    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.
    void
    defineColor(String key, String colorHex)
    Defines a color used by the scheme if the scheme is not already finalized
    void
    defineFont(String key, MapFont defaultFont)
    Defines a font used by the scheme if the scheme is not already finalized.
    void
    Defines an image used by the scheme if the scheme is not already finalized.
    void
    defineImg(String key, String image)
    Defines an image used by the scheme if the scheme is not already finalized.
    void
    Finalizes the scheme and loads all other schemes
    static MapScheme
    get(org.bukkit.plugin.java.JavaPlugin plugin, String name)
    Retrieves a scheme for the plugin
    byte
    Retrieves a color for the scheme
    Retrieves a font from the scheme
    Retrieves an image from the scheme
    Retrieves the key for the scheme
    list(org.bukkit.plugin.java.JavaPlugin plugin)
    Retrieves a list of schemes for the plugin.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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