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

51 lines
1.3 KiB
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-13 01:56:31 +00:00
GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 100, ChatColor.GREEN, true),
THOR_STAR("Thor's Star", Material.NETHER_STAR, 10000, ChatColor.LIGHT_PURPLE, true),
ELECTRICAL_DIAMOND_SWORD("Electrical Diamond Sword", Material.DIAMOND_SWORD, 0, ChatColor.YELLOW, false),
SUPERIOR_SWORD("Superior Sword", Material.GOLDEN_SWORD, 0, ChatColor.GOLD, false);
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-13 01:56:31 +00:00
@Getter
private final boolean purchaseable;
2020-01-07 20:13:59 +00:00
2020-01-13 01:56:31 +00:00
ShopItem(String name, Material material, int cost, ChatColor color, boolean purchaseable)
2020-01-07 20:13:59 +00:00
{
this.name = name;
this.material = material;
this.cost = cost;
this.color = color;
2020-01-13 01:56:31 +00:00
this.purchaseable = purchaseable;
2020-01-07 20:13:59 +00:00
}
public String getColoredName()
{
return color + name;
}
public static ShopItem findItem(String string)
{
try
{
return ShopItem.valueOf(string.toUpperCase());
}
catch (Exception ignored)
{
}
return null;
}
}