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

116 lines
3 KiB
Java
Raw Normal View History

2020-01-07 20:13:59 +00:00
package me.totalfreedom.totalfreedommod.shop;
2020-04-08 02:20:01 +00:00
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
2020-01-07 20:13:59 +00:00
import org.bukkit.ChatColor;
import org.bukkit.Material;
public enum ShopItem
{
GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 10, ConfigEntry.SHOP_PRICES_GRAPPLING_HOOK, ChatColor.GREEN, "grapplingHook", "/grapplinghook"),
LIGHTNING_ROD("Lightning Rod", Material.BLAZE_ROD, 12, ConfigEntry.SHOP_PRICES_LIGHTNING_ROD, ChatColor.LIGHT_PURPLE, "lightningRod", "/lightningrod"),
FIRE_BALL("Fire Ball", Material.FIRE_CHARGE, 14, ConfigEntry.SHOP_PRICES_FIRE_BALL, ChatColor.RED, "fireBall", "/fireball"),
RIDEABLE_PEARL("Rideable Ender Pearl", Material.ENDER_PEARL, 16, ConfigEntry.SHOP_PRICES_RIDEABLE_PEARL, ChatColor.DARK_PURPLE, "rideablePearl", "/rideablepearl"),
2021-09-03 19:53:33 +00:00
STACKING_POTATO("Stacking Potato", Material.POTATO, 19, ConfigEntry.SHOP_PRICES_STACKING_POTATO, ChatColor.YELLOW, "stackingPotato", "/stackingpotato"),
CLOWN_FISH("Clown Fish", Material.TROPICAL_FISH, 21, ConfigEntry.SHOP_PRICES_CLOWN_FISH, ChatColor.GOLD, "clownFish", "/clownfish"),
LOGIN_MESSAGES("Login Messages", Material.NAME_TAG, 23, ConfigEntry.SHOP_PRICES_LOGIN_MESSAGES, ChatColor.DARK_GREEN, "loginMessages", "/loginmessage"),
RAINBOW_TRAIL("Rainbow Trail", Material.RED_WOOL, 25, ConfigEntry.SHOP_PRICES_RAINBOW_TRAIL, ChatColor.DARK_RED, "rainbowTrail", "/trail");
2020-04-08 02:20:01 +00:00
/*
Shop GUI Layout:
Dimensions: 9x4 = 36
2021-09-03 19:53:33 +00:00
Key:
g = Grappling Hook,
l = Lightning Rod
f = Fire Ball
r = Rideable Ender Pearl
s = Stacking Potato
c = Clown Fish
x = Login Messages
t = Rainbow Trail
$ = Coins
2020-04-08 02:20:01 +00:00
---------
-g-l-f-r-
2021-09-03 19:53:33 +00:00
-s-c-x-t-
2020-04-08 02:20:01 +00:00
--------$
*/
2020-01-07 20:13:59 +00:00
2020-01-07 20:13:59 +00:00
private final String name;
2020-04-08 02:20:01 +00:00
private final Material icon;
2020-04-08 02:20:01 +00:00
private final int slot;
private final ConfigEntry cost;
2020-01-07 20:13:59 +00:00
private final ChatColor color;
2020-04-08 02:20:01 +00:00
private final String dataName;
private final String command;
2020-01-07 20:13:59 +00:00
ShopItem(String name, Material icon, int slot, ConfigEntry cost, ChatColor color, String dataName, String command)
2020-01-07 20:13:59 +00:00
{
this.name = name;
2020-04-08 02:20:01 +00:00
this.icon = icon;
this.slot = slot;
2020-01-07 20:13:59 +00:00
this.cost = cost;
this.color = color;
2020-04-08 02:20:01 +00:00
this.dataName = dataName;
this.command = command;
2020-01-07 20:13:59 +00:00
}
public static ShopItem findItem(String string)
{
try
{
return ShopItem.valueOf(string.toUpperCase());
}
catch (Exception ignored)
{
}
return null;
}
2020-01-07 20:13:59 +00:00
public String getColoredName()
{
return color + name;
}
2020-04-08 02:20:01 +00:00
public int getCost()
{
return cost.getInteger();
}
public String getName()
2020-01-07 20:13:59 +00:00
{
return name;
}
2020-01-07 20:13:59 +00:00
public Material getIcon()
{
return icon;
}
public int getSlot()
{
return slot;
}
public ChatColor getColor()
{
return color;
}
public String getDataName()
{
return dataName;
}
public String getCommand()
{
return command;
2020-01-07 20:13:59 +00:00
}
}