Respect "Only show loot" option for item notifications

Fixes #7176

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-01-11 00:38:09 +01:00
parent 5784204965
commit c1ba68fe97

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);
}
}
}
}