From 2cc2cfa70062efac58335d62ad8e47105c15fdd7 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 20 Jun 2021 23:20:05 +0800 Subject: Properly implement tooltip rendering for bundles --- api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java') 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> delegateFavoriteEntry = (supplier, toJson) -> throwNotSetup(); private static Function favoriteEntryFromJson = (object) -> throwNotSetup(); private static Function clickAreaHandlerResult = (result) -> throwNotSetup(); - private static BiFunction<@Nullable Point, Collection, Tooltip> tooltipProvider = (point, texts) -> throwNotSetup(); + private static BiFunction<@Nullable Point, Collection, Tooltip> tooltipProvider = (point, texts) -> throwNotSetup(); + private static Function tooltipEntryProvider = (component) -> throwNotSetup(); private static Supplier> jeiCompatMods = ClientInternals::throwNotSetup; private static Supplier builtinClientPlugin = ClientInternals::throwNotSetup; @@ -113,10 +114,14 @@ public final class ClientInternals { return clickAreaHandlerResult.apply(applicable); } - public static Tooltip createTooltip(@Nullable Point point, Collection texts) { + public static Tooltip createTooltip(@Nullable Point point, Collection texts) { return tooltipProvider.apply(point, texts); } + public static Tooltip.Entry createTooltipEntry(Object component) { + return tooltipEntryProvider.apply(component); + } + public static FavoriteEntry delegateFavoriteEntry(Supplier supplier, Supplier toJoin) { return delegateFavoriteEntry.apply(supplier, toJoin); } -- cgit