Fix compile/run for 1.20.4

Currently, /tick is disabled but is planned to be re-added.
It's unlikely that support for sprinting can be implemented
precisely due to the fact that Folia ticks many regions
independently. However, a best-effort approach will be used.
This commit is contained in:
Spottedleaf 2023-12-18 15:06:11 -08:00
parent de6a87e338
commit cd713b8ea2
11 changed files with 155 additions and 80 deletions

View File

@ -8,3 +8,6 @@
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId: # To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
minecraft net.minecraft.world.TickRateManager
minecraft net.minecraft.server.ServerTickRateManager
minecraft net.minecraft.server.commands.TickCommand

View File

@ -2,7 +2,7 @@ group=dev.folia
version=1.20.4-R0.1-SNAPSHOT version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4 mcVersion=1.20.4
paperRef=f1820dc80a02009980e6466ea5847933861b911a paperRef=e3140fb70e818b9e3fd7becbb9842e7f24847bb5
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@ -11,10 +11,10 @@ the schedulers depending on the result of the ownership
check. check.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 4863d9f21f0a0f11974be85360edc587ffd7eab3..56548d416cb116b0f130a18a3c0ee8aed51a7be0 100644 index 48fab492609e0bae459d20cc2eae78b87e37ab75..00ed780f190fa1bf3c33fc093a46b4e914131e5f 100644
--- a/src/main/java/org/bukkit/Bukkit.java --- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2827,6 +2827,14 @@ public final class Bukkit { @@ -2837,6 +2837,14 @@ public final class Bukkit {
return server.isOwnedByCurrentRegion(entity); return server.isOwnedByCurrentRegion(entity);
} }
// Paper end - Folia region threading API // Paper end - Folia region threading API
@ -30,10 +30,10 @@ index 4863d9f21f0a0f11974be85360edc587ffd7eab3..56548d416cb116b0f130a18a3c0ee8ae
@NotNull @NotNull
public static Server.Spigot spigot() { public static Server.Spigot spigot() {
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index f1fa97d12f97baf97beb92ca0719cf3cf906b225..e25f86fb8d4bda9284744c0b8ae7db4f4f9f93a0 100644 index 9af4bc16da09e59009c47911219e99450cdf2aa5..8d51301e1a0a2a528353b90e2e2d0e4c69c6a4f5 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -2473,4 +2473,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -2481,4 +2481,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/ */
boolean isOwnedByCurrentRegion(@NotNull Entity entity); boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API // Paper end - Folia region threading API

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 170a915098f09ace226648da342a04c5c7583d11..512496d086b21bd0d5c5cc070a41185eedc6c2f1 100644 index b12b5a1e82a5ebf47135a3863a390a45a9d8d8ec..03abea227c555decd559dd58b33913127f3549a4 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -27,8 +27,12 @@ repositories { @@ -27,8 +27,12 @@ repositories {
@ -106,10 +106,10 @@ index 34f19ac897a30c0c4e3ab406013fcca1c8b7db93..5ed6c8710b78458031ed6b0273fb2f6a
public SystemReport fillSystemReport(SystemReport details) { public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 782bb8ca67517dde5dba8f0a133eb8699353dd01..f4ba1b9adbd0e526421a755fd6c536fe20ffa716 100644 index e011cfcdda2e0a609d4158b0454bdf046b04c9d9..3e7b9561dd69b634149181be7a537d0546ceb233 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -270,7 +270,7 @@ import javax.annotation.Nullable; // Paper @@ -264,7 +264,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server { public final class CraftServer implements Server {

View File

@ -9363,7 +9363,7 @@ index 14f4c0a93372a58cf36dc95265b5e210ea1605e5..b0d68a04b185c37659e7b42dd931b6d2
protected CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity, boolean silent, CommandResultCallback resultStorer, EntityAnchorArgument.Anchor entityAnchor, CommandSigningContext signedArguments, TaskChainer messageChainTaskQueue) { protected CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity, boolean silent, CommandResultCallback resultStorer, EntityAnchorArgument.Anchor entityAnchor, CommandSigningContext signedArguments, TaskChainer messageChainTaskQueue) {
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 55f3f5396dac2b0bb0cc37b537547e9245042100..d94771b6e36b21ce9dcecfee56682f54576446da 100644 index 55f3f5396dac2b0bb0cc37b537547e9245042100..2f4986196f446b789f6a0bcefc9db13f3d34d698 100644
--- a/src/main/java/net/minecraft/commands/Commands.java --- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -159,13 +159,13 @@ public class Commands { @@ -159,13 +159,13 @@ public class Commands {
@ -9438,7 +9438,8 @@ index 55f3f5396dac2b0bb0cc37b537547e9245042100..d94771b6e36b21ce9dcecfee56682f54
+ //TeamMsgCommand.register(this.dispatcher); // Folia - region threading - TODO later + //TeamMsgCommand.register(this.dispatcher); // Folia - region threading - TODO later
TeleportCommand.register(this.dispatcher); TeleportCommand.register(this.dispatcher);
TellRawCommand.register(this.dispatcher); TellRawCommand.register(this.dispatcher);
TickCommand.register(this.dispatcher); - TickCommand.register(this.dispatcher);
+ //TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
TimeCommand.register(this.dispatcher); TimeCommand.register(this.dispatcher);
TitleCommand.register(this.dispatcher); TitleCommand.register(this.dispatcher);
- TriggerCommand.register(this.dispatcher); - TriggerCommand.register(this.dispatcher);
@ -9708,7 +9709,7 @@ index 6f2adf2334e35e8a617a4ced0c1af2abf32bbd8d..de323c881b6d54061f7fef2b56658beb
} }
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index c0ea20dcee8bb293df96bc6ee019e50ad6b383fd..b84e9d5ae5efe1a8257a5f1f78a0ab66113a698e 100644 index 2ae08b21c63490bbf8cd870f9585d82ed131f815..7dd63112b77f379eca17212e1eb8d041d5655927 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -84,7 +84,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -84,7 +84,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -10074,9 +10075,18 @@ index c5c734b9eb80d1cdf0e9fd8a043f2b6d1f4cbffe..98fb69a9adeb6eaab199aec127692acb
// CraftBukkit start - SPIGOT-5477, MC-142590 // CraftBukkit start - SPIGOT-5477, MC-142590
} else if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) listener).processedDisconnect)) { } else if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) listener).processedDisconnect)) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd8483569e9c0 100644 index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..ec1c5bf4b2e4a54e9df085331416bac0b42c601d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -203,7 +203,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private static final int OVERLOADED_TICKS_THRESHOLD = 20;
private static final long OVERLOADED_WARNING_INTERVAL_NANOS = 10L * TimeUtil.NANOSECONDS_PER_SECOND;
private static final int OVERLOADED_TICKS_WARNING_INTERVAL = 100;
- private static final long STATUS_EXPIRE_TIME_NANOS = 5L * TimeUtil.NANOSECONDS_PER_SECOND;
+ public static final long STATUS_EXPIRE_TIME_NANOS = 5L * TimeUtil.NANOSECONDS_PER_SECOND; // Folia - region threading - public
private static final long PREPARE_LEVELS_DEFAULT_DELAY_NANOS = 10L * TimeUtil.NANOSECONDS_PER_MILLISECOND;
private static final int MAX_STATUS_PLAYER_SAMPLE = 12;
public static final int START_CHUNK_RADIUS = 11;
@@ -241,8 +241,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -241,8 +241,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private volatile boolean running; private volatile boolean running;
private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
@ -10140,6 +10150,15 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
@@ -350,7 +377,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.port = -1;
this.levels = Maps.newLinkedHashMap();
this.running = true;
- this.ticksUntilAutosave = 6000;
+ // Folia - use absolute time instead of this
this.tickTimesNanos = new long[100];
this.aggregatedTickTimesNanos = 0L;
this.nextTickTimeNanos = Util.getNanos();
@@ -640,7 +667,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -640,7 +667,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified()); worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
@ -10556,7 +10575,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
} }
} }
} finally { } finally {
@@ -1546,31 +1669,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1546,63 +1669,37 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
io.papermc.paper.util.CachedLists.reset(); // Paper io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing // Paper start - move executeAll() into full server tick timing
@ -10592,7 +10611,34 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
@@ -1603,6 +1712,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa }
- private int computeNextAutosaveInterval() {
- float f;
-
- if (this.tickRateManager.isSprinting()) {
- long i = this.getAverageTickTimeNanos() + 1L;
-
- f = (float) TimeUtil.NANOSECONDS_PER_SECOND / (float) i;
- } else {
- f = this.tickRateManager.tickrate();
- }
-
- boolean flag = true;
-
- return Math.max(100, (int) (f * 300.0F));
- }
+ // Folia - region threading - use absolute time instead of this
public void onTickRateChanged() {
- int i = this.computeNextAutosaveInterval();
-
- if (i < this.ticksUntilAutosave) {
- this.ticksUntilAutosave = i;
- }
+ // Folia - region threading - use absolute time instead of this
}
protected void logTickTime(long nanos) {} protected void logTickTime(long nanos) {}
@ -10605,7 +10651,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
private ServerStatus buildServerStatus() { private ServerStatus buildServerStatus() {
ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus(); ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus();
@@ -1610,7 +1725,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1610,7 +1707,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
private ServerStatus.Players buildPlayerStatus() { private ServerStatus.Players buildPlayerStatus() {
@ -10614,7 +10660,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
int i = this.getMaxPlayers(); int i = this.getMaxPlayers();
if (this.hidesOnlinePlayers()) { if (this.hidesOnlinePlayers()) {
@@ -1631,31 +1746,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1631,31 +1728,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
@ -10652,7 +10698,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
this.profiler.popPush("levels"); this.profiler.popPush("levels");
//Iterator iterator = this.getAllLevels().iterator(); // Paper - moved down //Iterator iterator = this.getAllLevels().iterator(); // Paper - moved down
@@ -1663,7 +1765,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1663,7 +1747,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
// Run tasks that are waiting on processing // Run tasks that are waiting on processing
MinecraftTimings.processQueueTimer.startTiming(); // Spigot MinecraftTimings.processQueueTimer.startTiming(); // Spigot
@ -10661,7 +10707,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
this.processQueue.remove().run(); this.processQueue.remove().run();
} }
MinecraftTimings.processQueueTimer.stopTiming(); // Spigot MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
@@ -1671,13 +1773,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1671,13 +1755,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - optimize time updates // Paper start - optimize time updates
@ -10678,7 +10724,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
continue; continue;
} }
ServerPlayer entityplayer = (ServerPlayer) entityhuman; ServerPlayer entityplayer = (ServerPlayer) entityhuman;
@@ -1690,14 +1792,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1690,14 +1774,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
@ -10696,7 +10742,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
this.profiler.push(() -> { this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location(); return worldserver + " " + worldserver.dimension().location();
@@ -1714,7 +1813,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1714,7 +1795,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
worldserver.timings.doTick.startTiming(); // Spigot worldserver.timings.doTick.startTiming(); // Spigot
@ -10705,7 +10751,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
// Paper start // Paper start
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) { for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
regionManager.recalculateRegions(); regionManager.recalculateRegions();
@@ -1738,17 +1837,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1738,17 +1819,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop(); this.profiler.pop();
this.profiler.pop(); this.profiler.pop();
@ -10727,7 +10773,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
if (SharedConstants.IS_RUNNING_IN_IDE && this.tickRateManager.runsNormally()) { if (SharedConstants.IS_RUNNING_IN_IDE && this.tickRateManager.runsNormally()) {
GameTestTicker.SINGLETON.tick(); GameTestTicker.SINGLETON.tick();
@@ -1757,7 +1856,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1757,7 +1838,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.popPush("server gui refresh"); this.profiler.popPush("server gui refresh");
MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
@ -10736,7 +10782,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
((Runnable) this.tickables.get(i)).run(); ((Runnable) this.tickables.get(i)).run();
} }
MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper
@@ -1765,7 +1864,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1765,7 +1846,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.popPush("send chunks"); this.profiler.popPush("send chunks");
iterator = this.playerList.getPlayers().iterator(); iterator = this.playerList.getPlayers().iterator();
@ -10745,7 +10791,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
ServerPlayer entityplayer = (ServerPlayer) iterator.next(); ServerPlayer entityplayer = (ServerPlayer) iterator.next();
entityplayer.connection.chunkSender.sendNextChunks(entityplayer); entityplayer.connection.chunkSender.sendNextChunks(entityplayer);
@@ -2108,7 +2207,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2108,7 +2189,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public int getTickCount() { public int getTickCount() {
@ -10754,7 +10800,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
} }
public int getSpawnProtectionRadius() { public int getSpawnProtectionRadius() {
@@ -2163,6 +2262,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2163,6 +2244,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void invalidateStatus() { public void invalidateStatus() {
@ -10770,7 +10816,7 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
this.lastServerStatus = 0L; this.lastServerStatus = 0L;
} }
@@ -2177,6 +2285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2177,6 +2267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override @Override
public void executeIfPossible(Runnable runnable) { public void executeIfPossible(Runnable runnable) {
@ -10778,7 +10824,18 @@ index 5ed6c8710b78458031ed6b0273fb2f6a5f482ea7..99a086ed2c0d5615a55539a31b8cd848
if (this.isStopped()) { if (this.isStopped()) {
throw new RejectedExecutionException("Server already shutting down"); throw new RejectedExecutionException("Server already shutting down");
} else { } else {
@@ -2792,14 +2901,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2435,7 +2526,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public long getAverageTickTimeNanos() {
- return this.aggregatedTickTimesNanos / (long) Math.min(100, Math.max(this.tickCount, 1));
+ // Folia start - region threading
+ return (long)((io.papermc.paper.threadedregions.TickRegionScheduler.RegionScheduleHandle)io.papermc.paper.threadedregions.TickRegionScheduler.getCurrentTickingTask()).getTickReport5s(System.nanoTime()).timePerTickData().segmentAll().average();
+ // Folia end - region threading
}
public long[] getTickTimesNanos() {
@@ -2792,14 +2885,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public ProfileResults stopTimeProfiler() { public ProfileResults stopTimeProfiler() {
@ -15566,7 +15623,7 @@ index 30ccbab1586a656e0ae41d7406525fb02d9e025b..645ab5d149a207bed00357fe0aaf070d
private void updateSignText(ServerboundSignUpdatePacket packet, List<FilteredText> signText) { private void updateSignText(ServerboundSignUpdatePacket packet, List<FilteredText> signText) {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 89b3184be952fd0803520dd0f717f3acfc3cb496..d0f7434164f6241ec81c990c7a127f504e019291 100644 index 89b3184be952fd0803520dd0f717f3acfc3cb496..54aa8ac790f7d23d6404d037105642ddddb7839b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -83,9 +83,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -83,9 +83,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@ -15576,7 +15633,7 @@ index 89b3184be952fd0803520dd0f717f3acfc3cb496..d0f7434164f6241ec81c990c7a127f50
- if (this.connection.isConnected()) { // Paper - prevent logins to be processed even though disconnect was called - if (this.connection.isConnected()) { // Paper - prevent logins to be processed even though disconnect was called
+ // Folia start - region threading - rewrite login process + // Folia start - region threading - rewrite login process
+ String name = this.authenticatedProfile.getName(); + String name = this.authenticatedProfile.getName();
+ UUID uniqueId = this.authenticatedProfile.getId(); + java.util.UUID uniqueId = this.authenticatedProfile.getId();
+ if (this.server.getPlayerList().pushPendingJoin(name, uniqueId, this.connection)) { + if (this.server.getPlayerList().pushPendingJoin(name, uniqueId, this.connection)) {
+ // Folia end - region threading - rewrite login process + // Folia end - region threading - rewrite login process
this.verifyLoginAndFinishConnectionSetup((GameProfile) Objects.requireNonNull(this.authenticatedProfile)); this.verifyLoginAndFinishConnectionSetup((GameProfile) Objects.requireNonNull(this.authenticatedProfile));
@ -19936,6 +19993,21 @@ index 81d2140351775ad55546af52eb635ccdc8509d89..c4a5f7af76f60dd708d1ad7b384ec55a
return; return;
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
index 59bbdead2ebd8965d222540c7243dde051bbcc4b..a1c85bc25fda64bc4677b7a6934b40ad31f5bed0 100644
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
@@ -92,8 +92,8 @@ public class FarmBlock extends Block {
@Override
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
int i = (Integer) state.getValue(FarmBlock.MOISTURE);
- if (i > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper
- if (i == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper
+ if (i > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (world.getRedstoneGameTime() + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper // Folia - region threading
+ if (i == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (world.getRedstoneGameTime() + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper // Folia - region threading
if (!FarmBlock.isNearWater(world, pos) && !world.isRainingAt(pos.above())) {
if (i > 0) {
diff --git a/src/main/java/net/minecraft/world/level/block/FungusBlock.java b/src/main/java/net/minecraft/world/level/block/FungusBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FungusBlock.java b/src/main/java/net/minecraft/world/level/block/FungusBlock.java
index 50d7235cf2ef036451db708c45a063d037051ae9..c0433491be43bb8cc6d00e32edf7699a79f7a251 100644 index 50d7235cf2ef036451db708c45a063d037051ae9..c0433491be43bb8cc6d00e32edf7699a79f7a251 100644
--- a/src/main/java/net/minecraft/world/level/block/FungusBlock.java --- a/src/main/java/net/minecraft/world/level/block/FungusBlock.java
@ -21743,10 +21815,10 @@ index 1d7c663fa0e550bd0cfb9a4b83ccd7e2968666f0..f3df9c9b6cff85565514f990597f3fe5
LevelChunkTicks<T> levelChunkTicks = this.allContainers.get(l); LevelChunkTicks<T> levelChunkTicks = this.allContainers.get(l);
if (levelChunkTicks == null) { if (levelChunkTicks == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f4ba1b9adbd0e526421a755fd6c536fe20ffa716..d2c8ad04c59035449dc798a637acc6e809d35fc4 100644 index 3e7b9561dd69b634149181be7a537d0546ceb233..6e2bbd699d9b168ee9eb89461d588701c0511a24 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -312,7 +312,7 @@ public final class CraftServer implements Server { @@ -307,7 +307,7 @@ public final class CraftServer implements Server {
private final CraftPotionBrewer potionBrewer = new CraftPotionBrewer(); // Paper private final CraftPotionBrewer potionBrewer = new CraftPotionBrewer(); // Paper
// Paper start - Folia region threading API // Paper start - Folia region threading API
@ -21755,7 +21827,7 @@ index f4ba1b9adbd0e526421a755fd6c536fe20ffa716..d2c8ad04c59035449dc798a637acc6e8
private final io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler asyncScheduler = new io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler(); private final io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler asyncScheduler = new io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler();
private final io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler globalRegionScheduler = new io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler(); private final io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler globalRegionScheduler = new io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler();
@@ -380,6 +380,12 @@ public final class CraftServer implements Server { @@ -375,6 +375,12 @@ public final class CraftServer implements Server {
return io.papermc.paper.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandleRaw()); return io.papermc.paper.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandleRaw());
} }
// Paper end - Folia reagion threading API // Paper end - Folia reagion threading API
@ -21768,7 +21840,7 @@ index f4ba1b9adbd0e526421a755fd6c536fe20ffa716..d2c8ad04c59035449dc798a637acc6e8
static { static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
@@ -958,6 +964,9 @@ public final class CraftServer implements Server { @@ -959,6 +965,9 @@ public final class CraftServer implements Server {
// NOTE: Should only be called from DedicatedServer.ah() // NOTE: Should only be called from DedicatedServer.ah()
public boolean dispatchServerCommand(CommandSender sender, ConsoleInput serverCommand) { public boolean dispatchServerCommand(CommandSender sender, ConsoleInput serverCommand) {
@ -21778,7 +21850,7 @@ index f4ba1b9adbd0e526421a755fd6c536fe20ffa716..d2c8ad04c59035449dc798a637acc6e8
if (sender instanceof Conversable) { if (sender instanceof Conversable) {
Conversable conversable = (Conversable) sender; Conversable conversable = (Conversable) sender;
@@ -977,12 +986,44 @@ public final class CraftServer implements Server { @@ -978,12 +987,44 @@ public final class CraftServer implements Server {
} }
} }
@ -21823,7 +21895,7 @@ index f4ba1b9adbd0e526421a755fd6c536fe20ffa716..d2c8ad04c59035449dc798a637acc6e8
if (this.commandMap.dispatch(sender, commandLine)) { if (this.commandMap.dispatch(sender, commandLine)) {
return true; return true;
} }
@@ -3203,7 +3244,7 @@ public final class CraftServer implements Server { @@ -3204,7 +3245,7 @@ public final class CraftServer implements Server {
@Override @Override
public int getCurrentTick() { public int getCurrentTick() {
@ -22529,10 +22601,10 @@ index 12eeabafbad9da8796dc6fc383b732cf75bb7ddb..6ede423639c8e2012da897f517e8f7c9
List<String> offers = waitable.get(); List<String> offers = waitable.get();
if (offers == null) { if (offers == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index aa4dbf91cf6da329fdcacbde98bb870eb48e8f5c..cd29fa29fa65060c21c715bd756c5a35429eeb96 100644 index 1727e932ac6b9ca09b5df96f9547ff125114e15a..9a4a7bae17dd554aeeffb0ec4cb0876ef797e097 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -588,6 +588,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -233,6 +233,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@Override @Override
public boolean teleport(Location location, TeleportCause cause, io.papermc.paper.entity.TeleportFlag... flags) { public boolean teleport(Location location, TeleportCause cause, io.papermc.paper.entity.TeleportFlag... flags) {
@ -22544,7 +22616,7 @@ index aa4dbf91cf6da329fdcacbde98bb870eb48e8f5c..cd29fa29fa65060c21c715bd756c5a35
// Paper end // Paper end
Preconditions.checkArgument(location != null, "location cannot be null"); Preconditions.checkArgument(location != null, "location cannot be null");
location.checkFinite(); location.checkFinite();
@@ -1054,7 +1059,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -699,7 +704,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
ImmutableSet.Builder<Player> players = ImmutableSet.builder(); ImmutableSet.Builder<Player> players = ImmutableSet.builder();
ServerLevel world = ((CraftWorld) this.getWorld()).getHandle(); ServerLevel world = ((CraftWorld) this.getWorld()).getHandle();
@ -22553,7 +22625,7 @@ index aa4dbf91cf6da329fdcacbde98bb870eb48e8f5c..cd29fa29fa65060c21c715bd756c5a35
if (entityTracker != null) { if (entityTracker != null) {
for (ServerPlayerConnection connection : entityTracker.seenBy) { for (ServerPlayerConnection connection : entityTracker.seenBy) {
@@ -1348,7 +1353,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -993,7 +998,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }
ServerLevel world = ((CraftWorld) this.getWorld()).getHandle(); ServerLevel world = ((CraftWorld) this.getWorld()).getHandle();
@ -22562,7 +22634,7 @@ index aa4dbf91cf6da329fdcacbde98bb870eb48e8f5c..cd29fa29fa65060c21c715bd756c5a35
if (entityTracker == null) { if (entityTracker == null) {
return; return;
@@ -1416,30 +1421,43 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1061,30 +1066,43 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
Preconditions.checkArgument(location != null, "location"); Preconditions.checkArgument(location != null, "location");
location.checkFinite(); location.checkFinite();
Location locationClone = location.clone(); // clone so we don't need to worry about mutations after this call. Location locationClone = location.clone(); // clone so we don't need to worry about mutations after this call.
@ -22627,10 +22699,10 @@ index aa4dbf91cf6da329fdcacbde98bb870eb48e8f5c..cd29fa29fa65060c21c715bd756c5a35
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index fd84786f3e72875e79df46416f47f3403876cef3..374a845acc6b12eb82af4282d52e22f1291f77f7 100644 index 3be5e4df190bff0087c8450b16e4e37b07169040..0566674223e16e34eaa4ab1d21e0e060bd0aeee5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -599,7 +599,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -596,7 +596,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void kickPlayer(String message) { public void kickPlayer(String message) {
@ -22639,7 +22711,7 @@ index fd84786f3e72875e79df46416f47f3403876cef3..374a845acc6b12eb82af4282d52e22f1
if (this.getHandle().connection == null) return; if (this.getHandle().connection == null) return;
this.getHandle().connection.disconnect(message == null ? "" : message, org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause this.getHandle().connection.disconnect(message == null ? "" : message, org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause
@@ -1322,6 +1322,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1319,6 +1319,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public boolean teleport(Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, io.papermc.paper.entity.TeleportFlag... flags) { public boolean teleport(Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, io.papermc.paper.entity.TeleportFlag... flags) {
@ -22651,7 +22723,7 @@ index fd84786f3e72875e79df46416f47f3403876cef3..374a845acc6b12eb82af4282d52e22f1
java.util.Set<net.minecraft.world.entity.RelativeMovement> relativeArguments; java.util.Set<net.minecraft.world.entity.RelativeMovement> relativeArguments;
java.util.Set<io.papermc.paper.entity.TeleportFlag> allFlags; java.util.Set<io.papermc.paper.entity.TeleportFlag> allFlags;
if (flags.length == 0) { if (flags.length == 0) {
@@ -1904,7 +1909,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1901,7 +1906,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private void unregisterEntity(Entity other) { private void unregisterEntity(Entity other) {
// Paper end // Paper end
ChunkMap tracker = ((ServerLevel) this.getHandle().level()).getChunkSource().chunkMap; ChunkMap tracker = ((ServerLevel) this.getHandle().level()).getChunkSource().chunkMap;
@ -22660,7 +22732,7 @@ index fd84786f3e72875e79df46416f47f3403876cef3..374a845acc6b12eb82af4282d52e22f1
if (entry != null) { if (entry != null) {
entry.removePlayer(this.getHandle()); entry.removePlayer(this.getHandle());
} }
@@ -2001,7 +2006,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1998,7 +2003,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
} }
@ -22670,10 +22742,10 @@ index fd84786f3e72875e79df46416f47f3403876cef3..374a845acc6b12eb82af4282d52e22f1
entry.updatePlayer(this.getHandle()); entry.updatePlayer(this.getHandle());
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aaeab128b26 100644 index f67ec3f5f4b7e2f678609f2387cc8afa2adce161..26b28f00f1867b9ceae887bfe0f30d3a55576399 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -246,8 +246,8 @@ import org.bukkit.potion.PotionEffect; @@ -243,8 +243,8 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
public class CraftEventFactory { public class CraftEventFactory {
@ -22684,7 +22756,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
// helper methods // helper methods
private static boolean canBuild(ServerLevel world, Player player, int x, int z) { private static boolean canBuild(ServerLevel world, Player player, int x, int z) {
@@ -920,7 +920,7 @@ public class CraftEventFactory { @@ -917,7 +917,7 @@ public class CraftEventFactory {
return CraftEventFactory.handleBlockSpreadEvent(world, source, target, block, 2); return CraftEventFactory.handleBlockSpreadEvent(world, source, target, block, 2);
} }
@ -22693,7 +22765,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
public static boolean handleBlockSpreadEvent(LevelAccessor world, BlockPos source, BlockPos target, net.minecraft.world.level.block.state.BlockState block, int flag) { public static boolean handleBlockSpreadEvent(LevelAccessor world, BlockPos source, BlockPos target, net.minecraft.world.level.block.state.BlockState block, int flag) {
// Suppress during worldgen // Suppress during worldgen
@@ -932,7 +932,7 @@ public class CraftEventFactory { @@ -929,7 +929,7 @@ public class CraftEventFactory {
CraftBlockState state = CraftBlockStates.getBlockState(world, target, flag); CraftBlockState state = CraftBlockStates.getBlockState(world, target, flag);
state.setData(block); state.setData(block);
@ -22702,7 +22774,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@@ -1059,8 +1059,8 @@ public class CraftEventFactory { @@ -1056,8 +1056,8 @@ public class CraftEventFactory {
private static EntityDamageEvent handleEntityDamageEvent(Entity entity, DamageSource source, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) { private static EntityDamageEvent handleEntityDamageEvent(Entity entity, DamageSource source, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) {
if (source.is(DamageTypeTags.IS_EXPLOSION)) { if (source.is(DamageTypeTags.IS_EXPLOSION)) {
DamageCause damageCause; DamageCause damageCause;
@ -22713,7 +22785,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
EntityDamageEvent event; EntityDamageEvent event;
if (damager == null) { if (damager == null) {
event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState); // Paper - handle block state in damage event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState); // Paper - handle block state in damage
@@ -1121,13 +1121,13 @@ public class CraftEventFactory { @@ -1118,13 +1118,13 @@ public class CraftEventFactory {
} }
return event; return event;
} else if (source.is(DamageTypes.LAVA)) { } else if (source.is(DamageTypes.LAVA)) {
@ -22731,7 +22803,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
if (!event.isCancelled()) { if (!event.isCancelled()) {
event.getEntity().setLastDamageCause(event); event.getEntity().setLastDamageCause(event);
@@ -1135,9 +1135,9 @@ public class CraftEventFactory { @@ -1132,9 +1132,9 @@ public class CraftEventFactory {
entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
} }
return event; return event;
@ -22743,7 +22815,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.STALAGMITE) || source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_ANVIL)) { if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.STALAGMITE) || source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_ANVIL)) {
cause = DamageCause.CONTACT; cause = DamageCause.CONTACT;
} else if (source.is(DamageTypes.HOT_FLOOR)) { } else if (source.is(DamageTypes.HOT_FLOOR)) {
@@ -1152,9 +1152,9 @@ public class CraftEventFactory { @@ -1149,9 +1149,9 @@ public class CraftEventFactory {
EntityDamageEvent event = new EntityDamageByBlockEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions); EntityDamageEvent event = new EntityDamageByBlockEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions);
event.setCancelled(cancelled); event.setCancelled(cancelled);
@ -22755,7 +22827,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
if (!event.isCancelled()) { if (!event.isCancelled()) {
event.getEntity().setLastDamageCause(event); event.getEntity().setLastDamageCause(event);
@@ -1162,10 +1162,10 @@ public class CraftEventFactory { @@ -1159,10 +1159,10 @@ public class CraftEventFactory {
entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
} }
return event; return event;
@ -22769,7 +22841,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..43ed483add05ddeafdc5a3595a212aae
if (source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_BLOCK) || source.is(DamageTypes.FALLING_ANVIL)) { if (source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_BLOCK) || source.is(DamageTypes.FALLING_ANVIL)) {
cause = DamageCause.FALLING_BLOCK; cause = DamageCause.FALLING_BLOCK;
} else if (damager instanceof LightningStrike) { } else if (damager instanceof LightningStrike) {
@@ -2134,7 +2134,7 @@ public class CraftEventFactory { @@ -2131,7 +2131,7 @@ public class CraftEventFactory {
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemStack.copyWithCount(1)); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemStack.copyWithCount(1));
org.bukkit.event.block.BlockDispenseEvent event = new org.bukkit.event.block.BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(to.getX(), to.getY(), to.getZ())); org.bukkit.event.block.BlockDispenseEvent event = new org.bukkit.event.block.BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(to.getX(), to.getY(), to.getZ()));

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Max pending logins
Should help the floodgates on launch Should help the floodgates on launch
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index d0f7434164f6241ec81c990c7a127f504e019291..8586df59afd0af51721a0950c7bf4582092417fc 100644 index 54aa8ac790f7d23d6404d037105642ddddb7839b..c18fc39db6480f0942128a5512970fdce074b7c6 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -89,7 +89,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -89,7 +89,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

View File

@ -897,10 +897,10 @@ index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..9fc90b162aab15a9cd60b02aba563181
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index cd29fa29fa65060c21c715bd756c5a35429eeb96..c46d00843f4a1a1c482f18856a846c09eff30293 100644 index 9a4a7bae17dd554aeeffb0ec4cb0876ef797e097..a47939461fcf3ba9aabcf66d1db9738b9785314a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -845,7 +845,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -490,7 +490,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@Override @Override
public UUID getUniqueId() { public UUID getUniqueId() {
@ -909,7 +909,7 @@ index cd29fa29fa65060c21c715bd756c5a35429eeb96..c46d00843f4a1a1c482f18856a846c09
} }
@Override @Override
@@ -860,6 +860,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -505,6 +505,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }
public Entity getHandle() { public Entity getHandle() {
@ -1359,10 +1359,10 @@ index 8746f80d08df5501b32958eb123aa7d814573ddf..c6c6eb55f4649e18beef9832c2ea7b9d
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 8a1e765363aeb61078fd23980d3856dc680cb05e..98f2be104eb2882f8c841a637ba821d96e0bf6bd 100644 index c3dbcb317b7d366feb31f707ad1199c60169f07f..8f32a00e65254acb4752ae55fee86bc05964c13e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -292,8 +292,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -291,8 +291,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
this.mode = mode; this.mode = mode;
} }
@ -1590,10 +1590,10 @@ index 70b377c03346cb8573827aeb493f3b6eb8efb1f8..b2e8c26162dd5782a0447cd03ca00fb4
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index ba2cd9c4cdbd5ddab1300320d7e0ede4d4b7a31a..66edfd724275c06b58d0a4a5fb5e484257850e36 100644 index 25ffc92c3d6055285a64d9fe36c0054228fe81dd..f2360767907480b64fd51ac3156932b9bf8ee609 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -418,6 +418,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -417,6 +417,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().invulnerableTime = ticks; this.getHandle().invulnerableTime = ticks;
} }
@ -1607,7 +1607,7 @@ index ba2cd9c4cdbd5ddab1300320d7e0ede4d4b7a31a..66edfd724275c06b58d0a4a5fb5e4842
@Override @Override
public int getNoActionTicks() { public int getNoActionTicks() {
return this.getHandle().getNoActionTime(); return this.getHandle().getNoActionTime();
@@ -431,6 +438,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -430,6 +437,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@Override @Override
public net.minecraft.world.entity.LivingEntity getHandle() { public net.minecraft.world.entity.LivingEntity getHandle() {
@ -2130,10 +2130,10 @@ index 2638c341bc02f201f7ab17fdebcdbdf3a7ec05bf..0f5c2d31a2dea13a46ba81e353393633
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 374a845acc6b12eb82af4282d52e22f1291f77f7..7a8762a35cb47f86c64be00c220a997c8f9f5108 100644 index 0566674223e16e34eaa4ab1d21e0e060bd0aeee5..fca4f9a50e57a2b40c7bca92d975b72da1075fa3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -619,7 +619,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -616,7 +616,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void kick(net.kyori.adventure.text.Component message, org.bukkit.event.player.PlayerKickEvent.Cause cause) { public void kick(net.kyori.adventure.text.Component message, org.bukkit.event.player.PlayerKickEvent.Cause cause) {
@ -2142,7 +2142,7 @@ index 374a845acc6b12eb82af4282d52e22f1291f77f7..7a8762a35cb47f86c64be00c220a997c
final ServerGamePacketListenerImpl connection = this.getHandle().connection; final ServerGamePacketListenerImpl connection = this.getHandle().connection;
if (connection != null) { if (connection != null) {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause); connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause);
@@ -2162,9 +2162,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2159,9 +2159,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this; return this;
} }
@ -2160,7 +2160,7 @@ index 374a845acc6b12eb82af4282d52e22f1291f77f7..7a8762a35cb47f86c64be00c220a997c
} }
public void setHandle(final ServerPlayer entity) { public void setHandle(final ServerPlayer entity) {
@@ -3162,7 +3169,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3172,7 +3179,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
{ {
if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() ) if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() )
{ {
@ -2234,10 +2234,10 @@ index 35a8219734633529325430810e88755b2dd23125..85ebd34ed143304c603078f2e949179a
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java
index eb7e2902dc134847711284dd2af8abda7627c7ab..9fd64b06e973527e6fb808cc836490f75dfb9bea 100644 index 519ef701a7d6534f7cb516f6296b95ee521f661d..effbc1a3ef8c6c9cd424f49b8bfce05d40e0772a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java
@@ -11,8 +11,16 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { @@ -10,8 +10,16 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
super(server, entity); super(server, entity);
} }

View File

@ -10,7 +10,7 @@ the impact from scaling the region threads, but is not a fix
to the underlying issue. to the underlying issue.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 99a086ed2c0d5615a55539a31b8cd8483569e9c0..844424e7488eb42753f50e0e998aebf93c912877 100644 index ec1c5bf4b2e4a54e9df085331416bac0b42c601d..027d95e0763c6e18380b706fcd7f48c09a7cc17a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1469,6 +1469,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1469,6 +1469,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Throw UnsupportedOperationException() for broken APIs
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d2c8ad04c59035449dc798a637acc6e809d35fc4..7cbf625384f02e3c8c40a57cd5582ecaca4bd15c 100644 index 6e2bbd699d9b168ee9eb89461d588701c0511a24..bea388ced64da6192166f6f8461abdc0921ed7b0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1263,6 +1263,7 @@ public final class CraftServer implements Server { @@ -1264,6 +1264,7 @@ public final class CraftServer implements Server {
@Override @Override
public World createWorld(WorldCreator creator) { public World createWorld(WorldCreator creator) {
@ -16,7 +16,7 @@ index d2c8ad04c59035449dc798a637acc6e809d35fc4..7cbf625384f02e3c8c40a57cd5582eca
Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP"); Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP");
//Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper - Cat - Temp disable. We'll see how this goes. //Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper - Cat - Temp disable. We'll see how this goes.
Preconditions.checkArgument(creator != null, "WorldCreator cannot be null"); Preconditions.checkArgument(creator != null, "WorldCreator cannot be null");
@@ -1442,6 +1443,7 @@ public final class CraftServer implements Server { @@ -1443,6 +1444,7 @@ public final class CraftServer implements Server {
@Override @Override
public boolean unloadWorld(World world, boolean save) { public boolean unloadWorld(World world, boolean save) {
@ -25,7 +25,7 @@ index d2c8ad04c59035449dc798a637acc6e809d35fc4..7cbf625384f02e3c8c40a57cd5582eca
if (world == null) { if (world == null) {
return false; return false;
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
index 81889e30a634ac84d996f688d0a2466e9efa19ca..f2ad3247b512ed5115dea475035736eddc038c7e 100644 index bd8a5bb2b84daf013750aec9887dcb4b02b382ad..299e7290fea260d739687be70a796c5a4add325b 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
@@ -45,6 +45,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { @@ -45,6 +45,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {

View File

@ -1376,7 +1376,7 @@ index 98fb69a9adeb6eaab199aec127692acb07f56808..7cc624505931dcb6696c3ef3ee3bbea7
label25: label25:
{ {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 844424e7488eb42753f50e0e998aebf93c912877..d04862c5f06bafb67b055959ddfe8334914cf5c7 100644 index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba3bddf06a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1585,6 +1585,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1585,6 +1585,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -1436,7 +1436,7 @@ index 844424e7488eb42753f50e0e998aebf93c912877..d04862c5f06bafb67b055959ddfe8334
this.profiler.pop(); this.profiler.pop();
// Paper end // Paper end
io.papermc.paper.util.CachedLists.reset(); // Paper io.papermc.paper.util.CachedLists.reset(); // Paper
@@ -1748,6 +1762,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1730,6 +1744,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void tickChildren(BooleanSupplier shouldKeepTicking, io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - region threading public void tickChildren(BooleanSupplier shouldKeepTicking, io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - region threading
@ -1444,7 +1444,7 @@ index 844424e7488eb42753f50e0e998aebf93c912877..d04862c5f06bafb67b055959ddfe8334
final io.papermc.paper.threadedregions.RegionizedWorldData regionizedWorldData = io.papermc.paper.threadedregions.TickRegionScheduler.getCurrentRegionizedWorldData(); // Folia - regionised ticking final io.papermc.paper.threadedregions.RegionizedWorldData regionizedWorldData = io.papermc.paper.threadedregions.TickRegionScheduler.getCurrentRegionizedWorldData(); // Folia - regionised ticking
if (region == null) this.getPlayerList().getPlayers().forEach((entityplayer) -> { // Folia - region threading if (region == null) this.getPlayerList().getPlayers().forEach((entityplayer) -> { // Folia - region threading
entityplayer.connection.suspendFlushing(); entityplayer.connection.suspendFlushing();
@@ -1814,12 +1829,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1796,12 +1811,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
worldserver.timings.doTick.startTiming(); // Spigot worldserver.timings.doTick.startTiming(); // Spigot

View File

@ -1,2 +1,2 @@
- Fix compile
- Tick rate manager - what to do with you (also: check tickChunks [specifically inhabited time] with respect to how this works now) - Tick rate manager - what to do with you (also: check tickChunks [specifically inhabited time] with respect to how this works now)
- Change chunk system autosave to use nanoTime instead of ticks to account for variable tick rate