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

Fix /sell to handle zero priced items again.

This commit is contained in:
KHobbits
2013-05-05 19:59:35 +01:00
parent c52c22a9e9
commit 8c541ecdd4

View File

@@ -24,19 +24,19 @@ public class Worth implements IConf
String itemname = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""); String itemname = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
BigDecimal result; BigDecimal result;
result = config.getBigDecimal("worth." + itemname + "." + itemStack.getDurability(), BigDecimal.ONE.negate()); result = config.getBigDecimal("worth." + itemname + "." + itemStack.getDurability(), BigDecimal.ONE.negate());
if (result.signum() <= 0) if (result.signum() < 0)
{ {
result = config.getBigDecimal("worth." + itemname + ".0", BigDecimal.ONE.negate()); result = config.getBigDecimal("worth." + itemname + ".0", BigDecimal.ONE.negate());
} }
if (result.signum() <= 0) if (result.signum() < 0)
{ {
result = config.getBigDecimal("worth." + itemname, BigDecimal.ONE.negate()); result = config.getBigDecimal("worth." + itemname, BigDecimal.ONE.negate());
} }
if (result.signum() <= 0) if (result.signum() < 0)
{ {
result = config.getBigDecimal("worth-" + itemStack.getTypeId(), BigDecimal.ONE.negate()); result = config.getBigDecimal("worth-" + itemStack.getTypeId(), BigDecimal.ONE.negate());
} }
if (result.signum() <= 0) if (result.signum() < 0)
{ {
return null; return null;
} }