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:
@@ -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)));
|
||||||
|
Reference in New Issue
Block a user