Jump to content

[1.19] EntityType.Builder issue


LuccaPossamai

Recommended Posts

Im trying to update my mod to 1.19, but I'm having issues in the Registration part. In the 1.18 version this problem did not happen. I really don't know whats happening.

It keep sending this error message:

Spoiler
Details:
	Caused by 0: java.lang.reflect.InvocationTargetException
		at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
		at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
		at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
		at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
		at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
		at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:68) ~[javafmllanguage-1.19-41.0.17.jar%2391!/:?] {}
		at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19-41.0.17.jar%2394!/:?] {}
		at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
		at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
		at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
		at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
		at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {}
		at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {}
		at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}

	Caused by 1: java.lang.ExceptionInInitializerError
		at com.lucca.mohard.setup.Registration.register(Registration.java:76) ~[%2395!/:?] {re:classloading}
		at com.lucca.mohard.ExampleMod.<init>(ExampleMod.java:44) ~[%2395!/:?] {re:classloading}
		at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
		at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
		at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
		at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
		at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
		at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:68) ~[javafmllanguage-1.19-41.0.17.jar%2391!/:?] {}
		at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19-41.0.17.jar%2394!/:?] {}
		at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
		at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
		at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
		at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
		at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {}
		at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {}
		at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}

	Mod File: main
	Failure message: Example Mod (mohard) has failed to load correctly
		java.lang.reflect.InvocationTargetException: null
	Mod Version: 0.0NONE
	Mod Issue URL: NOT PROVIDED
	Exception message: java.lang.IllegalStateException: Registry is already frozen
Stacktrace:
	at net.minecraftforge.registries.NamespacedHolderHelper.createIntrusiveHolder(NamespacedHolderHelper.java:177) ~[forge-1.19-41.0.17_mapped_official_1.19-recomp.jar%2389%2396!/:?] {re:classloading}
	at net.minecraftforge.registries.NamespacedDefaultedWrapper.createIntrusiveHolder(NamespacedDefaultedWrapper.java:203) ~[forge-1.19-41.0.17_mapped_official_1.19-recomp.jar%2389%2396!/:?] {re:classloading}
	at net.minecraft.world.entity.EntityType.<init>(EntityType.java:158) ~[forge-1.19-41.0.17_mapped_official_1.19-recomp.jar%2390!/:?] {re:classloading}
	at net.minecraft.world.entity.EntityType$Builder.build(EntityType.java:706) ~[forge-1.19-41.0.17_mapped_official_1.19-recomp.jar%2390!/:?] {re:classloading}
	at com.lucca.mohard.setup.init.ModEntityTypes.register(ModEntityTypes.java:194) ~[%2395!/:?] {re:classloading}
	at com.lucca.mohard.setup.init.ModEntityTypes.<clinit>(ModEntityTypes.java:29) ~[%2395!/:?] {re:classloading}
	at com.lucca.mohard.setup.Registration.register(Registration.java:76) ~[%2395!/:?] {re:classloading}
	at com.lucca.mohard.ExampleMod.<init>(ExampleMod.java:44) ~[%2395!/:?] {re:classloading}
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
	at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:68) ~[javafmllanguage-1.19-41.0.17.jar%2391!/:?] {}
	at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19-41.0.17.jar%2394!/:?] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}

 

 

The line it mentioned:

Spoiler
private static <T extends Entity> EntityType<T> register(EntityType.Builder<T> entityTypeBuilder, String name){
        return entityTypeBuilder.build(name);
    }

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.