diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-06-11 01:06:08 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-06-11 01:06:08 +0800 |
| commit | a27be9cf41c39eff119be86c035b7611111610b0 (patch) | |
| tree | 24c5e4eda83459a1794e23e2cf32cbd3b1931d3f | |
| parent | 4a8a83a1bfc68eeb80581cde55ef23d16e59f52c (diff) | |
| download | RoughlyEnoughItems-a27be9cf41c39eff119be86c035b7611111610b0.tar.gz RoughlyEnoughItems-a27be9cf41c39eff119be86c035b7611111610b0.tar.bz2 RoughlyEnoughItems-a27be9cf41c39eff119be86c035b7611111610b0.zip | |
Fix #874
| -rw-r--r-- | forge/build.gradle | 10 | ||||
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java | 20 |
2 files changed, 24 insertions, 6 deletions
diff --git a/forge/build.gradle b/forge/build.gradle index 5da03eef6..703689d7e 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -24,6 +24,7 @@ processResources { repositories { maven { url "https://www.cursemaven.com" } + maven { url "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven" } maven { name "Modmaven" url "https://modmaven.dev/" @@ -90,10 +91,11 @@ dependencies { modRuntime("curse.maven:mekanism-generators-268566:3743837") modRuntime("curse.maven:immersive-engineering-231951:3721708") // modRuntime("curse.maven:autoreglib-250363:3326041") - // modRuntime("curse.maven:ars-nouveau-401955:3619899") - // modRuntime("curse.maven:patchouli-306770:3594394") - // modRuntime("curse.maven:curios-309927:3613028") - // modRuntime("curse.maven:geckolib-388172:3627502") + modRuntime("curse.maven:ars-nouveau-401955:3814106") + modRuntime("curse.maven:patchouli-306770:3809917") + modRuntime("curse.maven:curios-309927:3748873") + modRuntime("software.bernie.geckolib:geckolib-1.18-forge:3.0.22") + modRuntime("curse.maven:little-logistics-570050:3818773") // modRuntime("curse.maven:refined-storage-243076:3623324") // modRuntime("appeng:appliedenergistics2:10.0.1") modRuntime("curse.maven:tcon-74072:3784732") diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java index 1aa49902b..28baa75c1 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java @@ -36,6 +36,11 @@ import me.shedaniel.rei.api.client.overlay.ScreenOverlay; import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.EntryRegistry; import me.shedaniel.rei.api.common.entry.EntryStack; +import me.shedaniel.rei.api.common.entry.comparison.ComparisonContext; +import me.shedaniel.rei.api.common.entry.type.EntryDefinition; +import me.shedaniel.rei.api.common.entry.type.EntryType; +import me.shedaniel.rei.api.common.entry.type.EntryTypeRegistry; +import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; import me.shedaniel.rei.api.common.registry.ReloadStage; import me.shedaniel.rei.api.common.util.CollectionUtils; import me.shedaniel.rei.api.common.util.EntryStacks; @@ -172,8 +177,19 @@ public class EntryRegistryImpl implements EntryRegistry { @Override public List<ItemStack> appendStacksForItem(Item item) { NonNullList<ItemStack> list = NonNullList.create(); - CreativeModeTab category = item.getItemCategory(); - item.fillItemCategory(MoreObjects.firstNonNull(category, CreativeModeTab.TAB_SEARCH), list); + LongSet set = new LongOpenHashSet(); + EntryDefinition<ItemStack> itemDefinition = VanillaEntryTypes.ITEM.getDefinition(); + for (CreativeModeTab tab : CreativeModeTab.TABS) { + if (tab != CreativeModeTab.TAB_HOTBAR && tab != CreativeModeTab.TAB_INVENTORY) { + NonNullList<ItemStack> tabList = NonNullList.create(); + item.fillItemCategory(tab, tabList); + for (ItemStack stack : tabList) { + if (set.add(itemDefinition.hash(null, stack, ComparisonContext.EXACT))) { + list.add(stack); + } + } + } + } if (list.isEmpty()) { return Collections.singletonList(item.getDefaultInstance()); } |
