mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-30 22:44:07 +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
|
@Override
|
||||||
public void disable() {
|
public void disable() {
|
||||||
try {
|
try {
|
||||||
|
listener.disable();
|
||||||
BlacklistEntry.forgetAllPlayers();
|
BlacklistEntry.forgetAllPlayers();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,11 @@ public void loadConfiguration() {
|
|||||||
|
|
||||||
// Load the blacklist
|
// Load the blacklist
|
||||||
try {
|
try {
|
||||||
|
// If there was an existing blacklist, close loggers
|
||||||
|
if (blacklist != null) {
|
||||||
|
blacklist.getLogger().close();
|
||||||
|
}
|
||||||
|
|
||||||
// First load the blacklist data from worldguard-blacklist.txt
|
// First load the blacklist data from worldguard-blacklist.txt
|
||||||
Blacklist blacklist = new Blacklist();
|
Blacklist blacklist = new Blacklist();
|
||||||
blacklist.load(new File("worldguard-blacklist.txt"));
|
blacklist.load(new File("worldguard-blacklist.txt"));
|
||||||
@ -636,4 +641,13 @@ public boolean canDestroyBlock(Player player, Block block) {
|
|||||||
plugin.toggleEnabled();
|
plugin.toggleEnabled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call to disable the plugin.
|
||||||
|
*/
|
||||||
|
public void disable() {
|
||||||
|
if (blacklist != null) {
|
||||||
|
blacklist.getLogger().close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user