From fecfdd2477e34606cd6e1f0622af3180f4691b0b Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 25 Dec 2022 00:47:57 +0800 Subject: Close #903 --- .../rei/plugin/client/DefaultClientPlugin.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'default-plugin/src/main/java/me') diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java index 900a1f608..98fc53f73 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java @@ -38,6 +38,7 @@ import me.shedaniel.rei.api.client.favorites.FavoriteEntryType; import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.category.CategoryRegistry; import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; +import me.shedaniel.rei.api.client.registry.entry.CollapsibleEntryRegistry; import me.shedaniel.rei.api.client.registry.entry.EntryRegistry; import me.shedaniel.rei.api.client.registry.screen.ExclusionZones; import me.shedaniel.rei.api.client.registry.screen.ScreenRegistry; @@ -45,6 +46,7 @@ import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRegistry; import me.shedaniel.rei.api.client.registry.transfer.simple.SimpleTransferHandler; import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.entry.EntryStack; +import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; import me.shedaniel.rei.api.common.util.EntryIngredients; import me.shedaniel.rei.api.common.util.EntryStacks; import me.shedaniel.rei.impl.ClientInternals; @@ -156,6 +158,24 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin } } + @Override + public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) { + registry.group(new ResourceLocation("roughlyenoughitems", "enchanted_book"), new TranslatableComponent("item.minecraft.enchanted_book"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.ENCHANTED_BOOK)); + registry.group(new ResourceLocation("roughlyenoughitems", "potion"), new TranslatableComponent("item.minecraft.potion"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.POTION)); + registry.group(new ResourceLocation("roughlyenoughitems", "splash_potion"), new TranslatableComponent("item.minecraft.splash_potion"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.SPLASH_POTION)); + registry.group(new ResourceLocation("roughlyenoughitems", "lingering_potion"), new TranslatableComponent("item.minecraft.lingering_potion"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.LINGERING_POTION)); + registry.group(new ResourceLocation("roughlyenoughitems", "spawn_egg"), new TranslatableComponent("text.rei.spawn_egg"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().getItem() instanceof SpawnEggItem); + registry.group(new ResourceLocation("roughlyenoughitems", "tipped_arrow"), new TranslatableComponent("item.minecraft.tipped_arrow"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.TIPPED_ARROW)); + registry.group(new ResourceLocation("roughlyenoughitems", "music_disc"), new TranslatableComponent("text.rei.music_disc"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().getItem() instanceof RecordItem); + } + @Override public void registerCategories(CategoryRegistry registry) { registry.add( -- cgit