Jump to content

[1.11] NullPointer on trying to get a list of dimensions.


Recommended Posts

Posted

I am trying to make my mod create configurations for every dimension that is registered. However, I'm getting a null pointer exception and have tried many times in vain to fix it. Here is the code:

 

public static void loadAll() {
        //Dimensions
        Integer[] ids = DimensionManager.getStaticDimensionIDs();

        for (int id : ids) {
            WorldProvider dimension = DimensionManager.getProvider(id); //NullPointer

            String modId = ModIdentification.idFromObject(dimension);

            File file = new File(EnviroMineRevived.configDir, modId.toLowerCase() + "\\dimension.json");

            DimensionProperties.base.load(file);
        }
  ...
    }

 

I then call this method in my post-init method. It however throws a null pointer which leads me to believe that none of the dimensions are registered by then. Where should I be calling this?

 

If you need more code just ask. Following is the error:

 

  Reveal hidden contents

 

Posted

I'm still not having any luck. Any other ideas? There is a null pointer on the same method as last time. :/

  Reveal hidden contents

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.