2019-03-03 04:51:21 +01:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2019-12-25 04:19:49 +01:00
|
|
|
import com.massivecraft.factions.*;
|
2019-09-14 21:13:01 +02:00
|
|
|
import com.massivecraft.factions.shop.ShopConfig;
|
2019-03-03 04:51:21 +01:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdSaveAll extends FCommand {
|
|
|
|
|
2019-12-02 19:55:38 +01:00
|
|
|
/**
|
|
|
|
* @author FactionsUUID Team
|
|
|
|
*/
|
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public CmdSaveAll() {
|
|
|
|
super();
|
2020-01-02 02:59:31 +01:00
|
|
|
this.aliases.addAll(Aliases.saveAll);
|
2019-08-24 19:18:50 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.SAVE)
|
|
|
|
.build();
|
|
|
|
}
|
2019-08-24 19:18:50 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
@Override
|
|
|
|
public void perform(CommandContext context) {
|
|
|
|
FPlayers.getInstance().forceSave(false);
|
|
|
|
Factions.getInstance().forceSave(false);
|
|
|
|
Board.getInstance().forceSave(false);
|
|
|
|
Conf.save();
|
2019-12-25 04:19:49 +01:00
|
|
|
try {
|
|
|
|
FactionsPlugin.instance.getFlogManager().saveLogs();
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2019-09-15 11:19:06 +02:00
|
|
|
ShopConfig.saveShop();
|
|
|
|
context.msg(TL.COMMAND_SAVEALL_SUCCESS);
|
|
|
|
}
|
2019-08-24 19:18:50 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_SAVEALL_DESCRIPTION;
|
|
|
|
}
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2011-10-10 01:21:05 +02:00
|
|
|
}
|