2020-01-07 20:13:59 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.shop;
|
|
|
|
|
|
|
|
import lombok.Getter;
|
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
|
|
|
|
{
|
2020-07-07 08:36:29 +00:00
|
|
|
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"),
|
2020-07-09 22:18:29 +00:00
|
|
|
STACKING_POTATO("Stacking Potato", Material.POTATO, 20, ConfigEntry.SHOP_PRICES_STACKING_POTATO, ChatColor.YELLOW, "stackingPotato", "/stackingpotato"),
|
2020-10-02 09:27:06 +00:00
|
|
|
CLOWN_FISH("Clown Fish", Material.TROPICAL_FISH, 22, ConfigEntry.SHOP_PRICES_CLOWN_FISH, ChatColor.GOLD, "clownFish", "/clownfish"),
|
|
|
|
LOGIN_MESSAGES("Login Messages", Material.NAME_TAG, 24, ConfigEntry.SHOP_PRICES_LOGIN_MESSAGES, ChatColor.DARK_GREEN, "loginMessages", "/loginmessage");
|
2020-04-08 02:20:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Shop GUI Layout:
|
|
|
|
|
|
|
|
Dimensions: 9x4 = 36
|
2020-10-02 09:27:06 +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 $ = Coins}
|
2020-04-08 02:20:01 +00:00
|
|
|
|
|
|
|
---------
|
|
|
|
-g-l-f-r-
|
2020-10-02 09:27:06 +00:00
|
|
|
--s-c-x--
|
2020-04-08 02:20:01 +00:00
|
|
|
--------$
|
|
|
|
*/
|
2020-01-07 20:13:59 +00:00
|
|
|
|
|
|
|
@Getter
|
|
|
|
private final String name;
|
|
|
|
@Getter
|
2020-04-08 02:20:01 +00:00
|
|
|
private final Material icon;
|
2020-01-07 20:13:59 +00:00
|
|
|
@Getter
|
2020-04-08 02:20:01 +00:00
|
|
|
private final int slot;
|
|
|
|
private final ConfigEntry cost;
|
2020-01-07 20:13:59 +00:00
|
|
|
@Getter
|
|
|
|
private final ChatColor color;
|
2020-01-13 01:56:31 +00:00
|
|
|
@Getter
|
2020-04-08 02:20:01 +00:00
|
|
|
private final String dataName;
|
2020-07-07 08:36:29 +00:00
|
|
|
@Getter
|
|
|
|
private final String command;
|
2020-01-07 20:13:59 +00:00
|
|
|
|
2020-07-07 08:36:29 +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;
|
2020-07-07 08:36:29 +00:00
|
|
|
this.command = command;
|
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();
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|