Saber-Factions/src/main/java/com/massivecraft/factions/cmd/CmdSaveAll.java

42 lines
1.1 KiB
Java
Raw Normal View History

package com.massivecraft.factions.cmd;
2019-12-25 04:19:49 +01:00
import com.massivecraft.factions.*;
import com.massivecraft.factions.shop.ShopConfig;
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
*/
public CmdSaveAll() {
super();
this.aliases.addAll(Aliases.saveAll);
this.requirements = new CommandRequirements.Builder(Permission.SAVE)
.build();
}
@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();
}
ShopConfig.saveShop();
context.msg(TL.COMMAND_SAVEALL_SUCCESS);
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_SAVEALL_DESCRIPTION;
}
2011-10-10 01:21:05 +02:00
}