Minecraft Comes Alive (MCA)

Minecraft Comes Alive (MCA)

13M Downloads

[1.10.2] Null pointer on world create

Tencao opened this issue ยท 14 comments

commented
  • I am running the latest mod versions of MCA and RadixCore.
  • I can provide my Minecraft version and MCA version.
  • I have searched for the issue previously and it was either not previously reported, or previously fixed and I'm having the same problem.
  • I am crashing and can provide my crash report.

Versions

1.10.2-5.2.3

Issue Description

Crash on creating a new world.

Reproduce Steps

  • Create a new world
  • Wait

Additional Information

https://paste.ee/r/A9jhi

commented

Maybe, but it shouldn't be crashing anyway. There needs to be a safe measure added to prevent this null pointer.

commented

Same here.
If you restart minecraft after the crash and select the world that you were creating you will log in. Time consuming though having to restart mc after creating a new world.

commented

What you're probably best doing is firing the event on WorldEvent, and checking then if the player != null, this way you can make sure the world is loaded first before attempting to do this.

commented

also got this crash today trying to make a test world
crash-2017-01-23_11.32.41-client.txt

commented

This is the line that's causing the crash. I'm not sure whether it's the player or the world that's null.

commented

Something to try... this may not be MCA. I turned MCA off and was still getting the crash but from a different mod. Disabled MineTweaker3, re-enabled MCA, so far so good. I'll report back later tonight. I'm working on a private mod pack so lots of stopping and starting doing setup. Before I was having the crash ever time I started the world from scratch or if I saved out of a world and tried to log back in.

commented

This crash only happens with MCA installed, and since the crash links directly to MCA, I can only assume that the error I had is directly MCA's fault

commented

The crash I had linked directly to mca as well..
java.lang.NullPointerException: Unexpected error at mca.core.MCA.getPlayerData
I disabled MCA and then "a crash" linked to MineTweaker.
ExecutionException in getPlayer maybe coincidene.
Searched around found a suggestion to disable MineTweaker which I did. Re-enabled MCA, no more crashes from MCA... yet. Like I said I'll report back later tonight after I have abused the configuration for awhile.

commented

"With MineTweaker disabled" Out of around 30 new world creations. Some created back to back in the same running instance. Some created by completely restarting minecraft. Saving and restarting some worlds [I was getting crashes at time in this area before with get Player error]. Only two crashes with the MCA error [Better than every single world start].
So I think MineTweaker exacerbated the problem but is still not the issue. Ever so often MCA just crashes on world creation/load. Hope this info helps the mod creator.
Of the two crashes that I did get both happened when creating a new world.

commented

This typically happens when other mods are installed. Test with only MCA and RadixCore.

commented

This might or might not fix it, but shouldn't you be aiming for compatibility all around? On my end I forked this and added a simple null check around https://github.com/WildBamaBoy/minecraft-comes-alive/blob/master/src/main/java/mca/core/MCA.java#L739-L750 , Checking if the world or player is null before continuing. It seems like such an easy and simple fix yet you're actively dismissing the issue.

commented

Slapping in a check for null doesn't really fix anything. It doesn't identify the underlying problem. The next update uses different methods for getting player data, which should make this a non issue.

commented

I know and have known what the problem is. That's given from crash reports - something there is ending up null when it's not supposed to be. In order to identify where it's actually coming from, a check for null doesn't help much. It's basically a band-aid over the real problem.

Whether this sort of thing is caused by MCA or something else is why I ask for tests with just MCA and RadixCore. I'm not dismissing the issue - because if I was able to reproduce it myself with just MCA and RadixCore it would have been fixed immediately.

But as I said, I handle player data differently now and we should see improvement over these types of issues once the next update is released.

commented

It doesn't identify the problem but it does identify what the problem is. I don't know specifically what part of the code is triggering it as I don't know it well enough, but based on all the issues so far it seems to be on client create world.