2018-09-21 08:28:20 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2018-09-21 08:29:28 +02:00
|
|
|
import com.massivecraft.factions.Faction;
|
2019-08-02 23:01:33 +02:00
|
|
|
import com.massivecraft.factions.P;
|
2018-09-21 08:29:28 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
2018-11-07 06:38:43 +01:00
|
|
|
public class CmdPaypalSee extends FCommand {
|
2019-03-03 04:51:21 +01:00
|
|
|
public CmdPaypalSee() {
|
|
|
|
aliases.add("seepaypal");
|
2019-07-04 07:12:39 +02:00
|
|
|
aliases.add("paypal");
|
2019-03-23 07:02:46 +01:00
|
|
|
|
2019-07-04 07:12:39 +02:00
|
|
|
optionalArgs.put("faction", "yours");
|
2019-03-23 07:02:46 +01:00
|
|
|
|
2019-07-04 07:12:39 +02:00
|
|
|
permission = Permission.PAYPAL.node;
|
2019-03-23 07:02:46 +01:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
disableOnLock = false;
|
2019-07-04 07:12:39 +02:00
|
|
|
|
2019-06-02 07:52:34 +02:00
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = true;
|
2019-03-03 04:51:21 +01:00
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeColeader = false;
|
2019-06-02 07:52:34 +02:00
|
|
|
senderMustBeAdmin = true;
|
2019-03-03 04:51:21 +01:00
|
|
|
|
|
|
|
}
|
2019-03-23 07:02:46 +01:00
|
|
|
@Override
|
2019-03-03 04:51:21 +01:00
|
|
|
public void perform() {
|
2019-08-02 23:01:33 +02:00
|
|
|
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
2019-03-03 04:51:21 +01:00
|
|
|
fme.msg(TL.GENERIC_DISABLED);
|
2019-03-23 07:02:46 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-07-04 07:12:39 +02:00
|
|
|
if (args.size() == 0) {
|
|
|
|
if (myFaction.getPaypal().isEmpty()) {
|
|
|
|
msg(TL.COMMAND_PAYPAL_NOTSET);
|
|
|
|
} else {
|
|
|
|
msg(TL.PAYPALSEE_PLAYER_PAYPAL, myFaction.getPaypal());
|
|
|
|
}
|
|
|
|
} else if (args.size() == 1) {
|
|
|
|
if (fme.isAdminBypassing()) {
|
|
|
|
Faction faction = argAsFaction(0);
|
|
|
|
if (faction != null) {
|
|
|
|
if (faction.getPaypal().isEmpty()) {
|
|
|
|
msg(TL.COMMAND_PAYPALSEE_FACTION_NOTSET, faction.getTag());
|
2019-03-03 04:51:21 +01:00
|
|
|
} else {
|
2019-07-04 07:12:39 +02:00
|
|
|
msg(TL.COMMAND_PAYPALSEE_FACTION_PAYPAL.toString(), faction.getTag(), faction.getPaypal());
|
2019-03-03 04:51:21 +01:00
|
|
|
}
|
|
|
|
}
|
2019-07-04 07:12:39 +02:00
|
|
|
} else {
|
|
|
|
msg(TL.GENERIC_NOPERMISSION, "see another factions paypal.");
|
|
|
|
}
|
|
|
|
} else {
|
2019-08-02 23:01:33 +02:00
|
|
|
msg(P.p.cmdBase.cmdPaypalSee.getUseageTemplate());
|
2019-07-04 07:12:39 +02:00
|
|
|
}
|
|
|
|
}
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-03-23 07:02:46 +01:00
|
|
|
@Override
|
2019-03-03 04:51:21 +01:00
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_PAYPALSEE_DESCRIPTION;
|
|
|
|
}
|
2018-09-21 08:28:20 +02:00
|
|
|
}
|
2018-09-21 08:29:28 +02:00
|
|
|
|
|
|
|
|