PaperMC / Folia

Fork of Paper which adds regionised multithreading to the dedicated server.
GNU General Public License v3.0
3.51k stars 443 forks source link

Unusable datapacks #20

Open xmk2333 opened 1 year ago

xmk2333 commented 1 year ago

Expected behavior

7LOG_SRGY4C9TFI$1AI5HG3

Observed/Actual behavior

%IC)J97A2KH 5488XI IQRW

Steps/models to reproduce

I am using translation software, so what I said may be incorrect. I apologize I added several datapacks of vanilla that can be used normally under paper, but there are several issues with function under folia

Plugin and Datapack List

I found that the “/datapack list” command cannot be used

Folia version

[20:45:00 INFO]: This server is running Folia version git-Folia-"ed7a5c5" (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT) (Git: ed7a5c5) You are running the latest version Previous version: git-Purpur-1947 (MC: 1.19.4)

Other

In addition, I found that the “/datapack list” command cannot be used

electronicboy commented 1 year ago

Several commands are currently disabled as they need to be updated to support what folia does

On Fri, 31 Mar 2023, 13:56 可爱的皮卡丘, @.***> wrote:

Expected behavior

[image: 7LOG_SRGY4C9TFI$1AI5HG3] https://user-images.githubusercontent.com/61087334/229122295-8934e94d-f3ee-44d7-a1bd-cc71573b972a.png Observed/Actual behavior

[image: %IC)J97A2KH 5488XI IQRW] https://user-images.githubusercontent.com/61087334/229122360-be03b0d8-07ba-4ffc-9e52-aa5b091f07d0.png Steps/models to reproduce

I am using translation software, so what I said may be incorrect. I apologize I added several datapacks of vanilla that can be used normally under paper, but there are several issues with function under folia Plugin and Datapack List

I found that the “/datapack list” command cannot be used Folia version

[20:45:00 INFO]: This server is running Folia version git-Folia-"ed7a5c5" (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT) (Git: ed7a5c5 https://github.com/PaperMC/Folia/commit/ed7a5c57f4082107751dd8aad431d45ab5fab1d2 ) You are running the latest version Previous version: git-Purpur-1947 (MC: 1.19.4) Other

In addition, I found that the “/datapack list” command cannot be used

— Reply to this email directly, view it on GitHub https://github.com/PaperMC/Folia/issues/20, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMAZGGSEZMTK34RBIHJQLW63H6DANCNFSM6AAAAAAWOTZQIE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

xmk2333 commented 1 year ago

thanks

Spottedleaf commented 1 year ago

Unlikely that command functions will ever be fixed. This is because now commands need to schedule onto the owning target's region, whether it be a block, entity, player, or something else. They may not even need to be scheduled at all.

This results in undefined completion order of the commands, which while some command functions may be able to tolerate, some may not be able to. There is no solution to this issue that I can see.

koteelok commented 1 year ago

What if we do something like a command execution stack and only run the next vanilla command after the logic of the previous command is complete?

electronicboy commented 1 year ago

Because vanilla commands expect to be run within a global context, not a limited one delaying execution of stuff would break behavior as now you'd have commands running across various ticks; teleport entity to Y, set flag on entity, etc, etc, would be spread across ticks and cause many dozens of issues.

Command functions are also generally replacable using plugins which offers a much more performant solution and allows them to deal with those issues on their own, as they won't need to delay execution in an uncontrolled manner

TheRedXD commented 1 year ago

I think you could have a synchronous context running for datapacks that's running on a single thread - while you can't really implement multithreading here, most servers that would use Folia for big server networks won't even use datapacks, while people who just want to get the most bang out of their server would still have compatibility with VanillaTweaks and whatever else they need to run. It's a bit complicated to act on things that are on different threads, you'd need some kind of localized system that lets specifically datapacks/vanilla minecraft commands access them

The intent would be to provide compatibility with pre-existing vanilla things while giving the ability to expand beyond that for servers that need more power.

It's something that needs to be thought out well, I think if you want for average people to use this just like paper, you need that sort of compatibility there. While plugins could replicate these functions, not everyone's up to replicating all of these with plugins.

If I have enough time on my hands, I might look into implementing datapack functionality into Folia, and maybe making a PR if it works out.

electronicboy commented 1 year ago

except now you'd need to have a tick thread which locks each region from ticking so that it itself can tick once per tick in a global state for the world, which would break the whole "you can have a region tanking performance without killing the entire server" 'feature'

I don't think that that would really be something that would be deemed acceptable to the project