From 40a0d7227021c6fb65545ea8a80e9b8f1eb8227a Mon Sep 17 00:00:00 2001 From: Svenja Reissaus Date: Thu, 2 Aug 2018 12:33:51 -0300 Subject: [PATCH] Added /f home permission added to keep players from complaining --- src/main/java/com/massivecraft/factions/cmd/CmdHome.java | 8 ++++++++ .../factions/zcore/fperms/PermissableAction.java | 1 + 2 files changed, 9 insertions(+) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdHome.java b/src/main/java/com/massivecraft/factions/cmd/CmdHome.java index 2d861b22..d710e89a 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdHome.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdHome.java @@ -47,6 +47,14 @@ public class CmdHome extends FCommand { fme.msg(TL.COMMAND_HOME_TELEPORTDISABLED); return; } + f (!fme.isAdminBypassing()) { + Access access = myFaction.getAccess(fme, PermissableAction.HOME); + if (access != Access.ALLOW && fme.getRole() != Role.ADMIN) { + fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "teleport home"); + return; + } + } + if (!myFaction.hasHome()) { fme.msg(TL.COMMAND_HOME_NOHOME.toString() + (fme.getRole().value < Role.MODERATOR.value ? TL.GENERIC_ASKYOURLEADER.toString() : TL.GENERIC_YOUSHOULD.toString())); diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java index aa0e958d..0e00612e 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java @@ -29,6 +29,7 @@ public enum PermissableAction { SETHOME("sethome"), TERRITORY("territory"), ACCESS("access"), + HOME("home"), DISBAND("disband"), PROMOTE("promote"), SETWARP("setwarp"),