Move watchdog and timings code to tick method, not tick loop itself.

By: md_5 <git@md-5.net>
This commit is contained in:
Spigot
2014-01-22 19:23:59 +11:00
parent 975187b00f
commit df37e6e342
7 changed files with 45 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
From ebd2fb5ffe43e048d383ee3d2be17c8bac908656 Mon Sep 17 00:00:00 2001
From 9d257eb2927d480f108701500d0a300d1ecd617d Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 12 Jan 2014 21:07:18 +1100
Subject: [PATCH] Replace AutoSave Mechanism
@@ -6,10 +6,10 @@ Subject: [PATCH] Replace AutoSave Mechanism
The problem here is that MinecraftServer.save(..), will attempt to sleep whilst all pending chunks are written to disk, however due to various and complicated bugs, it will wait for an incorrect amount of chunks, which may cause it to sleep for an overly long amount of time. Instead we will mimic the save-all command in its behaviour, which is both safe and performant.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index eb7d918..85e9e53 100644
index 7616d7b..588ce0a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -571,7 +571,16 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -568,7 +568,16 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
if ((this.autosavePeriod > 0) && ((this.ticks % this.autosavePeriod) == 0)) { // CraftBukkit
this.methodProfiler.a("save");
this.t.savePlayers();