Skip to content

Commit

Permalink
Close #903
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Dec 24, 2022
1 parent d4d1d97 commit 570162b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
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;
import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRegistry;
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;
Expand Down Expand Up @@ -152,6 +154,24 @@ public void registerEntries(EntryRegistry registry) {
}
}

@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.<ItemStack>castValue().is(Items.ENCHANTED_BOOK));
registry.group(new ResourceLocation("roughlyenoughitems", "potion"), new TranslatableComponent("item.minecraft.potion"),
stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.POTION));
registry.group(new ResourceLocation("roughlyenoughitems", "splash_potion"), new TranslatableComponent("item.minecraft.splash_potion"),
stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.SPLASH_POTION));
registry.group(new ResourceLocation("roughlyenoughitems", "lingering_potion"), new TranslatableComponent("item.minecraft.lingering_potion"),
stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.LINGERING_POTION));
registry.group(new ResourceLocation("roughlyenoughitems", "spawn_egg"), new TranslatableComponent("text.rei.spawn_egg"),
stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().getItem() instanceof SpawnEggItem);
registry.group(new ResourceLocation("roughlyenoughitems", "tipped_arrow"), new TranslatableComponent("item.minecraft.tipped_arrow"),
stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.TIPPED_ARROW));
registry.group(new ResourceLocation("roughlyenoughitems", "music_disc"), new TranslatableComponent("text.rei.music_disc"),
stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().getItem() instanceof RecordItem);
}

@Override
public void registerCategories(CategoryRegistry registry) {
registry.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@
"text.rei.collapsed.entry.hint.expand.macos": "Option-Click to expand all %s (%d entries)",
"text.rei.collapsed.entry.hint.collapse": "Alt-Click to collapse all %s (%d entries)",
"text.rei.collapsed.entry.hint.collapse.macos": "Option-Click to collapse all %s (%d entries)",
"text.rei.spawn_egg": "Spawn Egg",
"text.rei.music_disc": "Music Disc",
"favorite.section.gamemode": "Game Mode",
"favorite.section.weather": "Weather",
"favorite.section.time": "Time",
Expand Down

0 comments on commit 570162b

Please sign in to comment.