1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-02 20:57:32 +02:00

[trunk] temp double fix, we should probably change doubles to decimals in prices

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1420 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
ementalo
2011-05-11 15:11:07 +00:00
parent 81dfdb102a
commit 3f45eb6d9b

View File

@@ -44,7 +44,7 @@ public class EssentialsEcoPlayerListener extends PlayerListener
{ {
int amount = Integer.parseInt(sign.getLine(1)); int amount = Integer.parseInt(sign.getLine(1));
ItemStack item = ItemDb.get(sign.getLine(2), amount); ItemStack item = ItemDb.get(sign.getLine(2), amount);
double cost = Double.parseDouble(sign.getLine(3).substring(1)); double cost = Double.parseDouble(sign.getLine(3).substring(1).replaceAll(",", "."));
if (user.getMoney() < cost) if (user.getMoney() < cost)
{ {
throw new Exception(Util.i18n("notEnoughMoney")); throw new Exception(Util.i18n("notEnoughMoney"));
@@ -70,7 +70,8 @@ public class EssentialsEcoPlayerListener extends PlayerListener
{ {
int amount = Integer.parseInt(sign.getLine(1)); int amount = Integer.parseInt(sign.getLine(1));
ItemStack item = ItemDb.get(sign.getLine(2), amount); ItemStack item = ItemDb.get(sign.getLine(2), amount);
double cost = Double.parseDouble(sign.getLine(3).substring(1)); double cost = Double.parseDouble(sign.getLine(3).substring(1).replaceAll(",", "."));
if (!InventoryWorkaround.containsItem(user.getInventory(), true, item)) if (!InventoryWorkaround.containsItem(user.getInventory(), true, item))
{ {
throw new Exception(Util.format("missingItems", amount, sign.getLine(2))); throw new Exception(Util.format("missingItems", amount, sign.getLine(2)));