Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-20 05:20:07 +01:00
Stop sending multiple time packets to each client
Dieser Commit ist enthalten in:
Ursprung
e08535d688
Commit
a2957c7b8f
@ -436,20 +436,27 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
|||||||
Vec3D.a();
|
Vec3D.a();
|
||||||
++this.ticks;
|
++this.ticks;
|
||||||
|
|
||||||
((CraftScheduler) this.server.getScheduler()).mainThreadHeartbeat(this.ticks); // CraftBukkit
|
// CraftBukkit start - only send timeupdates to the people in that world
|
||||||
|
|
||||||
for (j = 0; j < this.worlds.size(); ++j) { // CraftBukkit
|
((CraftScheduler) this.server.getScheduler()).mainThreadHeartbeat(this.ticks);
|
||||||
// if (j == 0 || this.propertyManager.getBoolean("allow-nether", true)) { // CraftBukkit
|
|
||||||
WorldServer worldserver = this.worlds.get(j); // CraftBukkit
|
|
||||||
|
|
||||||
|
// Send timeupdates to everyone, it will get the right time from the world the player is in.
|
||||||
|
if (this.ticks % 20 == 0) {
|
||||||
|
for (int i = 0; i < this.serverConfigurationManager.players.size(); ++i) {
|
||||||
|
EntityPlayer entityplayer = (EntityPlayer) this.serverConfigurationManager.players.get(i);
|
||||||
|
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(entityplayer.getPlayerTime())); // Add support for per player time
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < this.worlds.size(); ++j) {
|
||||||
|
// if (j == 0 || this.propertyManager.getBoolean("allow-nether", true)) {
|
||||||
|
WorldServer worldserver = this.worlds.get(j);
|
||||||
|
|
||||||
|
/* Drop global timeupdates
|
||||||
if (this.ticks % 20 == 0) {
|
if (this.ticks % 20 == 0) {
|
||||||
// CraftBukkit start - only send timeupdates to the people in that world
|
this.serverConfigurationManager.a(new Packet4UpdateTime(worldserver.getTime()), worldserver.worldProvider.dimension);
|
||||||
for (int i = 0; i < this.serverConfigurationManager.players.size(); ++i) {
|
|
||||||
EntityPlayer entityplayer = (EntityPlayer) this.serverConfigurationManager.players.get(i);
|
|
||||||
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(entityplayer.getPlayerTime())); // Add support for per player time
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
}
|
||||||
|
// CraftBukkit end */
|
||||||
|
|
||||||
worldserver.doTick();
|
worldserver.doTick();
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren