Add auto-save plugin redundancy detection.

This change will print a warning when a plugin induces a forced save. A
player or console forcing a save (via a command) is ignored for purposes
of printing a warning.
This commit is contained in:
Wesley Wolfe
2013-09-23 16:43:21 -05:00
committed by EvilSeph
parent de16ba6eec
commit bd1389895b
3 changed files with 26 additions and 1 deletions

View File

@@ -831,7 +831,16 @@ public class PlayerConnection extends Connection {
return;
}
this.chat(s, packet3chat.a_());
if (!packet3chat.a_()) {
try {
this.minecraftServer.server.playerCommandState = true;
this.chat(s, packet3chat.a_());
} finally {
this.minecraftServer.server.playerCommandState = false;
}
} else {
this.chat(s, packet3chat.a_());
}
// This section stays because it is only applicable to packets
if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getName())) { // CraftBukkit use thread-safe spam