diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-12-25 00:47:57 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-04-16 00:38:17 +0900 |
| commit | fecfdd2477e34606cd6e1f0622af3180f4691b0b (patch) | |
| tree | 634c702e7f0b5d0bcd56c1afdd6452bf49a4e873 | |
| parent | 054936221a38dc953ae7632844581b8b2b848f9b (diff) | |
| download | RoughlyEnoughItems-fecfdd2477e34606cd6e1f0622af3180f4691b0b.tar.gz RoughlyEnoughItems-fecfdd2477e34606cd6e1f0622af3180f4691b0b.tar.bz2 RoughlyEnoughItems-fecfdd2477e34606cd6e1f0622af3180f4691b0b.zip | |
Close #903
| -rw-r--r-- | default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java | 20 | ||||
| -rwxr-xr-x | runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json | 2 |
2 files changed, 22 insertions, 0 deletions
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; @@ -157,6 +159,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.<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( new DefaultCraftingCategory(), diff --git a/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json b/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json index d0cb485ea..21f017573 100755 --- a/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json +++ b/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json @@ -198,6 +198,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", |
