Qveshn / LightAPI

Bukkit Library for create invisible light source
Other
29 stars 13 forks source link

Error stopped chunks from loading #31

Open HamiIkar opened 3 years ago

HamiIkar commented 3 years ago

I already asked in the interactive visualizer discord and they said I should ask here

[04:58:50 WARN]: Null nibble, preventing crash BlockPosition{x=-274, y=77, z=642} [04:58:50 WARN]: [InteractionVisualizer] Task #42979795 for InteractionVisualizer v1.16.2.3 generated an exception java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.chunk.NibbleArray.getCloneIfSet()" because "updating" is null at net.minecraft.world.level.lighting.DataLayerStorageMap.copyDataLayer(DataLayerStorageMap.java:45) ~[?:?] at net.minecraft.world.level.lighting.LayerLightSectionStorage.setStoredLevel(LayerLightSectionStorage.java:108) ~[?:?] at net.minecraft.world.level.lighting.LayerLightEngine.setLevel(LayerLightEngine.java:173) ~[?:?] at net.minecraft.world.level.lighting.DynamicGraphMinFixedPoint.runUpdates(DynamicGraphMinFixedPoint.java:215) ~[?:?] at net.minecraft.world.level.lighting.LayerLightEngine.runUpdates(LayerLightEngine.java:201) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1$2.run(CraftBukkit_v1_17_R1.java:162) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1.executeSync(CraftBukkit_v1_17_R1.java:240) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1.recalculateLighting(CraftBukkit_v1_17_R1.java:157) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1.createLight(CraftBukkit_v1_17_R1.java:95) ~[?:?] at ru.beykerykt.lightapi.LightAPI$1.run(LightAPI.java:317) ~[?:?] at ru.beykerykt.lightapi.LightAPI.createLight(LightAPI.java:330) ~[?:?] at ru.beykerykt.lightapi.LightAPI.createLight(LightAPI.java:289) ~[?:?] at com.loohp.interactionvisualizer.managers.LightManager.lambda$run$0(LightManager.java:148) ~[?:?] at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.17.1.jar:git-Paper-92] at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1490) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:479) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1406) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1188) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-92] at java.lang.Thread.run(Thread.java:831) [?:?] [04:58:50 WARN]: Null nibble, preventing crash BlockPosition{x=-274, y=77, z=642} [04:58:50 WARN]: Null nibble, preventing crash BlockPosition{x=-274, y=77, z=642} [04:58:50 WARN]: [InteractionVisualizer] Task #42979795 for InteractionVisualizer v1.16.2.3 generated an exception java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.chunk.NibbleArray.getCloneIfSet()" because "updating" is null at net.minecraft.world.level.lighting.DataLayerStorageMap.copyDataLayer(DataLayerStorageMap.java:45) ~[?:?] at net.minecraft.world.level.lighting.LayerLightSectionStorage.setStoredLevel(LayerLightSectionStorage.java:108) ~[?:?] at net.minecraft.world.level.lighting.LayerLightEngine.setLevel(LayerLightEngine.java:173) ~[?:?] at net.minecraft.world.level.lighting.DynamicGraphMinFixedPoint.runUpdates(DynamicGraphMinFixedPoint.java:215) ~[?:?] at net.minecraft.world.level.lighting.LayerLightEngine.runUpdates(LayerLightEngine.java:201) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1$2.run(CraftBukkit_v1_17_R1.java:162) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1.executeSync(CraftBukkit_v1_17_R1.java:240) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1.recalculateLighting(CraftBukkit_v1_17_R1.java:157) ~[?:?] at ru.beykerykt.lightapi.server.nms.craftbukkit.CraftBukkit_v1_17_R1.createLight(CraftBukkit_v1_17_R1.java:95) ~[?:?] at ru.beykerykt.lightapi.LightAPI$1.run(LightAPI.java:317) ~[?:?] at ru.beykerykt.lightapi.LightAPI.createLight(LightAPI.java:330) ~[?:?] at ru.beykerykt.lightapi.LightAPI.createLight(LightAPI.java:289) ~[?:?] at com.loohp.interactionvisualizer.managers.LightManager.lambda$run$0(LightManager.java:148) ~[?:?] at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.17.1.jar:git-Paper-92] at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1490) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:479) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1406) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1188) ~[patched_1.17.1.jar:git-Paper-92] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-92] at java.lang.Thread.run(Thread.java:831) [?:?]

Qveshn commented 3 years ago

Hi

  1. LightAPI version?
  2. Can you reproduce this bug on demand when I ask you?
  3. "Error stopped chunks from loading" - Does it mean that chunks are not more loaded after this bug? And how it looks like?

PS. @LOOHP, please stay close. Your help may be required. First question: Is it possible that InteractionVisualizer creates lights where chunk us not loaded yet?

LOOHP commented 3 years ago

Actually the plugin could add/remove light after chunks are unloaded possibly. Tho I've never encountered this error myself or from any bug reports ever before.

Qveshn commented 3 years ago

I have one idea where the bug is. But I need somebody to reproduce the bug before and after my changes in LightAPI

HamiIkar commented 3 years ago

I am using the current version v3.5.1

  1. I cant reproduce it it only happened once. I was just running through a tunnel
  2. yes no more chunks could be loaded I had to restart the server and the server was a bit stuck on saving chunks
Qveshn commented 3 years ago

WTF... net.minecraft.util.thread.ThreadedMailbox: Method g() in 1.17 now is h() in 1.17.1 😟 This method is critical to the continued functioning of the ThreadedMailbox.

Qveshn commented 3 years ago

The new release LightAPI-fork 3.5.2 will probably fix this bug.

Qveshn commented 3 years ago

@LOOHP, I am curious, please tell me in a nutshell (briefly) when (or where) InteractionVisualizer creates light sources, and in what cases with LightType.SKY, and in what cases - LightType.BLOCK? I saw you video here https://www.spigotmc.org/resources/interactionvisualizer-visualize-function-blocks-entities-like-crafting-tables-with-animations.77050/. but did not understand it :flushed: I can assume that LightType.SKY is used so that the objects placed in the blocks have natural light (not black). But then what is the LightType.BLOCK used for?

LOOHP commented 3 years ago

The plugin sets both Block and Sky light of a (for example) crafting table whenever somebody opens it (to light up the armorstands inside of it).

int skylight = loc1.getBlock().getRelative(BlockFace.UP).getLightFromSky();
int blocklight = loc1.getBlock().getRelative(BlockFace.UP).getLightFromBlocks() - 1;
blocklight = blocklight < 0 ? 0 : blocklight;
if (skylight > 0) {
    LightManager.createLight(loc1, skylight, LightType.SKY);
}
if (blocklight > 0) {
    LightManager.createLight(loc1, blocklight, LightType.BLOCK);
}

The LightManager queues the create light from the above code. Then every 10 ticks, it empties the queue on the same tick and update all the lights at once. This is to make sure adjacent LightAPI created light sources does not update each other and start to flicker on the client.

Qveshn commented 3 years ago

@LOOHP thanks

@HamiIkar make pleases tests with new LightAPI 3.5.2 if any errors or chunks are stopped loading again or the server freezes while saving the world on exit, please let me know. Please monitor this for a few days, and if everything is ok, then this issue can be closed.

HamiIkar commented 3 years ago

No error, everything seems to be working nicely