mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-03 19:00:30 +02:00
[Bleeding] Prepare something for handling reload better, later.
This commit is contained in:
parent
ee3e3bb431
commit
fbc85de617
|
@ -459,16 +459,16 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
||||||
new InventoryListener(),
|
new InventoryListener(),
|
||||||
new MovingListener(),
|
new MovingListener(),
|
||||||
new INotifyReload() {
|
new INotifyReload() {
|
||||||
@Override
|
@Override
|
||||||
public void onReload() {
|
public void onReload() {
|
||||||
// Only for reloading, not INeedConfig.
|
// Only for reloading, not INeedConfig.
|
||||||
BlockProperties.init();
|
BlockProperties.init();
|
||||||
final ConfigFile config = ConfigManager.getConfigFile();
|
final ConfigFile config = ConfigManager.getConfigFile();
|
||||||
BlockProperties.applyConfig(config, ConfPaths.COMPATIBILITY_BLOCKS);
|
BlockProperties.applyConfig(config, ConfPaths.COMPATIBILITY_BLOCKS);
|
||||||
undoCommandChanges();
|
undoCommandChanges();
|
||||||
if (config.getBoolean(ConfPaths.MISCELLANEOUS_PROTECTPLUGINS)) setupCommandProtection();
|
if (config.getBoolean(ConfPaths.MISCELLANEOUS_PROTECTPLUGINS)) setupCommandProtection();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}){
|
}){
|
||||||
addComponent(obj);
|
addComponent(obj);
|
||||||
}
|
}
|
||||||
|
@ -556,10 +556,34 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Care for already online players.
|
||||||
|
final Player[] onlinePlayers = getServer().getOnlinePlayers();
|
||||||
|
// TODO: remap exemptionmanager !
|
||||||
|
// TODO: Disable all checks for these players for one tick !
|
||||||
|
// TODO: Prepare check data for players [problem: permissions]?
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
postEnable(onlinePlayers);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Tell the server administrator that we finished loading NoCheatPlus now.
|
// Tell the server administrator that we finished loading NoCheatPlus now.
|
||||||
LogUtil.logInfo("[NoCheatPlus] Version " + getDescription().getVersion() + " is enabled.");
|
LogUtil.logInfo("[NoCheatPlus] Version " + getDescription().getVersion() + " is enabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Actions to be done after enable of all plugins. This aims at reloading mainly.
|
||||||
|
*/
|
||||||
|
private void postEnable(final Player[] onlinePlayers){
|
||||||
|
for (final Player player : onlinePlayers){
|
||||||
|
updatePermStateReceivers(player);
|
||||||
|
}
|
||||||
|
// TODO: if (online.lenght > 0) LogUtils.logInfo("[NCP] Updated " + online.length + "players (post-enable).")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// public void onPlayerJoinLow(final PlayerJoinEvent event) {
|
// public void onPlayerJoinLow(final PlayerJoinEvent event) {
|
||||||
// /*
|
// /*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user