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

Improper conversion from generatorOptions causes Nukkit to crash #49

Closed
joserobjr opened this issue May 31, 2019 · 1 comment
Closed
Assignees
Labels
Resolution: resolved The issue has been addressed or the request has been accepted Type: bug Something isn't working
Milestone

Comments

@joserobjr
Copy link
Member

joserobjr commented May 31, 2019

Affected Version
The exact version number. Do not type latest, please be specific.
2.0.0-SNAPSHOT

Describe the bug
A clear and concise description of what the bug is.
Nukkit fails to start when using a world which was converted successfully

To Reproduce
Steps to reproduce the behavior:

  1. Have a 1.8.9 spigot world
  2. Optimize it on 1.14.2
  3. Convert to Nukkit without errors
  4. Replace the Nukkit world with the converted world
  5. Launch Nukkit
  6. See error

Expected behavior
A clear and concise description of what you expected to happen.
Start the server without issues.

Exception stack trace
If applicable, paste it below to help explain your problem.

01:20:07 [INFO ] Preparando mundo "world"
> java.lang.ClassCastException: cn.nukkit.nbt.tag.CompoundTag cannot be cast to cn.nukkit.nbt.tag.StringTag
        at cn.nukkit.nbt.tag.CompoundTag.getString(CompoundTag.java:169)
        at cn.nukkit.level.format.generic.BaseLevelProvider$1.<init>(BaseLevelProvider.java:100)
        at cn.nukkit.level.format.generic.BaseLevelProvider.getGeneratorOptions(BaseLevelProvider.java:98)
        at cn.nukkit.level.Level$2.init(Level.java:232)
        at cn.nukkit.level.Level$2.init(Level.java:228)
        at cn.nukkit.utils.IterableThreadLocal.initialValue(IterableThreadLocal.java:21)
        at java.lang.ThreadLocal.setInitialValue(Unknown Source)
        at java.lang.ThreadLocal.get(Unknown Source)
        at cn.nukkit.level.Level.initLevel(Level.java:407)
        at cn.nukkit.Server.loadLevel(Server.java:1885)
        at cn.nukkit.Server.<init>(Server.java:529)
        at cn.nukkit.Nukkit.main(Nukkit.java:112)
01:20:07 [ERROR] Throwing
java.lang.NullPointerException: null
        at cn.nukkit.level.Level.initLevel(Level.java:408) ~[nukkit-1.0-SNAPSHOT.jar:?]
        at cn.nukkit.Server.loadLevel(Server.java:1885) ~[nukkit-1.0-SNAPSHOT.jar:?]
        at cn.nukkit.Server.<init>(Server.java:529) ~[nukkit-1.0-SNAPSHOT.jar:?]
        at cn.nukkit.Nukkit.main(Nukkit.java:112) [nukkit-1.0-SNAPSHOT.jar:?]
01:20:07 [INFO ] Stopping other threads

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@joserobjr joserobjr added the Type: bug Something isn't working label May 31, 2019
@joserobjr joserobjr added this to the v2.0.0 milestone May 31, 2019
@joserobjr joserobjr changed the title Failed to start the Nukkit server with the converted world Improper conversion from generatorOptions causes Nukkit to crash May 31, 2019
@joserobjr
Copy link
Member Author

The issue is caused because the way Java Edition saves the generatorOptions NBT differs from Nukkit and needs a conversion

@joserobjr joserobjr added the Resolution: resolved The issue has been addressed or the request has been accepted label May 31, 2019
@joserobjr joserobjr self-assigned this Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: resolved The issue has been addressed or the request has been accepted Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant