mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-22 22:34:43 +02:00
Fix for a bug in getTrade() of Signs that would return the quantity of items as money.
This commit is contained in:
@@ -327,7 +327,7 @@ public class EssentialsSign
|
|||||||
|
|
||||||
protected final Double getMoney(final String line) throws SignException
|
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;
|
return isMoney ? getDouble(line.substring(1)) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,15 +381,12 @@ public class EssentialsSign
|
|||||||
{
|
{
|
||||||
final ItemStack stack = getItemStack(item, quantity);
|
final ItemStack stack = getItemStack(item, quantity);
|
||||||
sign.setLine(index, quantity + " " + item);
|
sign.setLine(index, quantity + " " + item);
|
||||||
return new Trade(quantity, ess);
|
return new Trade(stack, ess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return new Trade(money, ess);
|
return new Trade(money, ess);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user