mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-24 18:19:03 +01:00
Improved tick sync message suppression.
This commit is contained in:
parent
cc72d370ea
commit
ce1a15e6ea
@ -25,8 +25,8 @@
|
||||
|
||||
public class TickSyncDelayLoggerFilter implements Filter {
|
||||
public boolean isLoggable(LogRecord record) {
|
||||
if (record.getMessage().equals("Can't keep up! Did the system time change, or is the server overloaded?")
|
||||
&& record.getLevel() == Level.WARNING) {
|
||||
if (record.getLevel() == Level.WARNING
|
||||
&& record.getMessage().equals("Can't keep up! Did the system time change, or is the server overloaded?")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -167,6 +167,11 @@ public WorldGuardPlugin(PluginLoader pluginLoader, Server instance,
|
||||
|
||||
if (suppressTickSyncWarnings) {
|
||||
Logger.getLogger("Minecraft").setFilter(new TickSyncDelayLoggerFilter());
|
||||
} else {
|
||||
Filter filter = Logger.getLogger("Minecraft").getFilter();
|
||||
if (filter != null && filter instanceof TickSyncDelayLoggerFilter) {
|
||||
Logger.getLogger("Minecraft").setFilter(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user