If plugin failed to load correctly for various reasons, it could end up wiping the board or faction list. This should now be prevented.
An example: if you loaded 1.6.6 (not 1.6.6b) on CB 1.1-R6 or newer, it would trigger an exception at startup and cause this problem.
This commit is contained in:
@@ -78,7 +78,8 @@ public class P extends MPlugin
|
||||
public void onEnable()
|
||||
{
|
||||
if ( ! preEnable()) return;
|
||||
|
||||
this.loadSuccessful = false;
|
||||
|
||||
// Load Conf from disk
|
||||
Conf.load();
|
||||
FPlayers.i.loadFromDisc();
|
||||
@@ -112,6 +113,7 @@ public class P extends MPlugin
|
||||
getServer().getPluginManager().registerEvents(serverListener, this);
|
||||
|
||||
postEnable();
|
||||
this.loadSuccessful = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,8 +135,12 @@ public class P extends MPlugin
|
||||
@Override
|
||||
public void onDisable()
|
||||
{
|
||||
Board.save();
|
||||
Conf.save();
|
||||
// only save data if plugin actually completely loaded successfully
|
||||
if (this.loadSuccessful)
|
||||
{
|
||||
Board.save();
|
||||
Conf.save();
|
||||
}
|
||||
EssentialsFeatures.unhookChat();
|
||||
if (AutoLeaveTask != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user