Set default update rate to 43200 seconds instead.
Dieser Commit ist enthalten in:
Ursprung
5e6a6f6a95
Commit
003bc927a4
@ -24,7 +24,7 @@ class ProtocolConfig {
|
||||
private static final String UPDATER_LAST_TIME = "last";
|
||||
|
||||
// Defaults
|
||||
private static final long DEFAULT_UPDATER_DELAY = 60;
|
||||
private static final long DEFAULT_UPDATER_DELAY = 43200;
|
||||
|
||||
private Plugin plugin;
|
||||
private Configuration config;
|
||||
@ -47,7 +47,7 @@ class ProtocolConfig {
|
||||
*/
|
||||
public void reloadConfig() {
|
||||
this.config = plugin.getConfig();
|
||||
loadSections(true);
|
||||
loadSections(!loadingSections);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,9 +55,6 @@ class ProtocolConfig {
|
||||
* @param copyDefaults - whether or not to copy configuration defaults.
|
||||
*/
|
||||
private void loadSections(boolean copyDefaults) {
|
||||
if (loadingSections)
|
||||
return;
|
||||
|
||||
if (config != null) {
|
||||
global = config.getConfigurationSection(SECTION_GLOBAL);
|
||||
}
|
||||
@ -72,10 +69,8 @@ class ProtocolConfig {
|
||||
if (config != null)
|
||||
config.options().copyDefaults(true);
|
||||
plugin.saveDefaultConfig();
|
||||
config = plugin.getConfig();
|
||||
|
||||
plugin.reloadConfig();
|
||||
loadingSections = false;
|
||||
loadSections(false);
|
||||
|
||||
// Inform the user
|
||||
System.out.println("[ProtocolLib] Created default configuration.");
|
||||
|
@ -128,6 +128,7 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
@Override
|
||||
public void reloadConfig() {
|
||||
super.reloadConfig();
|
||||
|
||||
// Reload configuration
|
||||
if (config != null) {
|
||||
config.reloadConfig();
|
||||
@ -242,8 +243,10 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
long currentTime = System.currentTimeMillis() / MILLI_PER_SECOND;
|
||||
|
||||
try {
|
||||
long updateTime = config.getAutoLastTime() + config.getAutoDelay();
|
||||
|
||||
// Should we update?
|
||||
if (currentTime > config.getAutoLastTime() + config.getAutoDelay()) {
|
||||
if (currentTime > updateTime) {
|
||||
// Initiate the update as if it came from the console
|
||||
if (config.isAutoDownload())
|
||||
commandProtocol.updateVersion(getServer().getConsoleSender());
|
||||
|
@ -27,7 +27,6 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.injector.PlayerLoggedOutException;
|
||||
import com.comphenix.protocol.injector.SortedPacketListenerList;
|
||||
import com.comphenix.protocol.reflect.FieldAccessException;
|
||||
|
||||
/**
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren