Skip to content

Conversation

@leir4iks
Copy link

@leir4iks leir4iks commented Oct 21, 2025

CoreProtect issue (specific to folia and its forks)

When rollback a user's actions within a 100 block radius, the process completes successfully.
However, when performing a "global" radius rollback, which involves processing a large number of chunks (more than 50), the process hangs for 300+ seconds.

The rollback only affects chunks that are currently loaded. Unloaded chunks are ignored but are incorrectly marked in /co inspect as rolledback.
This is caused by the plugin attempting to synchronously load unloaded chunks during the rollback. On folia, this action results in a deadlock, which causes the thread to freeze and skip processing for those chunks.

I resolved this.
Now, the plugin no longer blocks the thread and instead correctly schedules tasks to process chunks after they have loaded. This fixes the issue with freezes and incomplete rollbacks on Folia.

The changes are active only on Folia (and its forks) and do not affect Paper/Spigot (or their forks).

@leir4iks
Copy link
Author

after the exams (in about 3 days), I will start correcting it more properly. I think I still have some things to improve.

@leir4iks leir4iks changed the title rollback in r:global - folia support folia support Oct 29, 2025
@leir4iks
Copy link
Author

Now, i need to test this, I'm sure there have bugs, and i will be looking for them.

@leir4iks leir4iks requested a review from R00tB33rMan October 29, 2025 19:07
@R00tB33rMan
Copy link

Now, i need to test this, I'm sure there have bugs, and i will be looking for them.

Very nice work! I’ll have a look at this for you when I’m more awake

Copy link

@R00tB33rMan R00tB33rMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a quick glance, make sure both instances of hanging signs perform as teleportAsync

@leir4iks
Copy link
Author

leir4iks commented Nov 2, 2025

why im so dumb

@leir4iks leir4iks changed the title folia support folia: rollback #global Nov 3, 2025
@leir4iks
Copy link
Author

leir4iks commented Nov 3, 2025

i just lost a lot of time and effort because i believed the ai that most of the code lines were not adapted for folia. i fixed them, but this led to a great many errors.
why reinvent the wheel, and a broken one at that, if everything was already adapted for folia there?
in general, regarding the changes, i want to say:
On folia:
Parallel rollback of all tasks. was tested with a large server, everything works.
On paper:
A regular rollback of all tasks. I didn't change anything in the paper rollbacks, so everything should work (I recommend testing it).
The code looks dumb because im just practicing writing something in java
Thanks.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants