only add positive supplies

This commit is contained in:
James Munson
2019-07-06 15:20:36 -07:00
parent 8ba3ca3fef
commit 0f256646c3
2 changed files with 8 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ public enum ItemType
{
return ItemType.AMMO;
}
if (item.getName().contains("rune"))
if (item.getName().toLowerCase().contains("rune"))
{
return ItemType.RUNE;
}

View File

@@ -401,7 +401,13 @@ public class SuppliesTrackerPlugin extends Plugin
{
quantity -= newItem.getQuantity();
}
buildEntries(oldItem.getId(), quantity);
// ensure that only positive quantities are added since it is reported
// that sometimes checkUsedRunes is called on the same tick that a player
// gains runes in their inventory
if (quantity > 0)
{
buildEntries(oldItem.getId(), quantity);
}
}
}
}