From 500492767285a88ab23989ce51335e4ffc21f323 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 17 Nov 2016 17:24:01 +1100 Subject: [PATCH] SPIGOT-2768: Fully implement map color By: md_5 --- .../org/bukkit/inventory/meta/MapMeta.java | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java index 4dbe95d562..a0e601429b 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java @@ -1,5 +1,7 @@ package org.bukkit.inventory.meta; +import org.bukkit.Color; + /** * Represents a map that can be scalable. */ @@ -37,11 +39,38 @@ public interface MapMeta extends ItemMeta { String getLocationName(); /** - * Sets the location name. + * Sets the location name. A custom map color will alter the display of the + * map in an inventory slot. * * @param name the name to set */ void setLocationName(String name); + /** + * Checks for existence of a map color. + * + * @return true if this has a custom map color + */ + boolean hasColor(); + + /** + * Gets the map color that is set. A custom map color will alter the display + * of the map in an inventory slot. + *

+ * Plugins should check that hasColor() returns true before + * calling this method. + * + * @return the map color that is set + */ + Color getColor(); + + /** + * Sets the map color. A custom map color will alter the display of the map + * in an inventory slot. + * + * @param color the color to set + */ + void setColor(Color color); + MapMeta clone(); }