[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 106a44d3a0
commit e0a7996885
1 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,7 @@ public class EssentialsEcoPlayerListener extends PlayerListener
{
int amount = Integer.parseInt(sign.getLine(1));
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)
{
throw new Exception(Util.i18n("notEnoughMoney"));
@ -70,7 +70,8 @@ public class EssentialsEcoPlayerListener extends PlayerListener
{
int amount = Integer.parseInt(sign.getLine(1));
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))
{
throw new Exception(Util.format("missingItems", amount, sign.getLine(2)));