allow money to be put in kits using the currency symbol before the amount

This commit is contained in:
Iaccidentally 2012-11-04 16:25:09 -05:00
parent 587f532991
commit 332a59f3fc

View file

@ -102,6 +102,13 @@ public class Kit
boolean spew = false; boolean spew = false;
for (String d : items) for (String d : items)
{ {
if (d.startsWith(ess.getSettings().getCurrencySymbol()))
{
Double value = Double.parseDouble(d.substring(ess.getSettings().getCurrencySymbol().length()).trim());
Trade t = new Trade(value, ess);
t.pay(user);
continue;
}
final String[] parts = d.split(" "); final String[] parts = d.split(" ");
final String[] item = parts[0].split("[:+',;.]", 2); final String[] item = parts[0].split("[:+',;.]", 2);
final int id = Material.getMaterial(Integer.parseInt(item[0])).getId(); final int id = Material.getMaterial(Integer.parseInt(item[0])).getId();