only add positive supplies
This commit is contained in:
@@ -66,7 +66,7 @@ public enum ItemType
|
||||
{
|
||||
return ItemType.AMMO;
|
||||
}
|
||||
if (item.getName().contains("rune"))
|
||||
if (item.getName().toLowerCase().contains("rune"))
|
||||
{
|
||||
return ItemType.RUNE;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user