Only leaders able to set their factions PayPal and Discord.

Signed-off-by: DroppingAnvil <dr0pping.4nvi1@gmail.com>
This commit is contained in:
DroppingAnvil 2019-11-01 15:35:32 -05:00
parent 73ba6fb608
commit 07db3fd015
2 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.FactionsPlugin; import com.massivecraft.factions.FactionsPlugin;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
public class CmdPaypalSet extends FCommand { public class CmdPaypalSet extends FCommand {
@ -27,6 +28,11 @@ public class CmdPaypalSet extends FCommand {
context.fPlayer.msg(TL.GENERIC_DISABLED); context.fPlayer.msg(TL.GENERIC_DISABLED);
return; 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 (context.args.size() == 1) {
if (isEmail(context.argAsString(0))) { if (isEmail(context.argAsString(0))) {

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.FactionsPlugin; import com.massivecraft.factions.FactionsPlugin;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
public class CmdSetDiscord extends FCommand { public class CmdSetDiscord extends FCommand {
@ -26,6 +27,11 @@ public class CmdSetDiscord extends FCommand {
context.fPlayer.msg(TL.GENERIC_DISABLED, "discord"); context.fPlayer.msg(TL.GENERIC_DISABLED, "discord");
return; 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 (context.args.size() == 1) {
if (isDiscordInvite(context.argAsString(0))) { if (isDiscordInvite(context.argAsString(0))) {