public class PaletteManager
extends java.lang.Object
MinimapPalette
for Minimap
.Modifier and Type | Class and Description |
---|---|
static class |
PaletteManager.ColorType
Contains different ways to write a color.
|
Modifier and Type | Field and Description |
---|---|
protected CartographerLogger |
logger |
protected java.util.Map<java.lang.String,MinimapPalette> |
palettes |
protected Cartographer |
plugin |
Constructor and Description |
---|
PaletteManager(Cartographer plugin)
Only one PaletteManager is recommended.
|
Modifier and Type | Method and Description |
---|---|
MinimapPalette |
construct(java.util.List<java.lang.String> palettes)
Construct a new
MinimapPalette from a list of palette ids. |
CartographerLogger |
getLogger() |
MinimapPalette |
load(org.bukkit.configuration.file.FileConfiguration config)
Create a
MinimapPalette from the config provided. |
void |
register(java.lang.String name,
MinimapPalette palette)
Register a new
MinimapPalette . |
void |
save(MinimapPalette palette,
org.bukkit.configuration.file.FileConfiguration config,
PaletteManager.ColorType format)
Save the given
MinimapPalette to file with the PaletteManager.ColorType indicated. |
java.lang.String |
toString(java.awt.Color color,
PaletteManager.ColorType type)
Convert a color to a string.
|
java.lang.String |
toString(int color,
PaletteManager.ColorType type)
Convert an integer color to a string.
|
protected Cartographer plugin
protected java.util.Map<java.lang.String,MinimapPalette> palettes
protected CartographerLogger logger
public PaletteManager(Cartographer plugin)
Cartographer.getPaletteManager()
.plugin
- Requires a Cartographer plugin.public void register(java.lang.String name, MinimapPalette palette)
MinimapPalette
. Will overwrite any existing one with the same id.name
- Cannot be null.palette
- Cannot be null.public MinimapPalette construct(java.util.List<java.lang.String> palettes)
MinimapPalette
from a list of palette ids.palettes
- A non null list of ids.public MinimapPalette load(org.bukkit.configuration.file.FileConfiguration config)
MinimapPalette
from the config provided.config
- Cannot be null, and has to follow a MinimapPalette
format.MinimapPalette
.public void save(MinimapPalette palette, org.bukkit.configuration.file.FileConfiguration config, PaletteManager.ColorType format)
MinimapPalette
to file with the PaletteManager.ColorType
indicated.palette
- The MinimapPalette
to save. Cannot be null.config
- The config to save to. Cannot be null.format
- The ColorType to use. Cannot be null.public java.lang.String toString(int color, PaletteManager.ColorType type)
color
- The integer color.type
- The format to use. Cannot be null.PaletteManager.ColorType
pattern.public java.lang.String toString(java.awt.Color color, PaletteManager.ColorType type)
color
- Cannot be null.type
- The format to use. Cannot be null.PaletteManager.ColorType
pattern.public CartographerLogger getLogger()