Reformatted - F Paypal + Few Fixes w/F Alts

This commit is contained in:
Driftay
2019-07-04 01:12:39 -04:00
parent 9d40fec03b
commit 27a442681d
8 changed files with 100 additions and 50 deletions

View File

@@ -8,12 +8,14 @@ import com.massivecraft.factions.zcore.util.TL;
public class CmdPaypalSee extends FCommand {
public CmdPaypalSee() {
aliases.add("seepaypal");
aliases.add("paypal");
requiredArgs.add("faction");
optionalArgs.put("faction", "yours");
permission = Permission.ADMIN.node;
permission = Permission.PAYPAL.node;
disableOnLock = false;
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
@@ -27,21 +29,30 @@ public class CmdPaypalSee extends FCommand {
fme.msg(TL.GENERIC_DISABLED);
return;
}
Faction faction = argAsFaction(0);
if (faction == null)
return;
if (!faction.isWilderness() && !faction.isSafeZone() && !faction.isWarZone()) {
fme.msg(TL.COMMAND_PAYPALSEE_FACTION_NOFACTION.toString(), me.getName());
return;
}
if (faction.getPaypal() != null) {
fme.msg(TL.COMMAND_PAYPALSEE_FACTION_PAYPAL.toString(), faction.getTag(), faction.getPaypal());
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());
} else {
fme.msg(TL.COMMAND_PAYPALSEE_FACTION_NOTSET.toString(), faction.getTag(), faction.getPaypal());
msg(TL.COMMAND_PAYPALSEE_FACTION_PAYPAL.toString(), faction.getTag(), faction.getPaypal());
}
}
} else {
msg(TL.GENERIC_NOPERMISSION, "see another factions paypal.");
}
} else {
msg(SaberFactions.plugin.cmdBase.cmdPaypalSee.getUseageTemplate());
}
}
@Override
public TL getUsageTranslation() {