mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-28 11:28:11 +01:00
Shutdown logging to file in a clean way if the plugin gets disabled
This commit is contained in:
parent
7390acdd39
commit
467fb90ad1
@ -3,7 +3,7 @@ name: NoCheat
|
||||
author: Evenprime
|
||||
|
||||
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
||||
version: 0.8.3a
|
||||
version: 0.8.3b
|
||||
|
||||
commands:
|
||||
nocheat:
|
||||
|
@ -161,6 +161,10 @@ public class NoCheat extends JavaPlugin {
|
||||
public void onDisable() {
|
||||
|
||||
PluginDescriptionFile pdfFile = this.getDescription();
|
||||
|
||||
if(config != null)
|
||||
config.cleanup();
|
||||
|
||||
Logger.getLogger("Minecraft").info( "[NoCheat] version [" + pdfFile.getVersion() + "] is disabled.");
|
||||
}
|
||||
|
||||
|
@ -123,6 +123,21 @@ public class NoCheatConfiguration {
|
||||
plugin.airbuildCheck.setActive(c.getBoolean("active.airbuild", plugin.airbuildCheck.isActive()));
|
||||
plugin.bedteleportCheck.setActive(c.getBoolean("active.bedteleport", plugin.bedteleportCheck.isActive()));
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
|
||||
if(fh != null) {
|
||||
try {
|
||||
logger.removeHandler(fh);
|
||||
fh.flush();
|
||||
fh.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Action[] stringToActions(String string, Action[] def) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user