Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi, I try to register my entity (I follow a tutorial so just ignore the names I gave to the classes), So I made this class:

 

public class TutorialRenderRegistry {
	public static void registryEntityRender() {
		RenderingRegistry.registerEntityRenderingHandler(TutorialEntity.class, new TutorialEntityRender.RenderFactory());
	}
}

 

but on the registerEntityRenderingHandler function it shows me an error: 

Quote

The method registerEntityRenderingHandler(EntityType<T>, IRenderFactory<? super T>) in the type RenderingRegistry is not applicable for the arguments (Class<TutorialEntity>, TutorialEntityRender.RenderFactory)

I did exactly what he did in the tutorial and it worked for him, why not for me?

 

The Tutorial is with Forge 1.14 me I'm with Forge 1.15 maybe it has been changed in the update but I don't know to resolve it.

 

 

EDIT: I tried with forge for 1.14 and it works perfectly if someone knows what changed in the 1.15 version, how to fix this, maybe it's a bit too soon to 1.15 since it has just been released.

Edited by Kristopher_RAS

  • Author

I know about Generics (I'm a C++ programmer for 6 Years now and we have the same things it's called templates, whit few different changes). The problem is that in 1.14 the registerEntityRenderingHandler wasn't required a generics it was asking for an Entity class. Today in 1.15 it asking an EntityType with a generics probably the Entity class but when I'm implementing my EntityType class it still shows me an error. So all I'm asking what they changed between the versions because in 1.14 this worked

 

public class TutorialRenderRegistry {
	public static void registryEntityRender() {
		RenderingRegistry.registerEntityRenderingHandler(TutorialEntity.class, new TutorialEntityRender.RenderFactory());
	}
}

 

Maybe the registerEntityRenderingHandler function is outdated something appeared in 1.15. 

  • Author

Okay, so I looked to the source as you asked: 

 

public static <T extends Entity> void registerEntityRenderingHandler(EntityType<T> entityClass, IRenderFactory<? super T> renderFactory)
    {
        INSTANCE.entityRenderers.put(entityClass, renderFactory);
    }

 

It asks for an EntityType<T>  entityClass, so I tried to go give him that: 

 

	public static EntityType<?> tutorial_entity = EntityType.Builder.create(TutorialEntity::new, EntityClassification.CREATURE).build(FirstMod.modid + ":tutorial_entity").setRegistryName(new ResourceLocation(FirstMod.modid, "tutorial_entity"));

 

This is the EnityType defined in another class defined with my EntityClass but it still not working I don't know why. It's possible that I'm missing something really stupid it happened a lot to me.

 

 

I also check the source of the function in 1.14 and it's different:

 

 public static <T extends Entity> void registerEntityRenderingHandler(Class<T> entityClass, IRenderFactory<? super T> renderFactory)
    {
        INSTANCE.entityRenderers.put(entityClass, renderFactory);
    }

 

It asks for a Class<T> entityClass things that I was provided in the previous version (that the guy was doing in his tutorial).

  • 3 weeks later...

I'm having the same issue and am perhaps not as knowledgeable on the subject. Can someone explain how the error was fixed in a way that is a bit easier to understand? I believe I understand what is wrong, but not how to solve it.

Edited by OneQuestion

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.