TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/shop/ShopItem.java

46 lines
1003 B
Java
Raw Normal View History

2020-01-07 20:13:59 +00:00
package me.totalfreedom.totalfreedommod.shop;
import lombok.Getter;
import org.bukkit.ChatColor;
import org.bukkit.Material;
public enum ShopItem
{
2020-01-08 23:00:15 +00:00
GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 100, ChatColor.GREEN),
THOR_STAR("Thor's Star", Material.NETHER_STAR, 10000, ChatColor.LIGHT_PURPLE);
2020-01-07 20:13:59 +00:00
@Getter
private final String name;
@Getter
private final Material material;
@Getter
private final int cost;
@Getter
private final ChatColor color;
2020-01-08 20:00:22 +00:00
ShopItem(String name, Material material, int cost, ChatColor color)
2020-01-07 20:13:59 +00:00
{
this.name = name;
this.material = material;
this.cost = cost;
this.color = color;
}
public String getColoredName()
{
return color + name;
}
public static ShopItem findItem(String string)
{
try
{
return ShopItem.valueOf(string.toUpperCase());
}
catch (Exception ignored)
{
}
return null;
}
}