mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-12 10:45:50 -07:00
Prevent unbounded TickList growth on busy servers (>1000 events/tick). This completes another Bleeding request.
This commit is contained in:
@@ -2306,7 +2306,13 @@ public class World implements IBlockAccess {
|
|||||||
throw new IllegalStateException("TickNextTick list out of synch");
|
throw new IllegalStateException("TickNextTick list out of synch");
|
||||||
} else {
|
} else {
|
||||||
if (i > 1000) {
|
if (i > 1000) {
|
||||||
i = 1000;
|
// CraftBukkit start - if the server has too much to process over time, try to alleviate that
|
||||||
|
if(i > 20 * 1000) {
|
||||||
|
i = i / 20;
|
||||||
|
} else {
|
||||||
|
i = 1000;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < i; ++j) {
|
for (int j = 0; j < i; ++j) {
|
||||||
|
Reference in New Issue
Block a user