Sync MConf at once on update. Also don't transfer 0 money on disband.

This commit is contained in:
Olof Larsson 2014-09-18 00:18:07 +02:00
parent 07ab309e1c
commit a4ff2abd5c
2 changed files with 5 additions and 1 deletions

View File

@ -62,7 +62,9 @@ public class FactionsListenerEcon implements Listener
if (oldFaction.getMPlayers().size() > 1) return; if (oldFaction.getMPlayers().size() > 1) return;
// ... then transfer all money to the player. // ... then transfer all money to the player.
Econ.transferMoney(mplayer, oldFaction, mplayer, Money.get(oldFaction)); double money = Money.get(oldFaction);
if (money == 0) return;
Econ.transferMoney(mplayer, oldFaction, mplayer, money);
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -45,6 +45,8 @@ public class UpdateUtil
// ... transfer the old uconf data over to the new mconf ... // ... transfer the old uconf data over to the new mconf ...
oldConf.transferTo(MConf.get()); oldConf.transferTo(MConf.get());
MConf.get().changed();
MConf.get().sync();
// ... rename target collections ... // ... rename target collections ...
Db db = MStore.getDb(); Db db = MStore.getDb();