F map autoupdate during flying fixed.
This commit is contained in:
@@ -1,25 +1,15 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.drtshock.playervaults.PlayerVaults;
|
||||
import com.drtshock.playervaults.translations.Lang;
|
||||
import com.drtshock.playervaults.vaultmanagement.UUIDVaultManager;
|
||||
import com.drtshock.playervaults.vaultmanagement.VaultOperations;
|
||||
import com.drtshock.playervaults.vaultmanagement.VaultViewInfo;
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
public class CmdVault extends FCommand {
|
||||
@@ -39,45 +29,44 @@ public class CmdVault extends FCommand {
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void perform() {
|
||||
|
||||
if (!P.p.getConfig().getBoolean("fvault.Enabled")){
|
||||
if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
Access access = fme.getFaction().getAccess(fme, PermissableAction.VAULT);
|
||||
Access access = fme.getFaction().getAccess(fme, PermissableAction.VAULT);
|
||||
if (access.equals(Access.DENY)) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "vault");
|
||||
return;
|
||||
}
|
||||
|
||||
if (fme.isInVault()){
|
||||
if (fme.isInVault()) {
|
||||
me.closeInventory();
|
||||
return;
|
||||
}
|
||||
fme.setInVault(true);
|
||||
Location vaultLocation = fme.getFaction().getVault();
|
||||
if (vaultLocation == null){
|
||||
if (vaultLocation == null) {
|
||||
fme.msg(TL.COMMAND_VAULT_INVALID);
|
||||
return;
|
||||
}
|
||||
FLocation vaultFLocation = new FLocation(vaultLocation);
|
||||
if (Board.getInstance().getFactionAt(vaultFLocation) != fme.getFaction()){
|
||||
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){
|
||||
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);
|
||||
|
||||
Chest chest = (Chest) vaultLocation.getBlock().getState();
|
||||
Inventory chestInv = chest.getBlockInventory();
|
||||
fme.msg(TL.COMMAND_VAULT_OPENING);
|
||||
me.openInventory(chestInv);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user