mirror of
https://github.com/PaperMC/Folia.git
synced 2025-01-03 18:47:36 +01:00
Only update time for local players in time update tick
This was done in 1.19.4, but the diff to use getLocalPlayers() was dropped by accident. Fixes https://github.com/PaperMC/Folia/issues/114
This commit is contained in:
parent
d1c9e63470
commit
eb2231736b
@ -11513,7 +11513,7 @@ index d2f0a0755317f5fa9a1ccf7db346aa77fd287d80..b07df826a3028c14b48b09dbaeccc907
|
||||
// CraftBukkit start - SPIGOT-5477, MC-142590
|
||||
} else if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c7a762abdfdc88fd26ec751c34e7b42bb3514515..26d332a46556416bb70b6276786b43e1a8ec8449 100644
|
||||
index c7a762abdfdc88fd26ec751c34e7b42bb3514515..c772f5f48b1f0be2c55846154684a5d98f1267b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -242,7 +242,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@ -12006,8 +12006,9 @@ index c7a762abdfdc88fd26ec751c34e7b42bb3514515..26d332a46556416bb70b6276786b43e1
|
||||
final long dayTime = level.getDayTime();
|
||||
long worldTime = level.getGameTime();
|
||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||
for (Player entityhuman : level.players()) {
|
||||
- for (Player entityhuman : level.players()) {
|
||||
- if (!(entityhuman instanceof ServerPlayer) || (tickCount + entityhuman.getId()) % 20 != 0) {
|
||||
+ for (Player entityhuman : level.getLocalPlayers()) { // Folia - region threading
|
||||
+ if (!(entityhuman instanceof ServerPlayer) || (io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick() + entityhuman.getId()) % 20 != 0) { // Folia - region threading
|
||||
continue;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ the impact from scaling the region threads, but is not a fix
|
||||
to the underlying issue.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 26d332a46556416bb70b6276786b43e1a8ec8449..11ff1bc559316da426070867f045720ebd8c1962 100644
|
||||
index c772f5f48b1f0be2c55846154684a5d98f1267b9..d307826380c4bd47ee4602813737a11339cb8357 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2875,6 +2875,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
Loading…
Reference in New Issue
Block a user