1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-21 05:51:56 +02:00

Fix for a bug in getTrade() of Signs that would return the quantity of items as money.

This commit is contained in:
snowleo
2011-06-30 23:27:00 +02:00
parent 6c9a57d4b3
commit d95d7745ad

View File

@@ -327,7 +327,7 @@ public class EssentialsSign
protected final Double getMoney(final String line) throws SignException
{
final boolean isMoney = line.matches("^[^0-9-\\.][\\.0-9]+");
final boolean isMoney = line.matches("^[^0-9-\\.][\\.0-9]+$");
return isMoney ? getDouble(line.substring(1)) : null;
}
@@ -381,15 +381,12 @@ public class EssentialsSign
{
final ItemStack stack = getItemStack(item, quantity);
sign.setLine(index, quantity + " " + item);
return new Trade(quantity, ess);
return new Trade(stack, ess);
}
}
else
{
return new Trade(money, ess);
}
}