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-09-14 21:13:01 +02:00
|
|
|
import com.massivecraft.factions.FactionsPlugin;
|
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-12-02 20:03:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Driftay
|
|
|
|
*/
|
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public CmdPaypalSee() {
|
2020-01-02 02:59:31 +01:00
|
|
|
this.aliases.addAll(Aliases.paypal_see);
|
2019-09-15 11:19:06 +02:00
|
|
|
|
|
|
|
this.optionalArgs.put("faction", "yours");
|
|
|
|
|
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.PAYPAL)
|
|
|
|
.memberOnly()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform(CommandContext context) {
|
|
|
|
if (!FactionsPlugin.getInstance().getConfig().getBoolean("fpaypal.Enabled")) {
|
2019-12-03 11:16:37 +01:00
|
|
|
context.msg(TL.GENERIC_DISABLED, "Faction Paypals");
|
2019-09-15 11:19:06 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-09-15 20:53:27 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
if (context.args.size() == 0) {
|
2019-09-15 20:53:27 +02:00
|
|
|
if (context.fPlayer.getFaction().getPaypal() == null) {
|
2019-09-15 11:19:06 +02:00
|
|
|
context.msg(TL.COMMAND_PAYPAL_NOTSET);
|
|
|
|
} else {
|
|
|
|
context.msg(TL.PAYPALSEE_PLAYER_PAYPAL, context.fPlayer.getFaction().getPaypal());
|
|
|
|
}
|
|
|
|
} else if (context.args.size() == 1) {
|
|
|
|
if (context.fPlayer.isAdminBypassing()) {
|
|
|
|
Faction faction = context.argAsFaction(0);
|
|
|
|
if (faction != null) {
|
2019-09-15 20:53:27 +02:00
|
|
|
if (faction.getPaypal() == null) {
|
2019-09-15 11:19:06 +02:00
|
|
|
context.msg(TL.COMMAND_PAYPALSEE_FACTION_NOTSET, faction.getTag());
|
|
|
|
} else {
|
|
|
|
context.msg(TL.COMMAND_PAYPALSEE_FACTION_PAYPAL.toString(), faction.getTag(), faction.getPaypal());
|
2019-08-24 19:18:50 +02:00
|
|
|
}
|
2019-09-15 11:19:06 +02:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
context.msg(TL.GENERIC_NOPERMISSION, "see another factions paypal.");
|
|
|
|
}
|
|
|
|
} else {
|
2019-09-15 20:53:27 +02:00
|
|
|
context.msg(FactionsPlugin.getInstance().cmdBase.cmdPaypalSee.getUsageTemplate(context));
|
2019-09-15 11:19:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_PAYPALSEE_DESCRIPTION;
|
|
|
|
}
|
2018-09-21 08:28:20 +02:00
|
|
|
}
|
2018-09-21 08:29:28 +02:00
|
|
|
|
|
|
|
|