aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/impl/SearchArgument.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-04-01 20:01:34 +0800
committershedaniel <daniel@shedaniel.me>2020-04-01 20:01:34 +0800
commit66abc317e5fc36a397ca1cc919e388fbe143956b (patch)
tree915cc4799d89297b8d4bd2dbe1046c177f4d1627 /src/main/java/me/shedaniel/rei/impl/SearchArgument.java
parent3919ec1e15d6eb9a8aa4564bb2d4e4dfdbeb54e3 (diff)
downloadRoughlyEnoughItems-66abc317e5fc36a397ca1cc919e388fbe143956b.tar.gz
RoughlyEnoughItems-66abc317e5fc36a397ca1cc919e388fbe143956b.tar.bz2
RoughlyEnoughItems-66abc317e5fc36a397ca1cc919e388fbe143956b.zip
ScrollingContainer & SubsetsMenu && 20w18b
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/impl/SearchArgument.java')
-rw-r--r--src/main/java/me/shedaniel/rei/impl/SearchArgument.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/impl/SearchArgument.java b/src/main/java/me/shedaniel/rei/impl/SearchArgument.java
index 1146c68ea..c3c21d89b 100644
--- a/src/main/java/me/shedaniel/rei/impl/SearchArgument.java
+++ b/src/main/java/me/shedaniel/rei/impl/SearchArgument.java
@@ -25,6 +25,7 @@ package me.shedaniel.rei.impl;
import com.google.common.collect.Lists;
import me.shedaniel.math.Point;
+import me.shedaniel.math.impl.PointHelper;
import me.shedaniel.rei.api.ClientHelper;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.api.widgets.Tooltip;
@@ -187,6 +188,9 @@ public class SearchArgument {
return tryGetItemStackName(stack.getItemStack());
else if (stack.getType() == EntryStack.Type.FLUID)
return tryGetFluidName(stack.getFluid());
+ Tooltip tooltip = stack.getTooltip(PointHelper.ofMouse());
+ if (tooltip != null)
+ return tooltip.getText().isEmpty() ? "" : tooltip.getText().get(0);
return "";
}
@@ -195,6 +199,9 @@ public class SearchArgument {
return tryGetItemStackNameNoFormatting(stack.getItemStack());
else if (stack.getType() == EntryStack.Type.FLUID)
return tryGetFluidName(stack.getFluid());
+ Tooltip tooltip = stack.getTooltip(PointHelper.ofMouse());
+ if (tooltip != null)
+ return tooltip.getText().isEmpty() ? "" : tooltip.getText().get(0);
return "";
}