diff options
author | KennyTV <[email protected]> | 2021-06-16 13:07:43 +0200 |
---|---|---|
committer | KennyTV <[email protected]> | 2021-06-16 13:07:43 +0200 |
commit | 2b8d06aed3a19559785c8956d672a9f8a50ca267 (patch) | |
tree | f17e2e849974dcdc3f4922da033a6138aaacb250 /patches/server/0288-Optimize-World-Time-Updates.patch | |
parent | 9e1255cff99dbbf43077985b3884cb2be4b878d6 (diff) | |
download | Paper-2b8d06aed3a19559785c8956d672a9f8a50ca267.tar.gz Paper-2b8d06aed3a19559785c8956d672a9f8a50ca267.zip |
Definitely readd this patch for the first time
Diffstat (limited to 'patches/server/0288-Optimize-World-Time-Updates.patch')
-rw-r--r-- | patches/server/0288-Optimize-World-Time-Updates.patch | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/patches/server/0288-Optimize-World-Time-Updates.patch b/patches/server/0288-Optimize-World-Time-Updates.patch deleted file mode 100644 index 13cfcd9d97..0000000000 --- a/patches/server/0288-Optimize-World-Time-Updates.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <[email protected]> -Date: Fri, 2 Nov 2018 23:11:51 -0400 -Subject: [PATCH] Optimize World Time Updates - -Splits time updates into incremental updates as well as does -the updates per world, so that we can re-use the same packet -object for every player unless they have per-player time enabled. - -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a302d232da3fbaa2cb3e1903cfd096d404847c54..a1c65ea148692e50dbc466d87dae5198e0b6a51f 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1387,12 +1387,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa - - MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper - // Send time updates to everyone, it will get the right time from the world the player is in. -- if (this.tickCount % 20 == 0) { -- for (int i = 0; i < this.getPlayerList().players.size(); ++i) { -- ServerPlayer entityplayer = (ServerPlayer) this.getPlayerList().players.get(i); -- entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time -+ // Paper start - optimize time updates -+ for (final ServerLevel world : this.getAllLevels()) { -+ final boolean doDaylight = world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT); -+ final long dayTime = world.getDayTime(); -+ long worldTime = world.getGameTime(); -+ final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight); -+ for (Player entityhuman : world.players()) { -+ if (!(entityhuman instanceof ServerPlayer) || (tickCount + entityhuman.getId()) % 20 != 0) { -+ continue; -+ } -+ ServerPlayer entityplayer = (ServerPlayer) entityhuman; -+ long playerTime = entityplayer.getPlayerTime(); -+ ClientboundSetTimePacket packet = (playerTime == dayTime) ? worldPacket : -+ new ClientboundSetTimePacket(worldTime, playerTime, doDaylight); -+ entityplayer.connection.send(packet); // Add support for per player time - } - } -+ // Paper end - MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper - - while (iterator.hasNext()) { |