Jump to content

Recommended Posts

Posted (edited)

I am interested in registering my own BiomeProviderType which uses my custom BiomeProvider BiomeProviderNew. I am familiar with java reflection and the Function<C,T> generic class and I read this question. The problem that I am having is that in order to get the constructor I need to get the class of BiomeProviderType<OverworldBiomeProviderSettings, OverworldBiomeProvider> (once I get things to work I will replace OverworldBiomeProvider with BiomeProviderNew). I want to say

Class<BiomeProviderType<OverworldBiomeProviderSettings, OverworldBiomeProvider>> class=BiomeProviderType<OverworldBiomeProviderSettings, OverworldBiomeProvider>.class; But this is not possible. I read that I could get the class using Types according to the second answer on this link and on this link, but this resulted in the exception sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class. This link talks about the exception but I don't know how to apply it to my case. Similarly, I also need to get the class of Function<OverworldBiomeProviderSettings, OverworldBiomeProvider> and Function<OverworldBiomeProviderSettings, OverworldBiomeProvider>

 

This is my code:

  Reveal hidden contents

This is the stacktrace I got

  Reveal hidden contents

 

I guess this is more of a java question than a question about forge. Thanks!

Edited by Andrew Murdza

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.