Skip to content

Port Folia API Server#isOnGlobalTickThread (Perhaps in Suitable New Location) #9459

Description

@A248

Is your feature request related to a problem?

Many Folia APIs were ported to Paper in #9360 . However, Server#isOnGlobalTickThread was not ported. This makes some uses of the Folia API nontransferrable to Paper.

Describe the solution you'd like.

I would like for a isOnGlobalTickThread method to be added to Paper. However, there is one caveat: the location of the method. Rather than port Server#isOnGlobalTickThread equivalently, the method might instead be placed in the global scheduler API.

Here's why. I suspect that PaperMC maintainers consider Folia APIs, when ported to Paper, should be clearly separate from standard scheduling APIs, based on this remark:

Docs might need slight adjustment first to tell people they should only really use the schedulers when also targetting Folia
#9360

Thus, adding Server#isOnGlobalTickThread directly to Paper might cause some confusion vis-a-vis standard scheduling methods such as Server#IsPrimaryThread. Users might wonder why both exist in tandem. Perhaps, therefore, the isOnGlobalTickThread method belongs in the global scheduler API, not org.bukkit.Server. In other words, the method GlobalRegionScheduler#isOnGlobalTickThread should be added to Paper. I personally agree with this opinion, since isOnGlobalTickThread is specifically related to the concept of the global region.

It would make sense therefore, also, for Folia to add a GlobalRegionScheduler#isOnGlobalTickThread. I believe this method was added to Server following the precedent of isPrimaryThread; however, there too I question the location of the method, although it is legacy, and cannot easily be changed.

Describe alternatives you've considered.

Move Server#isOnGlobalTickThread directly to Paper, in the Server class. This may lead to confusion for API users not acquainted with Folia nor having any need of being acquainted with Folia.

Do nothing.

Other

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureRequest for a new Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions