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

Stops working after some time in paper servers #45

Open
ElPiigeon opened this issue Jun 29, 2024 · 7 comments
Open

Stops working after some time in paper servers #45

ElPiigeon opened this issue Jun 29, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ElPiigeon
Copy link

Describe the bug

The datapack works great on my 1.20.4 server hosting at my home. But, after some times, the datapack stop working and a error show on the console:

[12:28:17 WARN]: Failed to execute function dynamiclights:internal/main
net.minecraft.ReportedException: Saving entity NBT
at net.minecraft.world.entity.Entity.saveWithoutId(Entity.java:2505) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.world.entity.Entity.saveWithoutId(Entity.java:2344) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.advancements.critereon.NbtPredicate.getEntityTagToCompare(NbtPredicate.java:29) ~[?:?]
at net.minecraft.server.commands.data.EntityDataAccessor.getData(EntityDataAccessor.java:57) ~[?:?]
at net.minecraft.server.commands.data.DataCommands.manipulateData(DataCommands.java:337) ~[?:?]
at net.minecraft.server.commands.data.DataCommands.lambda$decorateModification$24(DataCommands.java:219) ~[?:?]
at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:31) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.commands.execution.CommandQueueEntry.a(CommandQueueEntry.java:5) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:103) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:434) ~[?:?]
at net.minecraft.server.ServerFunctionManager.execute(ServerFunctionManager.java:81) ~[?:?]
at net.minecraft.world.level.timers.FunctionCallback.handle(FunctionCallback.java:21) ~[?:?]
at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
at net.minecraft.world.level.timers.FunctionCallback.handle(FunctionCallback.java:21) ~[?:?]
at net.minecraft.world.level.timers.FunctionCallback.handle(FunctionCallback.java:14) ~[?:?]
at net.minecraft.world.level.timers.TimerQueue.tick(TimerQueue.ja

Steps to reproduce

No response

Expected behavior

No response

Additional context

No response

@ElPiigeon ElPiigeon added the bug Something isn't working label Jun 29, 2024
@Tschipcraft
Copy link
Owner

Thank you for the bug report. Paper is kind of known for accidentally breaking data pack functionality quite often due to its invasive optimization strategies.
If this happens again, could you try running the command /function dynamiclights:internal/main manually and report back if that resumes Dynamic Lights?

@Tschipcraft Tschipcraft added the question Further information is requested label Jul 5, 2024
@ElPiigeon
Copy link
Author

Alright i'll keep you up

@ElPiigeon
Copy link
Author

I tried /function dynamiclights:internal/main and it does nothing. Is it suppose to create a report ? I just reset the data with /function #tschipcraft:menu and it works again

@Tschipcraft
Copy link
Owner

Dynamic Light runs in a loop. The main function executes the code and finally reschedules itself to run on the next tick.
The error you got indicates that it stopped the function midway through because of an entity NBT save error (could be caused by multi-threading?), so my hypothesis was to just resume the loop and manually 'schedule' the main function to run in the current tick. If this would have worked, I could have just moved the schedule part to the beginning of the main function so that it runs before everything else.
Interesting though that the reset function worked...

@Tschipcraft Tschipcraft changed the title Stop working after time in the server Stops working after some time in paper servers Jul 11, 2024
@Tschipcraft Tschipcraft removed the question Further information is requested label Jul 21, 2024
@ElPiigeon
Copy link
Author

hey, I just want to let you know that the "/function dynamiclights:internal/main" make the datapack works again. So everytime it stop, I just run the command and it start working again for couple hours !

@Tschipcraft
Copy link
Owner

Thanks for letting me know, so my first idea may work out. I will try to fix this for the next release.

@Tschipcraft Tschipcraft self-assigned this Aug 28, 2024
Tschipcraft added a commit that referenced this issue Aug 28, 2024
Moved schedule command to beginning of main. This should theoretically fix Dynamic Lights breaking after some time on paper servers (closes #45, closes #21)
@Tschipcraft
Copy link
Owner

I just implemented this, the dev builds are available here. If you have time, try them and let me know if this issue is fixed 🎉

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

No branches or pull requests

2 participants