Merge pull request #7279 from deathbeam/fix-gorund-items

Respect "Only show loot" option for item notifications
This commit is contained in:
Tomas Slusny
2019-01-12 05:06:46 +01:00
committed by GitHub

View File

@@ -222,9 +222,12 @@ public class GroundItemsPlugin extends Plugin
existing.setQuantity(existing.getQuantity() + groundItem.getQuantity());
}
boolean isHighlighted = config.highlightedColor().equals(getHighlighted(groundItem.getName(),
groundItem.getGePrice(), groundItem.getHaPrice()));
if (config.notifyHighlightedDrops() && isHighlighted)
boolean shouldNotify = !config.onlyShowLoot() && config.highlightedColor().equals(getHighlighted(
groundItem.getName(),
groundItem.getGePrice(),
groundItem.getHaPrice()));
if (config.notifyHighlightedDrops() && shouldNotify)
{
notifyHighlightedItem(groundItem);
}
@@ -294,6 +297,16 @@ public class GroundItemsPlugin extends Plugin
if (groundItem != null)
{
groundItem.setMine(true);
boolean shouldNotify = config.onlyShowLoot() && config.highlightedColor().equals(getHighlighted(
groundItem.getName(),
groundItem.getGePrice(),
groundItem.getHaPrice()));
if (config.notifyHighlightedDrops() && shouldNotify)
{
notifyHighlightedItem(groundItem);
}
}
}
}