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

chunkBlockEntities is null #1

Closed
bold-gman opened this issue Nov 20, 2023 · 11 comments
Closed

chunkBlockEntities is null #1

bold-gman opened this issue Nov 20, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@bold-gman
Copy link

I use paper-1.20.2-291 with a 1.12.2 map and the current prelease of the plugin.

When starting the server i have the following message in the server console:

[21:44:33 INFO]: [BlueMapSignExtractor] Processing region r.-1.-1.mca
[21:44:33 WARN]: [BlueMapSignExtractor] Plugin BlueMapSignExtractor v0.1 generated an exception while executing task 24
java.lang.NullPointerException: Cannot read the array length because "<local10>" is null
        at com.technicjelle.bluemapsignextractor.BlueMapSignExtractor.processMCA(BlueMapSignExtractor.java:79) ~[BlueMapSignExtractor-0.1.jar:?]
        at com.technicjelle.bluemapsignextractor.BlueMapSignExtractor.lambda$loadMarkers$3(BlueMapSignExtractor.java:52) ~[BlueMapSignExtractor-0.1.jar:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
        at java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
        at com.technicjelle.bluemapsignextractor.BlueMapSignExtractor.loadMarkers(BlueMapSignExtractor.java:52) ~[BlueMapSignExtractor-0.1.jar:?]
        at com.technicjelle.bluemapsignextractor.BlueMapSignExtractor.lambda$new$0(BlueMapSignExtractor.java:42) ~[BlueMapSignExtractor-0.1.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.2.jar:git-Paper-291]        at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.2.jar:git-Paper-291]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]

Sadly I know nothing about compling JAR files or I would have built a new version myself with the new commits.

@TechnicJelle
Copy link
Owner

Aha, this plugin does not (currently) support 1.12.2 worlds.
This error makes me believe that the way Minecraft saves signs has changed over the years.
If you could send the region file that caused this error to happen, I can have a look at it to see if I can make it work at some point! :)
Please just upload it directly to GitHub, as an attachment to a comment, instead of using a third-party upload site, like Google Drive, Mediafire, or Dropbox, or something.

@TechnicJelle TechnicJelle added the enhancement New feature or request label Nov 25, 2023
@bold-gman
Copy link
Author

r.-1.-1.mca.zip

I uploaded the one region file mentioned in the console logs. I am pretty sure they messed around with the file format again. The map itself goes back to 2014 and has been converted to new formats multiple times in the past.

@TechnicJelle TechnicJelle mentioned this issue Dec 23, 2023
7 tasks
@TechnicJelle
Copy link
Owner

I'm currently working on a bit of a rewrite of the plugin, and I'm noticing the file you sent has already been converted to a 1.20 world, so this issue is because this plugin isn't compatible with 1.20 worlds, and not because it isn't compatible with 1.12 worlds.
I had already kind of expected this, due to the newly added two-sided nature of signs.

This rewrite will add 1.20 support, and hopefully also all versions prior to that, all the way back to 1.13.
Nothing lower than that, though, as BlueMap itself doesn't support that either, so it wouldn't be possible to run this plugin on a 1.12 server, anyway.

@TechnicJelle TechnicJelle changed the title Crashes with paper-1.20.2-291 Add support for 1.20 Dec 23, 2023
@TechnicJelle
Copy link
Owner

I have added 1.20 support in the latest release, now! https://github.com/TechnicJelle/BlueMapSignExtractor/releases/tag/v1.0

Please try it out and let me know if it works for you!
If it does, please close the issue.

@bold-gman
Copy link
Author

Sadly, I still get an error message.

I use papermc 1.20.4 and the new plugin version:


[18:14:26 INFO]: [BlueMapSignExtractor] Processing region r.1.-1.mca
[18:14:26 INFO]: [BlueMapSignExtractor] Processing region r.-2.5.mca
[18:14:27 WARN]: [BlueMapSignExtractor] Plugin BlueMapSignExtractor v1.0 generated an exception while executing task 25
java.lang.NullPointerException: Cannot read the array length because "<local3>" is null
        at java.util.Collections.addAll(Collections.java:5867) ~[?:?]
        at com.technicjelle.bluemapsignextractor.common.MCA.getBlockEntities(MCA.java:65) ~[BlueMapSignExtractor-1.0.jar:?]
        at com.technicjelle.bluemapsignextractor.common.Core.processMCA(Core.java:37) ~[BlueMapSignExtractor-1.0.jar:?]
        at com.technicjelle.bluemapsignextractor.common.Core.lambda$loadMarkers$1(Core.java:23) ~[BlueMapSignExtractor-1.0.jar:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
        at java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
        at com.technicjelle.bluemapsignextractor.common.Core.loadMarkers(Core.java:23) ~[BlueMapSignExtractor-1.0.jar:?]
        at com.technicjelle.bluemapsignextractor.BlueMapSignExtractor.lambda$new$0(BlueMapSignExtractor.java:42) ~[BlueMapSignExtractor-1.0.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.4.jar:git-Paper-350]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.4.jar:git-Paper-350]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.4.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]

@TechnicJelle TechnicJelle changed the title Add support for 1.20 chunkBlockEntities is null Dec 27, 2023
@TechnicJelle
Copy link
Owner

TechnicJelle commented Dec 27, 2023

Okay, so I tried out that MCA file you sent earlier again, and it seems like a few of the signs there had not been properly upgraded, so the parser was expecting them to be in the new 1.20 format, while they were still in the old format, stemming from 1.13.

Normal 1.13 Normal 1.20 Yours
image image image

I have now fixed that issue, by making it try to parse it in the old way, when the proper new way doesn't work.

However I believe this NullPointerException is actually another issue altogether...

I have now added more logging to the plugin, so please download the newest build from here, and try it again.
(Click on artifact to download a zip. Inside that zip will be the plugin JAR file that you need to use.)
It should log a lot more information. Please send all that log, plus (one of) the MCA file(s) that the error happens in.

@bold-gman
Copy link
Author

bold-gman commented Dec 28, 2023

Sorry for creating more work for you, thank you for your efforts! This a very old map that went through many different versions and upgrade over the years, I think it dates back to 2014.

So far the new parsing methods seems to work, an example here:

[23:42:08 INFO]: [BlueMapSignExtractor] Processing region r.-19.-11.mca
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":"Tod langweiliger"}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:
Tod langweiliger
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":"Tod langweiliger"}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:
Tod langweiliger
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":"Tod langweiliger"}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:
Tod langweiliger
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":"Tod langweiliger"}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:
Tod langweiliger
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":"Brunnen"}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:
Brunnen
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":"08.01.2017"}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:
08.01.2017
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":"R & S"}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:
R & S
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":""}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:

[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":""}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:

[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":""}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:

[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Could not parse sign text in the expected 1.20 format, due to a GSON/JSON UnsupportedOperationException on Sign Text:
{"text":""}
Trying to parse as old format...
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] Successfully parsed as old format:

As you expected, there still is another issue regarding chunkBlockEntities:


[23:42:10 INFO]: [BlueMapSignExtractor] Processing region r.-98.8.mca
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] no block entities found here
[23:42:10 ERROR]: [BlueMapSignExtractor] Error reading region file
java.io.IOException: chunkBlockEntities was null in chunk 0, 0 in region file /opt/papermc/karte2/region/r.-98.8.mca
        Chunk class: MC_1_20_4_Chunk
        Chunk data version: 3578
        at com.technicjelle.bluemapsignextractor.common.MCA.getBlockEntities(MCA.java:69) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at com.technicjelle.bluemapsignextractor.common.Core.processMCA(Core.java:37) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at com.technicjelle.bluemapsignextractor.common.Core.lambda$loadMarkers$1(Core.java:23) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
        at java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
        at com.technicjelle.bluemapsignextractor.common.Core.loadMarkers(Core.java:23) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at com.technicjelle.bluemapsignextractor.BlueMapSignExtractor.lambda$new$0(BlueMapSignExtractor.java:41) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.4.jar:git-Paper-350]        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.4.jar:git-Paper-350]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.4.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]


[23:42:10 INFO]: [BlueMapSignExtractor] Processing region r.-2.5.mca
[23:42:10 ERROR]: [BlueMapSignExtractor] [STDERR] no block entities found here
[23:42:10 ERROR]: [BlueMapSignExtractor] Error reading region file
java.io.IOException: chunkBlockEntities was null in chunk 19, 20 in region file /opt/papermc/karte2_nether/DIM-1/region/r.-2.5.mca
        Chunk class: MC_1_20_4_Chunk
        Chunk data version: 3578
        at com.technicjelle.bluemapsignextractor.common.MCA.getBlockEntities(MCA.java:69) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at com.technicjelle.bluemapsignextractor.common.Core.processMCA(Core.java:37) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at com.technicjelle.bluemapsignextractor.common.Core.lambda$loadMarkers$1(Core.java:23) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
        at java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
        at com.technicjelle.bluemapsignextractor.common.Core.loadMarkers(Core.java:23) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at com.technicjelle.bluemapsignextractor.BlueMapSignExtractor.lambda$new$0(BlueMapSignExtractor.java:41) ~[BlueMapSignExtractor-1.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.4.jar:git-Paper-350]        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.4.jar:git-Paper-350]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.4.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]

I attached the region files:
regionfiles.zip

Edit: uploaded region from wrong dimension earlier, now fixed

@TechnicJelle
Copy link
Owner

TechnicJelle commented Dec 28, 2023

I'm glad to see that the parsing fix works!

I'll look into the chunkBlockEntities problem this weekend!
Thanks for the logs and the files!

And thanks for giving me the opportunity to improve my plugin for everyone! I don't mind the extra work if it ends up in a better tool :)

@TechnicJelle
Copy link
Owner

Aha! I think I've found out why it doesn't work on those chunks!

[-98, 8] [-2, 5]
image image

They're simply just not done being generated, yet!
I'll add a check to make sure every chunk that gets processed is actually done generating!

@TechnicJelle
Copy link
Owner

I've now released the fixes to both the problems you were having!
https://github.com/TechnicJelle/BlueMapSignExtractor/releases/tag/v1.1
Please try it out and let me know if it all works properly again!

@bold-gman
Copy link
Author

bold-gman commented Jan 1, 2024

Edit: Opened a new issue #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants