You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+ public <T extends PacketListener> boolean scheduleIfPossible(T listener, Packet<T> packet) { // Folia - region threading - return whether to notify
7940
7940
if (this.closed) {
7941
-
- throw new RejectedExecutionException("Server already shutting down");
7942
-
+ throw new RejectedExecutionException("Packet processor is shut down"); // Folia - region threading - change exception message
7941
+
- throw new io.papermc.paper.util.ServerStopRejectedExecutionException("Server already shutting down"); // Paper - do not prematurely disconnect players on stop
7942
+
+ throw new io.papermc.paper.util.ServerStopRejectedExecutionException("Packet processor is shut down"); // Paper - do not prematurely disconnect players on stop // Folia - region threading - change exception message
7943
7943
} else {
7944
7944
// Paper start - improve tick loop
7945
7945
// wake up main thread inbetween ticks to process packets
@@ -7988,7 +7988,7 @@ index 42d2f82b24ae48471bfc091667f8e84c5b0d62a8..ab80a66646a7ebe2862221ac342b06c1
@@ -8323,7 +8323,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8323
8323
}
8324
8324
8325
8325
// Paper - improve tick loop - done above
8326
-
@@ -1485,28 +1574,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8326
+
@@ -1480,28 +1569,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8327
8327
8328
8328
@Override
8329
8329
public TickTask wrapRunnable(Runnable runnable) {
@@ -8356,15 +8356,15 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8356
8356
if (super.pollTask()) {
8357
8357
this.moonrise$executeMidTickTasks(); // Paper - rewrite chunk system
8358
8358
return true;
8359
-
@@ -1526,6 +1611,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8359
+
@@ -1521,6 +1606,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8360
8360
8361
8361
@Override
8362
8362
public void doRunTask(TickTask task) {
8363
8363
+ if (true) throw new UnsupportedOperationException(); // Folia - region threading
8364
8364
Profiler.get().incrementCounter("runTask");
8365
8365
super.doRunTask(task);
8366
8366
}
8367
-
@@ -1572,12 +1658,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8367
+
@@ -1567,12 +1653,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8368
8368
return false;
8369
8369
}
8370
8370
@@ -8383,7 +8383,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8383
8383
if (this.playerList.getPlayerCount() == 0 && !this.tickRateManager.isSprinting() && this.pluginsBlockingSleep.isEmpty()) { // Paper - API to allow/disallow tick sleeping
8384
8384
this.emptyTicks++;
8385
8385
} else {
8386
-
@@ -1602,24 +1691,51 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8386
+
@@ -1597,24 +1686,51 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8387
8387
level.getChunkSource().tick(() -> true, false);
8388
8388
}
8389
8389
// Paper end - avoid issues with certain tasks not processing during sleep
@@ -8442,7 +8442,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8442
8442
// Paper start - Incremental chunk and player saving
8443
8443
final ProfilerFiller profiler = Profiler.get();
8444
8444
int playerSaveInterval = io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.rate;
8445
-
@@ -1627,15 +1743,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8445
+
@@ -1622,15 +1738,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8446
8446
playerSaveInterval = autosavePeriod;
8447
8447
}
8448
8448
profiler.push("save");
@@ -8461,7 +8461,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8461
8461
}
8462
8462
}
8463
8463
} finally {
8464
-
@@ -1645,22 +1761,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8464
+
@@ -1640,22 +1756,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8465
8465
// Paper end - Incremental chunk and player saving
8466
8466
8467
8467
ProfilerFiller profilerFiller = Profiler.get();
@@ -8489,7 +8489,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
@@ -2153,11 +2242,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8676
+
@@ -2148,11 +2237,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8677
8677
int i = 0;
8678
8678
8679
8679
for (ServerPlayer serverPlayer : this.getPlayerList().getPlayers()) {
@@ -8689,7 +8689,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8689
8689
i++;
8690
8690
// Paper end - Expand PlayerGameModeChangeEvent
8691
8691
}
8692
-
@@ -2179,7 +2270,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8692
+
@@ -2174,7 +2265,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8693
8693
}
8694
8694
8695
8695
public int getTickCount() {
@@ -8698,7 +8698,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8698
8698
}
8699
8699
8700
8700
public boolean isUnderSpawnProtection(ServerLevel level, BlockPos pos, Player player) {
8701
-
@@ -2215,6 +2306,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8701
+
@@ -2210,6 +2301,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8702
8702
}
8703
8703
8704
8704
public void invalidateStatus() {
@@ -8714,15 +8714,15 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8714
8714
this.lastServerStatus = 0L;
8715
8715
}
8716
8716
8717
-
@@ -2229,6 +2329,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8717
+
@@ -2224,6 +2324,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8718
8718
8719
8719
@Override
8720
8720
public void executeIfPossible(Runnable task) {
8721
8721
+ if (true) throw new UnsupportedOperationException(); // Folia - region threading
8722
8722
if (this.isStopped()) {
8723
8723
throw new io.papermc.paper.util.ServerStopRejectedExecutionException("Server already shutting down"); // Paper - do not prematurely disconnect players on stop
8724
8724
} else {
8725
-
@@ -2571,7 +2672,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8725
+
@@ -2566,7 +2667,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8726
8726
}
8727
8727
8728
8728
public long getAverageTickTimeNanos() {
@@ -8736,7 +8736,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8736
8736
}
8737
8737
8738
8738
public long[] getTickTimesNanos() {
8739
-
@@ -2815,13 +2921,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8739
+
@@ -2810,13 +2916,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8740
8740
}
8741
8741
8742
8742
public ProfileResults stopTimeProfiler() {
@@ -8751,7 +8751,7 @@ index c2227d57ea2e2da537a313d4bfd2f8c7f776be64..78367d9620912b11473f582022422f7c
8751
8751
}
8752
8752
8753
8753
public int getMaxChainedNeighborUpdates() {
8754
-
@@ -3073,24 +3173,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8754
+
@@ -3068,24 +3168,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
8755
8755
8756
8756
// Paper start - API to check if the server is sleeping
8757
8757
public boolean isTickPaused() {
@@ -13548,10 +13548,10 @@ index 6e135a4f622ef564c1a6562e171a0e05296e0022..be14531aa9d740ea3a2b3f61d4d6e303
0 commit comments