package info.tregmine.api.lore;

import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public enum Created {
    MINED(ChatColor.GREEN + "MINED"), SPAWNED(ChatColor.RED + "SPAWNED"), FILLED(
            ChatColor.RED + "FILLED"), PURCHASED(ChatColor.AQUA + "PURCHASED"), UNKOWN(
            "UNKNOWN"), CREATIVE(ChatColor.YELLOW + "CREATIVE");

    private String colorString = null;

    private Created(String text)
    {
        this.colorString = text;
    }

    public String toColorString()
    {
        return colorString;
    }

    public static Created valueOf(ItemStack stack)
    {
        if (stack == null) {
            return Created.UNKOWN;
        }

        ItemMeta meta = stack.getItemMeta();
        List<String> lore = meta.getLore();

        if (lore == null || lore.get(0) == null) {
            return Created.UNKOWN;
        }

        if (lore.get(0).matches(Created.CREATIVE.colorString)) {
            return Created.CREATIVE;
        }

        if (lore.get(0).matches(Created.FILLED.colorString)) {
            return Created.FILLED;
        }

        if (lore.get(0).matches(Created.SPAWNED.colorString)) {
            return Created.SPAWNED;
        }

        if (lore.get(0).matches(Created.MINED.colorString)) {
            return Created.MINED;
        }

        return Created.UNKOWN;
    }

}

@@ -181,17 +181,17 @@
  Created
- 
+%0A
 %7B%0A    MI
@@ -221,16 +221,20 @@
 MINED%22),
+%0A   
  SPAWNED
@@ -265,16 +265,20 @@
 D%22),
+%0A   
  FILLED(
 %0A   
@@ -273,29 +273,16 @@
  FILLED(
-%0A            
 ChatColo
@@ -299,16 +299,20 @@
 ILLED%22),
+%0A   
  PURCHAS
@@ -348,16 +348,20 @@
 D%22),
+%0A   
  UNKOWN(
 %0A   
@@ -356,29 +356,16 @@
  UNKOWN(
-%0A            
 %22UNKNOWN
@@ -367,16 +367,20 @@
 KNOWN%22),
+%0A   
  CREATIV
@@ -867,22 +867,19 @@
 ore.
-get(0
+size(
 ) == 
-null
+0
 ) %7B%0A
@@ -928,39 +928,61 @@
  %7D%0A%0A        
-if (lore.get(0)
+String s = lore.get(0);%0A        if (s
 .matches(Cre
@@ -1061,33 +1061,19 @@
    %7D
-%0A%0A        if (lore.get(0)
+ else if (s
 .mat
@@ -1156,33 +1156,19 @@
    %7D
-%0A%0A        if (lore.get(0)
+ else if (s
 .mat
@@ -1253,33 +1253,19 @@
    %7D
-%0A%0A        if (lore.get(0)
+ else if (s
 .mat

Clean up of Created.java