From e0a7996885728ba91e3b1081a705f526aad2f3b7 Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 11 May 2011 15:11:07 +0000 Subject: [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 --- .../src/com/earth2me/essentials/EssentialsEcoPlayerListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java index 9233a6074..4d31c2f1e 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java @@ -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))); -- cgit v1.2.3