Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load options java.lang.NullPointerException #12

Open
ClaudiusMinimus opened this issue Jan 26, 2023 · 4 comments
Open

Failed to load options java.lang.NullPointerException #12

ClaudiusMinimus opened this issue Jan 26, 2023 · 4 comments
Assignees
Labels
Bug Something isn't working Enhancement New feature or request

Comments

@ClaudiusMinimus
Copy link

One of my testers came across an interesting bug. He was testing an install build and the options set in DefaultSettings did not load - nothing but vanilla configs loaded. The result was none of my default configs loaded, so there was no custom menu, no quests, no custom settings, and most important, he loaded into a vanilla overworld and not my custom skyblock world. He is able to reproduce this issue, but I have not. I tried 4 or 5 times, but my installs were fine.

Minecraft: 1.19.2
Forge: 43.2.3
DefaultSettings: 1.19.x-2.8.7

This is how he reproduced the failed install:

  1. using whatever launcher go into create new instance/profile from zip file
  2. select Create_Skyblock_Forge_1.19.2-0.9.0.zip (This is an unpublished version for testing)
  3. wait for it to install
  4. copy over an existing options.txt to the instance folder (see
    troubleshoot-0_9_package.zip also contains log files, and the pack's default configs
    )
  5. launch the pack
  6. observe problem: dev menu, no quests, normal world
  7. close everything, manually delete the options.txt file
  8. re-launch the pack
  9. observe everything is fixed because default settings applied

The player believes it is step 4 is the cause. In troubleshoot-0_9_package.zip is his latest.log file and that is where I found the error Failed to load options java.lang.NullPointerException

I also did a file comparison between his options.txt (on left) and the one that comes with the pack in config/defaultsettings/Default (on right) and it looks like all of his keybindings are in his file.
image

@zaftnotameni
Copy link

zaftnotameni commented Jan 26, 2023

i'm the one that originally reported this to @ClaudiusMinimus

OS is windows 10 if that matters.

The fact that there is a lot in this options file kind of makes sense because i bring it with me over from pack to pack (mostly because of things like fov, ui scale, volume settings, quest keybinds).

Reproducing the issue has been 100% consistent (in the 4 times i tried) for me.

@PT400C
Copy link
Member

PT400C commented Jan 27, 2023

Thank you very much for reporting that bug! It really is a strange one.
Especially the NullPointerException is odd.

To mitigate this you might wanna swap step 4 and 5 (also stop the game after step 5 has finished). Under certain circumstances the mod doesn't really know what to do when the options.txt already exists on the first startup (end-user's side of the pack). It expects it to not be there.

Does it work if you do it this way?

Next month I'll dive deeper into the mod to iron out all those weird problems that have been there for some time. Including this one ofc.

@PT400C PT400C self-assigned this Jan 27, 2023
@PT400C PT400C added the Bug Something isn't working label Jan 27, 2023
@zaftnotameni
Copy link

zaftnotameni commented Jan 27, 2023

To mitigate this you might wanna swap step 4 and 5 (also stop the game after step 5 has finished). Under certain circumstances the mod doesn't really know what to do when the options.txt already exists on the first startup (end-user's side of the pack). It expects it to not be there.

yes, as I described in the reproduction steps, even after the problem has happened, if I just delete options.txt and re-launch, everything works.

so this isn't really a blocker for anyone, just costs a game reload.


as you said i imagine the source of the problem is in the assumption that it is not the first boot if options.txt is present , maybe there's a different way to detect that

@PT400C
Copy link
Member

PT400C commented Jan 27, 2023

Yeah, you pointed out the exact problem. That check via the options.txt is fine in most cases but inappropriate in others.

I'll substitute that with a custom solution that isn't dependent on any Minecraft files :) It should be fixed by the next major release in Feb/Mar 2023.

Note: For further reference, there's also the core library playing it's role. https://github.com/Jomcraft-Network/JCPlugin/blob/28594bbdaeb0b8e6a37c795dd972e6d12922f806/src/main/java/net/jomcraft/jcplugin/FileUtilNoMC.java#L265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants