Expanded TPS API to support MSPT #391

Open
Biquaternions wants to merge 2 commits from Biquaternions/feat/mspt-region-api into ver/1.21.11
Biquaternions commented 2025-09-04 23:15:11 +02:00 (Migrated from github.com)

This PR includes methods to get MSPT per region.
I tried using the same naming as in Bukkit but adapted for the region logic like the TPS API was.

This re-uses the same logic as CraftServer#getTPSFromRegion and javadocs, which means a possible improvement would be to make a separate function to get the RegionScheduleHandle to re-use in both. However, I decided against this approach since idk if that would make it less likely of getting merged.

This API is useful for monitoring tools that take samples in regular intervals.

This PR includes methods to get MSPT per region. I tried using the [same naming as in Bukkit](https://jd.papermc.io/paper/1.21.8/org/bukkit/Server.html#getAverageTickTime()) but adapted for the region logic like the TPS API was. This re-uses the same logic as `CraftServer#getTPSFromRegion` and javadocs, which means a possible improvement would be to make a separate function to get the `RegionScheduleHandle` to re-use in both. However, I decided against this approach since idk if that would make it less likely of getting merged. This API is useful for monitoring tools that take samples in regular intervals.
Biquaternions commented 2025-12-25 02:37:20 +01:00 (Migrated from github.com)

Rebased for ver/1.21.11

Rebased for ver/1.21.11
This pull request has changes conflicting with the target branch.
  • folia-server/paper-patches/features/0007-Add-TPS-From-Region.patch
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin Biquaternions/feat/mspt-region-api:Biquaternions/feat/mspt-region-api
git switch Biquaternions/feat/mspt-region-api

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch ver/1.21.11
git merge --no-ff Biquaternions/feat/mspt-region-api
git switch Biquaternions/feat/mspt-region-api
git rebase ver/1.21.11
git switch ver/1.21.11
git merge --ff-only Biquaternions/feat/mspt-region-api
git switch Biquaternions/feat/mspt-region-api
git rebase ver/1.21.11
git switch ver/1.21.11
git merge --no-ff Biquaternions/feat/mspt-region-api
git switch ver/1.21.11
git merge --squash Biquaternions/feat/mspt-region-api
git switch ver/1.21.11
git merge --ff-only Biquaternions/feat/mspt-region-api
git switch ver/1.21.11
git merge Biquaternions/feat/mspt-region-api
git push origin ver/1.21.11
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Minecraft/Folia!391
No description provided.