diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-12-12 21:22:51 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-12-12 21:26:43 +0800 |
| commit | e2979ca8bdf49a5db0f944085caec284fde3d00b (patch) | |
| tree | 886f4ae7fdba33fc6ebcf25ea9d5de864480a087 /api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java | |
| parent | 75020d8ffd08bca7404cc3fbd713e314d7b45324 (diff) | |
| parent | ffc551e61bdafd765dfcf03028568935e2d8c635 (diff) | |
| download | RoughlyEnoughItems-e2979ca8bdf49a5db0f944085caec284fde3d00b.tar.gz RoughlyEnoughItems-e2979ca8bdf49a5db0f944085caec284fde3d00b.tar.bz2 RoughlyEnoughItems-e2979ca8bdf49a5db0f944085caec284fde3d00b.zip | |
Merge remote-tracking branch 'origin/9.x-1.19' into 10.x-1.19.3
# Conflicts:
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/CraftableFilterButtonWidget.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/RegionEntryWidget.java
Diffstat (limited to 'api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java')
| -rw-r--r-- | api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java | 12 |
1 files changed, 12 insertions, 0 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 6efe3c553..77bba4f8b 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java +++ b/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java @@ -24,12 +24,14 @@ package me.shedaniel.rei.impl; import com.mojang.serialization.DataResult; +import dev.architectury.utils.value.BooleanValue; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.ClientHelper; import me.shedaniel.rei.api.client.entry.filtering.FilteringRuleTypeRegistry; import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer; import me.shedaniel.rei.api.client.favorites.FavoriteEntry; +import me.shedaniel.rei.api.client.favorites.FavoriteMenuEntry; import me.shedaniel.rei.api.client.gui.DrawableConsumer; import me.shedaniel.rei.api.client.gui.Renderer; import me.shedaniel.rei.api.client.gui.widgets.*; @@ -70,6 +72,8 @@ public final class ClientInternals { private static Supplier<EntryRenderer<?>> emptyEntryRenderer = ClientInternals::throwNotSetup; private static Supplier<FilteringRuleTypeRegistry> filteringRuleTypeRegistry = ClientInternals::throwNotSetup; private static BiFunction<Supplier<DataResult<FavoriteEntry>>, Supplier<CompoundTag>, FavoriteEntry> delegateFavoriteEntry = (supplier, toJson) -> throwNotSetup(); + private static BiFunction<Component, List<FavoriteMenuEntry>, FavoriteMenuEntry> subMenuEntry = (supplier, toJson) -> throwNotSetup(); + private static BiFunction<Component, BooleanValue, FavoriteMenuEntry> toggleEntry = (supplier, toJson) -> throwNotSetup(); private static Function<CompoundTag, DataResult<FavoriteEntry>> favoriteEntryFromJson = (object) -> throwNotSetup(); private static Function<Boolean, ClickArea.Result> clickAreaHandlerResult = (result) -> throwNotSetup(); private static BiConsumer<List<ClientTooltipComponent>, TooltipComponent> clientTooltipComponentProvider = (tooltip, result) -> throwNotSetup(); @@ -149,6 +153,14 @@ public final class ClientInternals { return delegateFavoriteEntry.apply(supplier, toJoin); } + public static FavoriteMenuEntry createSubMenuEntry(Component name, List<FavoriteMenuEntry> entries) { + return subMenuEntry.apply(name, entries); + } + + public static FavoriteMenuEntry createToggleEntry(Component name, BooleanValue value) { + return toggleEntry.apply(name, value); + } + public static DataResult<FavoriteEntry> favoriteEntryFromJson(CompoundTag tag) { return favoriteEntryFromJson.apply(tag); } |
