Jump to content

[1.15.2] Cannot register entity renderer


fcelon

Recommended Posts

I am getting the following error when trying to register a renderer for my new entity.

[m[1;31m[21:10:56] [modloading-worker-2/ERROR] [ne.mi.fm.ja.FMLModContainer/]: Exception caught during firing event: null
	Index: 1
	Listeners:
		0: NORMAL
		1: net.minecraftforge.eventbus.EventBus$$Lambda$2065/1415390560@32f53aa7
java.lang.NullPointerException
	at java.util.concurrent.ConcurrentHashMap.putVal(Unknown Source)
	at java.util.concurrent.ConcurrentHashMap.put(Unknown Source)
	at net.minecraftforge.fml.client.registry.RenderingRegistry.registerEntityRenderingHandler(RenderingRegistry.java:44)
	at com.blockvader.reforging.client.ClientProxy.registerEntityModels(ClientProxy.java:23)
	at com.blockvader.reforging.Reforging.clientSetup(Reforging.java:36)
	at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212)
	at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258)
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106)
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112)
	at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:135)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source)
	at java.util.concurrent.CountedCompleter.exec(Unknown Source)
	at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
	at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

[m[1;31m[21:10:56] [modloading-worker-2/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Caught exception during event FMLClientSetupEvent dispatch for modid reforging
java.lang.NullPointerException: null
	at java.util.concurrent.ConcurrentHashMap.putVal(Unknown Source) ~[?:1.8.0_171] {}
	at java.util.concurrent.ConcurrentHashMap.put(Unknown Source) ~[?:1.8.0_171] {}
	at net.minecraftforge.fml.client.registry.RenderingRegistry.registerEntityRenderingHandler(RenderingRegistry.java:44) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading}
	at com.blockvader.reforging.client.ClientProxy.registerEntityModels(ClientProxy.java:23) ~[main/:?] {re:classloading}
	at com.blockvader.reforging.Reforging.clientSetup(Reforging.java:36) ~[main/:?] {re:classloading}
	at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-2.2.0-service.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-2.2.0-service.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.2.0-service.jar:?] {}
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106) ~[?:31.2] {re:classloading}
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_171] {}
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_171] {}
	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?] {re:classloading}
	at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:135) ~[?:?] {re:classloading}
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) [?:1.8.0_171] {}
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) [?:1.8.0_171] {}
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source) [?:1.8.0_171] {}
	at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.CountedCompleter.exec(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_171] {}
[m[1;31m[21:10:56] [Server-Worker-2/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event SIDED_SETUP, 1 errors found
[m[1;31m[21:10:56] [Server-Worker-2/FATAL] [ne.mi.ev.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
	at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.2.0-service.jar:?] {}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:123) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$3(ClientModLoader.java:105) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_171] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_171] {}

Renderer class

public class ShockwaveRenderer extends EntityRenderer<ShockwaveEntity>{

	public ShockwaveRenderer(EntityRendererManager renderManager)
	{
		super(renderManager);
	}

	@Override
	public ResourceLocation getEntityTexture(@Nonnull ShockwaveEntity entity) 
	{
		return null;
	}
}

Registering renderer

public static void registerEntityModels()
{
	RenderingRegistry.registerEntityRenderingHandler(ModEntities.SHOCKWAVE, ShockwaveRenderer::new);
}

I have registered entity renderer this way in the past and it worked without error. I don't understand what is the problem now.

Link to comment
Share on other sites

41 minutes ago, fcelon said:

ModEntities.SHOCKWAVE

This is probably null. Likely because you're calling this code too early.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

Announcements



×
×
  • Create New...

Important Information

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