REI Plugin Compatibilities (REIPC)

REI Plugin Compatibilities (REIPC)

9M Downloads

[Bug] 1.21 Fabric ItemGroupEvents.modifyEntriesEvent is fired with the static registry lookup.

modmuss50 opened this issue · 0 comments

commented

What happened?

Fabric's ItemGroupEvents.modifyEntriesEvent is fired with the static registry lookup, this breaks any mod that tries to query something from a dynamic registry for its item groups, including a vanilla one.

The issue comes from here here: https://github.com/shedaniel/RoughlyEnoughItems/blob/16.x-1.21/fabric/src/main/java/me/shedaniel/rei/impl/client/fabric/CreativeModeTabCollectorImpl.java#L47 where it only uses the builtin registries.

(In yarn names): DynamicRegistryManager.of(Registries.REGISTRIES) only provides a wrapper lookup to the static builtin registries, this breaks mods such as TechReborn here. I think this code should ideally use the static displayContext from ItemGroups, or the DRM.

Tested with REI 16.0.729

What mod loaders are you seeing the problem on?

Fabric

What do you think this bug is of?

  • Visual
  • Recipe Lookup
  • Cheat Mode
  • Plugin Integration / JEI Plugin Compatibility
  • Others

Relevant log output

[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] ########################################
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] REIPlugin starting main-reload for START.
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] Plugins (7):
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultClientPlugin of DefaultClientPlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultPlugin of DefaultPlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) FabricFluidAPISupportPlugin
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) HideIngredientsFromTagsPlugin of HideIngredientsFromTagsPlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultClientRuntimePlugin of DefaultClientRuntimePlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) ReiPlugin of ReiPlugin [techreborn]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultRuntimePlugin of DefaultRuntimePlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] ########################################
[20:03:40] [Render thread/WARN] (REI) [REI] Suppressing Reload Plugins of stage START
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] REIClientPlugin starting main-reload for START.
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] Plugins (4):
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultClientPlugin of DefaultClientPlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) HideIngredientsFromTagsPlugin of HideIngredientsFromTagsPlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultClientRuntimePlugin of DefaultClientRuntimePlugin [roughlyenoughitems]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) ReiPlugin of ReiPlugin [techreborn]
[20:03:40] [REI-ReloadPlugins/INFO] (REI) [REI] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[20:03:40] [Render thread/INFO] (Minecraft) [System] [CHAT] Player514 has made the advancement [Tech Reborn]
[20:03:40] [REI-ReloadPlugins/ERROR] (REI) [REI] Failed to collect creative tab: net.minecraft.item.ItemGroup@59d3111e
 java.lang.IllegalStateException: Registry minecraft:banner_pattern not found
	at net.minecraft.registry.RegistryWrapper$WrapperLookup.method_46763(RegistryWrapper.java:107) ~[minecraft-common-0c4c186d85-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
	at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
	at net.minecraft.registry.RegistryWrapper$WrapperLookup.getWrapperOrThrow(RegistryWrapper.java:107) ~[minecraft-common-0c4c186d85-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
	at net.minecraft.item.ItemGroups.method_51332(ItemGroups.java:1266) ~[minecraft-common-0c4c186d85-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
	at me.shedaniel.rei.impl.client.fabric.CreativeModeTabCollectorImpl.collectTabs(CreativeModeTabCollectorImpl.java:56) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
	at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
	at me.shedaniel.rei.plugin.client.DefaultClientPlugin.collectTabs(DefaultClientPlugin.java:195) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.plugin.client.DefaultClientPlugin.registerEntries(DefaultClientPlugin.java:156) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.entry.type.EntryRegistryImpl.acceptPlugin(EntryRegistryImpl.java:69) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.entry.type.EntryRegistryImpl.acceptPlugin(EntryRegistryImpl.java:51) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.api.common.registry.Reloadable.acceptPlugin(Reloadable.java:78) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.lambda$startReload$9(PluginManagerImpl.java:417) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.lambda$pluginSection$4(PluginManagerImpl.java:199) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.lambda$startReload$10(PluginManagerImpl.java:407) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.pluginSection(PluginManagerImpl.java:197) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.startReload(PluginManagerImpl.java:405) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.RoughlyEnoughItemsCore._reloadPlugins(RoughlyEnoughItemsCore.java:162) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.RoughlyEnoughItemsCoreClient.lambda$reloadPlugins$25(RoughlyEnoughItemsCoreClient.java:483) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1804) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[?:?]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
	at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:317) ~[?:?]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:?]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
[20:03:40] [REI-ReloadPlugins/ERROR] (REI) [REI] Failed to collect fabric's creative tab: net.minecraft.item.ItemGroup@7883afe2
 java.lang.IllegalStateException: Registry minecraft:enchantment not found
	at net.minecraft.registry.RegistryWrapper$WrapperLookup.method_46763(RegistryWrapper.java:107) ~[minecraft-common-0c4c186d85-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
	at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
	at net.minecraft.registry.RegistryWrapper$WrapperLookup.getWrapperOrThrow(RegistryWrapper.java:107) ~[minecraft-common-0c4c186d85-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
	at techreborn.init.TRItemGroup.addRockCutter(TRItemGroup.java:808) ~[TechReborn.main/:?]
	at techreborn.init.TRItemGroup.entries(TRItemGroup.java:238) ~[TechReborn.main/:?]
	at net.fabricmc.fabric.impl.itemgroup.ItemGroupEventsImpl.lambda$createModifyEvent$1(ItemGroupEventsImpl.java:46) ~[fabric-item-group-api-v1-common-4.1.0+00ab0a6390.jar:?]
	at me.shedaniel.rei.impl.client.fabric.CreativeModeTabCollectorImpl.postFabricEvents(CreativeModeTabCollectorImpl.java:72) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.client.fabric.CreativeModeTabCollectorImpl.collectTabs(CreativeModeTabCollectorImpl.java:57) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
	at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
	at me.shedaniel.rei.plugin.client.DefaultClientPlugin.collectTabs(DefaultClientPlugin.java:195) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.plugin.client.DefaultClientPlugin.registerEntries(DefaultClientPlugin.java:156) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.entry.type.EntryRegistryImpl.acceptPlugin(EntryRegistryImpl.java:69) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.entry.type.EntryRegistryImpl.acceptPlugin(EntryRegistryImpl.java:51) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.api.common.registry.Reloadable.acceptPlugin(Reloadable.java:78) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.lambda$startReload$9(PluginManagerImpl.java:417) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.lambda$pluginSection$4(PluginManagerImpl.java:199) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.lambda$startReload$10(PluginManagerImpl.java:407) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.pluginSection(PluginManagerImpl.java:197) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.impl.common.plugins.PluginManagerImpl.startReload(PluginManagerImpl.java:405) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.RoughlyEnoughItemsCore._reloadPlugins(RoughlyEnoughItemsCore.java:162) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at me.shedaniel.rei.RoughlyEnoughItemsCoreClient.lambda$reloadPlugins$25(RoughlyEnoughItemsCoreClient.java:483) ~[RoughlyEnoughItems-fabric-16.0.729.jar:?]
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1804) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[?:?]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
	at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:317) ~[?:?]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:?]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
[20:03:40] [Render thread/INFO] (Minecraft) Loaded 123 advancements
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] REIServerPlugin starting main-reload for START.
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] Plugins (3):
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultPlugin of DefaultPlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) FabricFluidAPISupportPlugin
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultRuntimePlugin of DefaultRuntimePlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] REIPlugin finished post-reload for START in 3.789 ms, totaling 343.0 ms.
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] REIClientPlugin finished post-reload for START in 2.773 ms, totaling 863.2 ms.
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] REIServerPlugin finished post-reload for START in 1.258 ms, totaling 7.438 ms.
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] ++++++++++++++++++++++++++++++++++++++++
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] REIPlugin starting main-reload for END.
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] Plugins (7):
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultClientPlugin of DefaultClientPlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultPlugin of DefaultPlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) FabricFluidAPISupportPlugin
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) HideIngredientsFromTagsPlugin of HideIngredientsFromTagsPlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultClientRuntimePlugin of DefaultClientRuntimePlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) ReiPlugin of ReiPlugin [techreborn]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultRuntimePlugin of DefaultRuntimePlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] ++++++++++++++++++++++++++++++++++++++++
[20:03:41] [Server thread/INFO] (Minecraft) Saving and pausing game...
[20:03:41] [Server thread/INFO] (Minecraft) Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] ########################################
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] REIClientPlugin starting main-reload for END.
[20:03:41] [Server thread/INFO] (Minecraft) Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] Plugins (4):
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultClientPlugin of DefaultClientPlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) HideIngredientsFromTagsPlugin of HideIngredientsFromTagsPlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultClientRuntimePlugin of DefaultClientRuntimePlugin [roughlyenoughitems]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) ReiPlugin of ReiPlugin [techreborn]
[20:03:41] [REI-ReloadPlugins/INFO] (REI) [REI] ########################################
[20:03:41] [Server thread/INFO] (Minecraft) Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI] ----------------------------------------
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI] REIServerPlugin starting main-reload for END.
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI] Plugins (3):
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI]  - (-100.00) DefaultPlugin of DefaultPlugin [roughlyenoughitems]
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) FabricFluidAPISupportPlugin
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI]  - (0.00) DefaultRuntimePlugin of DefaultRuntimePlugin [roughlyenoughitems]
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI] ----------------------------------------
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI] REIPlugin finished post-reload for END in 1.144 ms, totaling 154.0 ms.
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI] REIClientPlugin finished post-reload for END in 1.078 ms, totaling 1.471 s.
[20:03:43] [REI-ReloadPlugins/INFO] (REI) [REI] REIServerPlugin finished post-reload for END in 466.0 μs, totaling 15.43 ms.

Anything else?

No response

By submitting this issue, I have included the necessary logs by pasting the contents into the correct location or attaching the file as an upload.

  • Yes, and I did not use any paste services other than GitHub Gists.

By submitting this issue, I have confirmed my REI and REI's dependencies are up to date.

  • Yes