Check System Added and Massive Reformat
This commit is contained in:
@@ -14,66 +14,66 @@ import org.bukkit.inventory.Inventory;
|
||||
|
||||
public class CmdVault extends FCommand {
|
||||
|
||||
public CmdVault() {
|
||||
this.aliases.add("vault");
|
||||
public CmdVault() {
|
||||
this.aliases.add("vault");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
//this.requiredArgs.add("");
|
||||
|
||||
|
||||
this.permission = Permission.VAULT.node;
|
||||
this.disableOnLock = false;
|
||||
this.permission = Permission.VAULT.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
@Override
|
||||
public void perform() {
|
||||
|
||||
if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
Access access = fme.getFaction().getAccess(fme, PermissableAction.VAULT);
|
||||
if (access.equals(Access.DENY)) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "vault");
|
||||
return;
|
||||
}
|
||||
if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
Access access = fme.getFaction().getAccess(fme, PermissableAction.VAULT);
|
||||
if (access.equals(Access.DENY)) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "vault");
|
||||
return;
|
||||
}
|
||||
|
||||
if (fme.isInVault()) {
|
||||
me.closeInventory();
|
||||
return;
|
||||
}
|
||||
fme.setInVault(true);
|
||||
Location vaultLocation = fme.getFaction().getVault();
|
||||
if (vaultLocation == null) {
|
||||
fme.msg(TL.COMMAND_VAULT_INVALID);
|
||||
return;
|
||||
}
|
||||
FLocation vaultFLocation = new FLocation(vaultLocation);
|
||||
if (Board.getInstance().getFactionAt(vaultFLocation) != fme.getFaction()) {
|
||||
fme.getFaction().setVault(null);
|
||||
fme.msg(TL.COMMAND_VAULT_INVALID);
|
||||
return;
|
||||
}
|
||||
if (vaultLocation.getBlock().getType() != Material.CHEST) {
|
||||
fme.getFaction().setVault(null);
|
||||
fme.msg(TL.COMMAND_VAULT_INVALID);
|
||||
return;
|
||||
}
|
||||
Chest chest = (Chest) vaultLocation.getBlock().getState();
|
||||
Inventory chestInv = chest.getBlockInventory();
|
||||
fme.msg(TL.COMMAND_VAULT_OPENING);
|
||||
me.openInventory(chestInv);
|
||||
if (fme.isInVault()) {
|
||||
me.closeInventory();
|
||||
return;
|
||||
}
|
||||
fme.setInVault(true);
|
||||
Location vaultLocation = fme.getFaction().getVault();
|
||||
if (vaultLocation == null) {
|
||||
fme.msg(TL.COMMAND_VAULT_INVALID);
|
||||
return;
|
||||
}
|
||||
FLocation vaultFLocation = new FLocation(vaultLocation);
|
||||
if (Board.getInstance().getFactionAt(vaultFLocation) != fme.getFaction()) {
|
||||
fme.getFaction().setVault(null);
|
||||
fme.msg(TL.COMMAND_VAULT_INVALID);
|
||||
return;
|
||||
}
|
||||
if (vaultLocation.getBlock().getType() != Material.CHEST) {
|
||||
fme.getFaction().setVault(null);
|
||||
fme.msg(TL.COMMAND_VAULT_INVALID);
|
||||
return;
|
||||
}
|
||||
Chest chest = (Chest) vaultLocation.getBlock().getState();
|
||||
Inventory chestInv = chest.getBlockInventory();
|
||||
fme.msg(TL.COMMAND_VAULT_OPENING);
|
||||
me.openInventory(chestInv);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_VAULT_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_VAULT_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user