mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 13:33:54 +00:00
ivan u never commit
This commit is contained in:
@ -82,11 +82,7 @@ public class ShopData implements ConfigLoadable, ConfigSavable, Validatable
|
||||
|
||||
public String giveItem(ShopItem item)
|
||||
{
|
||||
String signature = String.valueOf(item.ordinal());
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
signature += FUtil.getRandomCharacter();
|
||||
}
|
||||
String signature = FUtil.generateSignature(item);
|
||||
items.add(signature);
|
||||
return signature;
|
||||
}
|
||||
@ -103,7 +99,7 @@ public class ShopData implements ConfigLoadable, ConfigSavable, Validatable
|
||||
int id;
|
||||
try
|
||||
{
|
||||
id = Integer.valueOf(i.substring(0, 1));
|
||||
id = Integer.valueOf(i.substring(0, i.indexOf("A")));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
@ -122,7 +118,15 @@ public class ShopData implements ConfigLoadable, ConfigSavable, Validatable
|
||||
String signature = "";
|
||||
for (String i : items)
|
||||
{
|
||||
int id = Integer.valueOf(i.substring(0, 1));
|
||||
int id;
|
||||
try
|
||||
{
|
||||
id = Integer.valueOf(i.substring(0, i.indexOf("A")));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (item.ordinal() == id)
|
||||
{
|
||||
signature = i;
|
||||
|
@ -6,8 +6,10 @@ import org.bukkit.Material;
|
||||
|
||||
public enum ShopItem
|
||||
{
|
||||
GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 100, ChatColor.GREEN),
|
||||
THOR_STAR("Thor's Star", Material.NETHER_STAR, 10000, ChatColor.LIGHT_PURPLE);
|
||||
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);
|
||||
|
||||
@Getter
|
||||
private final String name;
|
||||
@ -17,13 +19,16 @@ public enum ShopItem
|
||||
private final int cost;
|
||||
@Getter
|
||||
private final ChatColor color;
|
||||
@Getter
|
||||
private final boolean purchaseable;
|
||||
|
||||
ShopItem(String name, Material material, int cost, ChatColor color)
|
||||
ShopItem(String name, Material material, int cost, ChatColor color, boolean purchaseable)
|
||||
{
|
||||
this.name = name;
|
||||
this.material = material;
|
||||
this.cost = cost;
|
||||
this.color = color;
|
||||
this.purchaseable = purchaseable;
|
||||
}
|
||||
|
||||
public String getColoredName()
|
||||
|
Reference in New Issue
Block a user