aboutsummaryrefslogtreecommitdiff
path: root/api/src/main
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-06-22 23:01:35 +0800
committershedaniel <daniel@shedaniel.me>2022-06-28 03:21:12 +0800
commitf12c906de61d340cfe537f4f166aa20c4bdc52a1 (patch)
treedd93d95391e7147eaf231a04a545e747e966d504 /api/src/main
parente8dc09c26cdfff8e268c993c79641c5811534521 (diff)
downloadRoughlyEnoughItems-f12c906de61d340cfe537f4f166aa20c4bdc52a1.tar.gz
RoughlyEnoughItems-f12c906de61d340cfe537f4f166aa20c4bdc52a1.tar.bz2
RoughlyEnoughItems-f12c906de61d340cfe537f4f166aa20c4bdc52a1.zip
Finish Collapsible Entries Visuals
Diffstat (limited to 'api/src/main')
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/entry/CollapsibleEntryRegistry.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/entry/CollapsibleEntryRegistry.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/entry/CollapsibleEntryRegistry.java
index a85054848..c24ca5e2a 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/registry/entry/CollapsibleEntryRegistry.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/entry/CollapsibleEntryRegistry.java
@@ -28,6 +28,8 @@ import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.api.common.entry.type.EntryType;
import me.shedaniel.rei.api.common.plugins.PluginManager;
import me.shedaniel.rei.api.common.registry.Reloadable;
+import net.minecraft.network.chat.Component;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import org.jetbrains.annotations.ApiStatus;
@@ -53,38 +55,46 @@ public interface CollapsibleEntryRegistry extends Reloadable<REIClientPlugin> {
/**
* Groups the given {@link EntryStack}s into a single entry in the entry panel.
*
+ * @param id the identifier of the group
+ * @param name the name of the group
* @param stacks the stacks to group
* @param <T> the type of the stacks
*/
- <T> void group(List<? extends EntryStack<? extends T>> stacks);
+ <T> void group(ResourceLocation id, Component name, List<? extends EntryStack<? extends T>> stacks);
/**
* Groups the given {@link EntryStack}s into a single entry in the entry panel.
*
+ * @param id the identifier of the group
+ * @param name the name of the group
* @param stacks the stacks to group
* @param <T> the type of the stacks
*/
- default <T> void group(EntryStack<? extends T>... stacks) {
- group(Arrays.asList(stacks));
+ default <T> void group(ResourceLocation id, Component name, EntryStack<? extends T>... stacks) {
+ group(id, name, Arrays.asList(stacks));
}
/**
* Groups the matching {@link EntryStack}s via the given predicate into
* a single entry in the entry panel.
*
+ * @param id the identifier of the group
+ * @param name the name of the group
* @param predicate the predicate to match the stacks
*/
- void group(Predicate<? extends EntryStack<?>> predicate);
+ void group(ResourceLocation id, Component name, Predicate<? extends EntryStack<?>> predicate);
/**
* Groups the matching {@link EntryStack}s via the given predicate into
* a single entry in the entry panel.
*
+ * @param id the identifier of the group
+ * @param name the name of the group
* @param type the entry type to match
* @param predicate the predicate to match the stacks
* @param <T> the type of the stacks
*/
- default <T> void group(EntryType<T> type, Predicate<EntryStack<T>> predicate) {
- group(stack -> stack.getType() == type && predicate.test(stack.cast()));
+ default <T> void group(ResourceLocation id, Component name, EntryType<T> type, Predicate<EntryStack<T>> predicate) {
+ group(id, name, stack -> stack.getType() == type && predicate.test(stack.cast()));
}
}