mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 21:15:57 +01:00
WorldGuard should now close loggers on disable and reload.
This commit is contained in:
parent
e543ac733f
commit
b7e5828c3f
@ -90,6 +90,7 @@ public void enable() {
|
||||
@Override
|
||||
public void disable() {
|
||||
try {
|
||||
listener.disable();
|
||||
BlacklistEntry.forgetAllPlayers();
|
||||
} catch (Throwable t) {
|
||||
}
|
||||
|
@ -154,6 +154,11 @@ public void loadConfiguration() {
|
||||
|
||||
// Load the blacklist
|
||||
try {
|
||||
// If there was an existing blacklist, close loggers
|
||||
if (blacklist != null) {
|
||||
blacklist.getLogger().close();
|
||||
}
|
||||
|
||||
// First load the blacklist data from worldguard-blacklist.txt
|
||||
Blacklist blacklist = new Blacklist();
|
||||
blacklist.load(new File("worldguard-blacklist.txt"));
|
||||
@ -636,4 +641,13 @@ public boolean canDestroyBlock(Player player, Block block) {
|
||||
plugin.toggleEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call to disable the plugin.
|
||||
*/
|
||||
public void disable() {
|
||||
if (blacklist != null) {
|
||||
blacklist.getLogger().close();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user