aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2021-07-06 22:17:44 +0200
committerCow <cow@volloeko.de>2021-07-06 22:17:44 +0200
commitc01904870e61a4de4c3424787682e7bc214afa1d (patch)
treec9f1446db969b734dcbe8d6482ef96d7a5a1d3e6 /src/main/java/de/cowtipper/cowlection/chesttracker/ChestOverviewGui.java
parent65e5ee4b431cc7513e53d61827249148b06de79a (diff)
downloadCowlection-c01904870e61a4de4c3424787682e7bc214afa1d.tar.gz
Cowlection-c01904870e61a4de4c3424787682e7bc214afa1d.tar.bz2
Cowlection-c01904870e61a4de4c3424787682e7bc214afa1d.zip
Added search-for-item functionality to Chest Tracker & Analyzer
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