From eb288c5cdcab465a1a54407cea97b78c5b7f3d08 Mon Sep 17 00:00:00 2001 From: Naman Date: Wed, 11 Jul 2018 08:33:43 -0500 Subject: [PATCH] /f vault deny perm fix --- src/main/java/com/massivecraft/factions/cmd/CmdCreate.java | 5 ++++- src/main/java/com/massivecraft/factions/cmd/CmdVault.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java b/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java index 8820531d..62a776a0 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java @@ -85,8 +85,11 @@ public class CmdCreate extends FCommand { // join event cannot be cancelled or you'll have an empty faction // finish setting up the FPlayer - fme.setRole(Role.ADMIN); fme.setFaction(faction); + // We should consider adding the role just AFTER joining the faction. + // That way we don't have to mess up deleting more stuff. + // And prevent the user from being returned to NORMAL after deleting his old faction. + fme.setRole(Role.ADMIN); for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) { follower.msg(TL.COMMAND_CREATE_CREATED, fme.describeTo(follower, true), faction.getTag(follower)); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdVault.java b/src/main/java/com/massivecraft/factions/cmd/CmdVault.java index 89ff5f8e..67594c55 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdVault.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdVault.java @@ -49,6 +49,7 @@ public class CmdVault extends FCommand { Access access = fme.getFaction().getAccess(fme, PermissableAction.VAULT); if (access.equals(Access.DENY)) { fme.msg(TL.GENERIC_NOPERMISSION, "vault"); + return; } if (fme.isInVault()){