qouteall / ImmersivePortalsModForForge

Apache License 2.0
53 stars 21 forks source link

Newer Forge versions crash #177

Closed WenXin20 closed 4 years ago

WenXin20 commented 4 years ago

Minecraft v1.16.3 Forge v34.1.33 Immersive Portals v0.6

Newer Forge versions are crashing due to a Forge change:

Error Log (Click Here) ``` [09:26:25] [Render thread/ERROR]: Exception caught during firing event: Can not register to a locked registry. Modder should use Forge Register methods. Index: 4 Listeners: 0: NORMAL 1: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onItemRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 2: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onBlocksRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 3: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onEntityRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 4: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onEffectRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 5: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onPotionRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V java.lang.IllegalStateException: Can not register to a locked registry. Modder should use Forge Register methods. at net.minecraftforge.registries.NamespacedWrapper.register(NamespacedWrapper.java:56) at net.minecraftforge.registries.NamespacedWrapper.register(NamespacedWrapper.java:72) at net.minecraftforge.registries.NamespacedWrapper.func_218381_a(NamespacedWrapper.java:40) at net.minecraft.util.registry.Registry.func_218322_a(Registry.java:456) at com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents.onEffectRegistry(ModMainForge.java:406) at net.minecraftforge.eventbus.ASMEventHandler_317_RegistryEvents_onEffectRegistry_Register.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:111) at net.minecraftforge.fml.ModContainer$$Lambda$3401/494865616.run(Unknown Source) at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:242) at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:229) at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:195) at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:103) at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2939/1226973575.run(Unknown Source) at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2940/1581377197.run(Unknown Source) at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:103) at net.minecraft.client.Minecraft.(Minecraft.java:424) at net.minecraft.client.main.Main.main(Main.java:149) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$484/405587614.call(Unknown Source) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [09:26:25] [Render thread/ERROR]: Caught exception during event RegistryEvent.Register dispatch for modid immersive_portals java.lang.IllegalStateException: Can not register to a locked registry. Modder should use Forge Register methods. at net.minecraftforge.registries.NamespacedWrapper.register(NamespacedWrapper.java:56) ~[?:?] at net.minecraftforge.registries.NamespacedWrapper.register(NamespacedWrapper.java:72) ~[?:?] at net.minecraftforge.registries.NamespacedWrapper.func_218381_a(NamespacedWrapper.java:40) ~[?:?] at net.minecraft.util.registry.Registry.func_218322_a(Registry.java:456) ~[?:?] at com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents.onEffectRegistry(ModMainForge.java:406) ~[?:0.6] at net.minecraftforge.eventbus.ASMEventHandler_317_RegistryEvents_onEffectRegistry_Register.invoke(.dynamic) ~[?:?] at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-3.0.3-service.jar:?] at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) ~[eventbus-3.0.3-service.jar:?] at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) [?:34.1] at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:111) [?:?] at net.minecraftforge.fml.ModContainer$$Lambda$3401/494865616.run(Unknown Source) [?:?] at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) [?:1.8.0_51] at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) [?:?] at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) [?:?] at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:242) [?:?] at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:229) [?:?] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:195) [?:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:103) [?:?] at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2939/1226973575.run(Unknown Source) [?:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) [?:?] at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2940/1581377197.run(Unknown Source) [?:?] at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:103) [?:?] at net.minecraft.client.Minecraft.(Minecraft.java:424) [?:?] at net.minecraft.client.main.Main.main(Main.java:149) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.3-34.1.33.jar:34.1] at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$484/405587614.call(Unknown Source) [forge-1.16.3-34.1.33.jar:34.1] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-8.0.5.jar:?] [09:26:25] [Render thread/INFO]: [com.hollingsworth.arsnouveau.client.particle.ModParticles:registerParticles:22]: Rendering particles [09:26:25] [Render thread/ERROR]: Exception caught during firing event: Can not register to a locked registry. Modder should use Forge Register methods. Index: 5 Listeners: 0: NORMAL 1: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onItemRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 2: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onBlocksRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 3: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onEntityRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 4: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onEffectRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V 5: ASM: class com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents onPotionRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V java.lang.IllegalStateException: Can not register to a locked registry. Modder should use Forge Register methods. at net.minecraftforge.registries.NamespacedDefaultedWrapper.register(NamespacedDefaultedWrapper.java:58) at net.minecraftforge.registries.NamespacedDefaultedWrapper.register(NamespacedDefaultedWrapper.java:74) at net.minecraftforge.registries.NamespacedDefaultedWrapper.func_218381_a(NamespacedDefaultedWrapper.java:42) at net.minecraft.util.registry.Registry.func_218322_a(Registry.java:456) at com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents.onPotionRegistry(ModMainForge.java:424) at net.minecraftforge.eventbus.ASMEventHandler_318_RegistryEvents_onPotionRegistry_Register.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:111) at net.minecraftforge.fml.ModContainer$$Lambda$3401/494865616.run(Unknown Source) at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:242) at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:229) at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:195) at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:103) at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2939/1226973575.run(Unknown Source) at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2940/1581377197.run(Unknown Source) at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:103) at net.minecraft.client.Minecraft.(Minecraft.java:424) at net.minecraft.client.main.Main.main(Main.java:149) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$484/405587614.call(Unknown Source) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [09:26:25] [Render thread/ERROR]: Caught exception during event RegistryEvent.Register dispatch for modid immersive_portals java.lang.IllegalStateException: Can not register to a locked registry. Modder should use Forge Register methods. at net.minecraftforge.registries.NamespacedDefaultedWrapper.register(NamespacedDefaultedWrapper.java:58) ~[?:?] at net.minecraftforge.registries.NamespacedDefaultedWrapper.register(NamespacedDefaultedWrapper.java:74) ~[?:?] at net.minecraftforge.registries.NamespacedDefaultedWrapper.func_218381_a(NamespacedDefaultedWrapper.java:42) ~[?:?] at net.minecraft.util.registry.Registry.func_218322_a(Registry.java:456) ~[?:?] at com.qouteall.hiding_in_the_bushes.ModMainForge$RegistryEvents.onPotionRegistry(ModMainForge.java:424) ~[?:0.6] at net.minecraftforge.eventbus.ASMEventHandler_318_RegistryEvents_onPotionRegistry_Register.invoke(.dynamic) ~[?:?] at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-3.0.3-service.jar:?] at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) ~[eventbus-3.0.3-service.jar:?] at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) [?:34.1] at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:111) [?:?] at net.minecraftforge.fml.ModContainer$$Lambda$3401/494865616.run(Unknown Source) [?:?] at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) [?:1.8.0_51] at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) [?:?] at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) [?:?] at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:242) [?:?] at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:229) [?:?] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:195) [?:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:103) [?:?] at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2939/1226973575.run(Unknown Source) [?:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) [?:?] at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2940/1581377197.run(Unknown Source) [?:?] at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:103) [?:?] at net.minecraft.client.Minecraft.(Minecraft.java:424) [?:?] at net.minecraft.client.main.Main.main(Main.java:149) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.3-34.1.33.jar:34.1] at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$484/405587614.call(Unknown Source) [forge-1.16.3-34.1.33.jar:34.1] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-8.0.5.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-8.0.5.jar:?] ```
DatrixTHLK commented 4 years ago

Same issue here: Crash Log: https://gist.github.com/DatrixTHLK/20857250955d67e35d3f83a652c25d8f FML Report: https://www.filehosting.org/file/details/902631/latest.log (Gist would freeze up)

TheCurle commented 4 years ago

https://github.com/qouteall/ImmersivePortalsModForForge/blob/1.16/src/main/java/com/qouteall/hiding_in_the_bushes/ModMainForge.java#L406

This is the line causing the issue. This is not a Forge change, this has always been a problem. All other events use event.getRegistry() but this one does not, and instead touches the vanilla registries. This is an easy fix.

qouteall commented 4 years ago

I am going to remove the cursed potion thing

qouteall commented 4 years ago

Fixed in 0.7.

DatrixTHLK commented 4 years ago

Thanks for the response and fix! I appreciate it!