2018-05-12 00:47:58 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.P;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
2018-08-05 03:32:36 +02:00
|
|
|
import com.massivecraft.factions.struct.Role;
|
2018-05-12 00:47:58 +02:00
|
|
|
import com.massivecraft.factions.zcore.fperms.Access;
|
|
|
|
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdChest extends FCommand {
|
|
|
|
|
|
|
|
public CmdChest() {
|
|
|
|
this.aliases.add("chest");
|
|
|
|
|
|
|
|
//this.requiredArgs.add("");
|
|
|
|
|
|
|
|
|
|
|
|
this.permission = Permission.CHEST.node;
|
|
|
|
this.disableOnLock = false;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = true;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
|
|
|
|
if (!P.p.getConfig().getBoolean("fchest.Enabled")) {
|
|
|
|
fme.sendMessage("This command is disabled!");
|
|
|
|
return;
|
|
|
|
}
|
2018-08-02 18:57:57 +02:00
|
|
|
// This permission check is way too explicit but it's clean
|
2018-08-21 20:02:16 +02:00
|
|
|
if (!this.hasAccess(PermissableAction.CHEST)) {
|
|
|
|
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "access chest");
|
|
|
|
return;
|
2018-05-12 00:47:58 +02:00
|
|
|
}
|
2018-08-02 19:55:21 +02:00
|
|
|
|
2018-05-12 00:47:58 +02:00
|
|
|
me.openInventory(fme.getFaction().getChest());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_VAULT_DESCRIPTION;
|
|
|
|
}
|
|
|
|
}
|