aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java')
-rw-r--r--src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java b/src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java
index e2be11b..6851779 100644
--- a/src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java
+++ b/src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java
@@ -39,6 +39,8 @@ public class ChestOverviewGui extends GuiScreen {
public ChestOverviewGui(Cowlection main) {
this.screenTitle = Cowlection.MODNAME + " Chest Analyzer";
this.main = main;
+ // clear wanted item chest highlighting
+ main.getChestTracker().getChestsWithWantedItem().clear();
}
@Override
@@ -344,6 +346,14 @@ public class ChestOverviewGui extends GuiScreen {
@Override
protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) {
+ if (!isDoubleClick) {
+ return;
+ }
+ ItemData itemData = itemDataHolder.get(slotIndex);
+ if (itemData != null) {
+ this.mc.displayGuiScreen(null);
+ main.getChestTracker().markChestsWithWantedItem(itemData.getKey(), itemData.getAmount(), itemData.getName());
+ }
}
@Override