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 20:00:22 +00:00
|
|
|
GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 100, ChatColor.GREEN);
|
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;
|
|
|
|
}
|
|
|
|
}
|