Fix issue on reloading.

This commit is contained in:
asofold 2012-09-04 06:03:43 +02:00
parent e506e7f2d0
commit d7525bd73c

View File

@ -83,6 +83,9 @@ public class NoCheatPlus extends JavaPlugin implements Listener {
// Just to be sure nothing gets left out. // Just to be sure nothing gets left out.
getServer().getScheduler().cancelTasks(this); getServer().getScheduler().cancelTasks(this);
// Remove listeners.
listeners.clear();
// Tell the server administrator the we finished unloading NoCheatPlus. // Tell the server administrator the we finished unloading NoCheatPlus.
System.out.println("[NoCheatPlus] Version " + pdfFile.getVersion() + " is disabled."); System.out.println("[NoCheatPlus] Version " + pdfFile.getVersion() + " is disabled.");
@ -104,6 +107,7 @@ public class NoCheatPlus extends JavaPlugin implements Listener {
ConfigManager.init(this); ConfigManager.init(this);
// List the events listeners. // List the events listeners.
listeners.clear();
listeners.add(new BlockBreakListener()); listeners.add(new BlockBreakListener());
listeners.add(new BlockInteractListener()); listeners.add(new BlockInteractListener());
listeners.add(new BlockPlaceListener()); listeners.add(new BlockPlaceListener());