aboutsummaryrefslogtreecommitdiff
path: root/api/src/main/java/me/shedaniel/rei/impl
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-06-20 23:20:05 +0800
committershedaniel <daniel@shedaniel.me>2021-06-20 23:20:05 +0800
commit2cc2cfa70062efac58335d62ad8e47105c15fdd7 (patch)
treeb60bbd87e913080c95f82a0b2d38a8da2a89c332 /api/src/main/java/me/shedaniel/rei/impl
parent06c695df2c1ae92ddd71dfa23491d7554387156c (diff)
downloadRoughlyEnoughItems-2cc2cfa70062efac58335d62ad8e47105c15fdd7.tar.gz
RoughlyEnoughItems-2cc2cfa70062efac58335d62ad8e47105c15fdd7.tar.bz2
RoughlyEnoughItems-2cc2cfa70062efac58335d62ad8e47105c15fdd7.zip
Properly implement tooltip rendering for bundles
Diffstat (limited to 'api/src/main/java/me/shedaniel/rei/impl')
-rw-r--r--api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java b/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java
index e7d550c2a..5df95263b 100644
--- a/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java
+++ b/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java
@@ -60,7 +60,8 @@ public final class ClientInternals {
private static BiFunction<Supplier<FavoriteEntry>, Supplier<CompoundTag>, FavoriteEntry> delegateFavoriteEntry = (supplier, toJson) -> throwNotSetup();
private static Function<CompoundTag, FavoriteEntry> favoriteEntryFromJson = (object) -> throwNotSetup();
private static Function<Boolean, ClickArea.Result> clickAreaHandlerResult = (result) -> throwNotSetup();
- private static BiFunction<@Nullable Point, Collection<Component>, Tooltip> tooltipProvider = (point, texts) -> throwNotSetup();
+ private static BiFunction<@Nullable Point, Collection<Tooltip.Entry>, Tooltip> tooltipProvider = (point, texts) -> throwNotSetup();
+ private static Function<Object, Tooltip.Entry> tooltipEntryProvider = (component) -> throwNotSetup();
private static Supplier<List<String>> jeiCompatMods = ClientInternals::throwNotSetup;
private static Supplier<Object> builtinClientPlugin = ClientInternals::throwNotSetup;
@@ -113,10 +114,14 @@ public final class ClientInternals {
return clickAreaHandlerResult.apply(applicable);
}
- public static Tooltip createTooltip(@Nullable Point point, Collection<Component> texts) {
+ public static Tooltip createTooltip(@Nullable Point point, Collection<Tooltip.Entry> texts) {
return tooltipProvider.apply(point, texts);
}
+ public static Tooltip.Entry createTooltipEntry(Object component) {
+ return tooltipEntryProvider.apply(component);
+ }
+
public static FavoriteEntry delegateFavoriteEntry(Supplier<FavoriteEntry> supplier, Supplier<CompoundTag> toJoin) {
return delegateFavoriteEntry.apply(supplier, toJoin);
}