From d7cec38c385e83c155a47fa970e223361de3d9a9 Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Sun, 15 Jan 2012 11:11:25 +0100 Subject: [PATCH] Adding the option to suppress overload warnings as a bukkit.yml option. Thanks oloflarsson for the PR. --- src/main/java/net/minecraft/server/MinecraftServer.java | 1 + src/main/java/org/bukkit/craftbukkit/CraftServer.java | 4 ++++ src/main/resources/configurations/bukkit.yml | 1 + 3 files changed, 6 insertions(+) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 94ab57fce7..fc844a3a44 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -412,6 +412,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe long l = k - i; if (l > 2000L) { + if (this.server.getWarnOnOverload()) // CraftBukkit - Adding an option to suppress these warning messages log.warning("Can\'t keep up! Did the system time change, or is the server overloaded?"); l = 2000L; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index c7462d2a34..d1c5fb2e84 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -321,6 +321,10 @@ public final class CraftServer implements Server { return this.getConfigBoolean("allow-nether", true); } + public boolean getWarnOnOverload() { + return this.configuration.getBoolean("settings.warn-on-overload"); + } + public boolean hasWhitelist() { return this.getConfigBoolean("white-list", false); } diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml index 3dc5707dba..392ca9c0ac 100644 --- a/src/main/resources/configurations/bukkit.yml +++ b/src/main/resources/configurations/bukkit.yml @@ -15,6 +15,7 @@ settings: allow-end: true + warn-on-overload: true spawn-radius: 16 permissions-file: permissions.yml update-folder: update