mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 12:12:08 -07:00
Prevent day cycle on the client when using fixed time (#11924)
This commit is contained in:
@@ -984,7 +984,7 @@
|
||||
ObjectArrayList<GameProfile> list = new ObjectArrayList<>(min);
|
||||
int randomInt = Mth.nextInt(this.random, 0, players.size() - min);
|
||||
|
||||
@@ -1046,17 +_,65 @@
|
||||
@@ -1046,17 +_,66 @@
|
||||
protected void tickChildren(BooleanSupplier hasTimeLeft) {
|
||||
ProfilerFiller profilerFiller = Profiler.get();
|
||||
this.getPlayerList().getPlayers().forEach(serverPlayer1 -> serverPlayer1.connection.suspendFlushing());
|
||||
@@ -1027,8 +1027,9 @@
|
||||
+ }
|
||||
+ ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||
+ long playerTime = entityplayer.getPlayerTime();
|
||||
+ ClientboundSetTimePacket packet = (playerTime == dayTime) ? worldPacket :
|
||||
+ new ClientboundSetTimePacket(worldTime, playerTime, doDaylight);
|
||||
+ boolean relativeTime = entityplayer.relativeTime;
|
||||
+ ClientboundSetTimePacket packet = ((relativeTime || !doDaylight) && playerTime == dayTime) ? worldPacket :
|
||||
+ new ClientboundSetTimePacket(worldTime, playerTime, relativeTime && doDaylight);
|
||||
+ entityplayer.connection.send(packet); // Add support for per player time
|
||||
+ // Paper end - Perf: Optimize time updates
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user