From 07db3fd0156657b4a09c841d9805afd2a1dfccdc Mon Sep 17 00:00:00 2001 From: DroppingAnvil Date: Fri, 1 Nov 2019 15:35:32 -0500 Subject: [PATCH] Only leaders able to set their factions PayPal and Discord. Signed-off-by: DroppingAnvil --- .../java/com/massivecraft/factions/cmd/CmdPaypalSet.java | 6 ++++++ .../java/com/massivecraft/factions/cmd/CmdSetDiscord.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java b/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java index 9b839a56..074ba4a9 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java @@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionsPlugin; import com.massivecraft.factions.struct.Permission; +import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.zcore.util.TL; public class CmdPaypalSet extends FCommand { @@ -27,6 +28,11 @@ public class CmdPaypalSet extends FCommand { context.fPlayer.msg(TL.GENERIC_DISABLED); return; } + if (context.fPlayer.getRole() != Role.LEADER && !context.fPlayer.isAdminBypassing()) { + //TODO: Create f perm for this + context.msg(TL.GENERIC_NOPERMISSION, "set your factions PayPal!"); + return; + } if (context.args.size() == 1) { if (isEmail(context.argAsString(0))) { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdSetDiscord.java b/src/main/java/com/massivecraft/factions/cmd/CmdSetDiscord.java index 35e6f3a4..658f6069 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdSetDiscord.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdSetDiscord.java @@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionsPlugin; import com.massivecraft.factions.struct.Permission; +import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.zcore.util.TL; public class CmdSetDiscord extends FCommand { @@ -26,6 +27,11 @@ public class CmdSetDiscord extends FCommand { context.fPlayer.msg(TL.GENERIC_DISABLED, "discord"); return; } + if (context.fPlayer.getRole() != Role.LEADER && !context.fPlayer.isAdminBypassing()) { + //TODO: Create f perm for this + context.msg(TL.GENERIC_NOPERMISSION, "set your factions Discord!"); + return; + } if (context.args.size() == 1) { if (isDiscordInvite(context.argAsString(0))) {