Error while ticking holograms
i998979 opened this issue ยท 5 comments
Confirmation
- I have read the documentation.
- I have read the FAQ.
Description
I am a developer and I am having this spamming in my console when creating a new hologram using the v3 API.
java.lang.NullPointerException: Cannot read field "next" because "this.next" is null
at java.util.LinkedList$ListItr.next(LinkedList.java:897) ~[?:?]
at me.filoghost.holographicdisplays.core.tracking.LineTrackerManager.update(LineTrackerManager.java:57) ~[HolographicDisplays-3.0.0-SNAPSHOT.jar:?]
at me.filoghost.holographicdisplays.core.tick.TickingTask.run(TickingTask.java:69) ~[HolographicDisplays-3.0.0-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.2.jar:git-Purpur-1845]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[purpur-1.19.2.jar:git-Purpur-1845]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1500) ~[purpur-1.19.2.jar:git-Purpur-1845]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:486) ~[purpur-1.19.2.jar:git-Purpur-1845]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1424) ~[purpur-1.19.2.jar:git-Purpur-1845]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1194) ~[purpur-1.19.2.jar:git-Purpur-1845]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1845]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```
I wanna know what caused this to happen? Is it something like the chunk is not loaded or something else? Thank you.
### Holographic Displays version
HolographicDisplays version 3.0.0-SNAPSHOT-b226
### Additional information
_No response_
I think this might be caused by a third-party plugin using the API asynchronously. Please update to the latest dev build, I added more checks to prevent this.
The reason why it is running on async thread is because creating player's skull with skin freezes the server for a while if it runs on server thread, is there anyway to deal with this?
After you're done creating the player's skull, from the async thread schedule a synchronous task to add/edit the line.
Sounds reasonable, I wrapped the itemstack creation code with CompletableFuture and put the appendItem in consumer and it works.
Then I realized maybe I asked a stupid question.
Thanks for the help.