mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-30 14:33:47 +01:00
Added suppress-tick-sync-warnings option.
This commit is contained in:
parent
d042185660
commit
cc72d370ea
@ -21,6 +21,8 @@
|
||||
|
||||
summary-on-start: on
|
||||
|
||||
suppress-tick-sync-warnings: false
|
||||
|
||||
protection:
|
||||
enforce-single-session: on
|
||||
item-durability: on
|
||||
|
35
src/com/sk89q/worldguard/TickSyncDelayLoggerFilter.java
Normal file
35
src/com/sk89q/worldguard/TickSyncDelayLoggerFilter.java
Normal file
@ -0,0 +1,35 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldGuard
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldguard;
|
||||
|
||||
import java.util.logging.Filter;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
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) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldguard.LocalPlayer;
|
||||
import com.sk89q.worldguard.TickSyncDelayLoggerFilter;
|
||||
import com.sk89q.worldguard.blacklist.*;
|
||||
import com.sk89q.worldguard.blacklist.loggers.*;
|
||||
import com.sk89q.worldguard.domains.DefaultDomain;
|
||||
@ -92,6 +93,8 @@ public class WorldGuardPlugin extends JavaPlugin {
|
||||
|
||||
// Configuration follows
|
||||
|
||||
boolean suppressTickSyncWarnings;
|
||||
|
||||
boolean enforceOneSession;
|
||||
boolean itemDurability;
|
||||
|
||||
@ -161,6 +164,10 @@ public WorldGuardPlugin(PluginLoader pluginLoader, Server instance,
|
||||
loadConfiguration();
|
||||
postReload();
|
||||
registerEvents();
|
||||
|
||||
if (suppressTickSyncWarnings) {
|
||||
Logger.getLogger("Minecraft").setFilter(new TickSyncDelayLoggerFilter());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -262,6 +269,8 @@ public void loadConfiguration() {
|
||||
Configuration config = getConfiguration();
|
||||
config.load();
|
||||
perms.load();
|
||||
|
||||
suppressTickSyncWarnings = config.getBoolean("suppress-tick-sync-warnings", false);
|
||||
|
||||
enforceOneSession = config.getBoolean("protection.enforce-single-session", true);
|
||||
itemDurability = config.getBoolean("protection.item-durability", true);
|
||||
|
Loading…
Reference in New Issue
Block a user