Showing Dropping Anvil Something (Ignore)
This commit is contained in:
@@ -7,60 +7,60 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPaypalSet extends FCommand {
|
||||
|
||||
public CmdPaypalSet() {
|
||||
this.aliases.add("setpaypal");
|
||||
public CmdPaypalSet() {
|
||||
this.aliases.add("setpaypal");
|
||||
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
this.requiredArgs.add("email");
|
||||
this.requiredArgs.add("email");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.PAYPALSET)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.build();
|
||||
this.requirements = new CommandRequirements.Builder(Permission.PAYPALSET)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
context.fPlayer.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
context.fPlayer.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.args.size() == 1) {
|
||||
if (isEmail(context.argAsString(0))) {
|
||||
context.fPlayer.getFaction().paypalSet(context.argAsString(0));
|
||||
context.msg(TL.COMMAND_PAYPALSET_SUCCESSFUL, context.argAsString(0));
|
||||
} else {
|
||||
context.msg(TL.COMMAND_PAYPALSET_NOTEMAIL, context.argAsString(0));
|
||||
}
|
||||
} else if (context.args.size() == 2) {
|
||||
if (context.fPlayer.isAdminBypassing()) {
|
||||
Faction faction = context.argAsFaction(1);
|
||||
if (faction != null) {
|
||||
if (isEmail(context.argAsString(0))) {
|
||||
context.fPlayer.getFaction().paypalSet(context.argAsString(0));
|
||||
context.msg(TL.COMMAND_PAYPALSET_ADMIN_SUCCESSFUL, faction.getTag(), context.argAsString(0));
|
||||
} else {
|
||||
context.msg(TL.COMMAND_PAYPALSET_ADMIN_FAILED, context.argAsString(0));
|
||||
}
|
||||
if (context.args.size() == 1) {
|
||||
if (isEmail(context.argAsString(0))) {
|
||||
context.fPlayer.getFaction().paypalSet(context.argAsString(0));
|
||||
context.msg(TL.COMMAND_PAYPALSET_SUCCESSFUL, context.argAsString(0));
|
||||
} else {
|
||||
context.msg(TL.COMMAND_PAYPALSET_NOTEMAIL, context.argAsString(0));
|
||||
}
|
||||
} else if (context.args.size() == 2) {
|
||||
if (context.fPlayer.isAdminBypassing()) {
|
||||
Faction faction = context.argAsFaction(1);
|
||||
if (faction != null) {
|
||||
if (isEmail(context.argAsString(0))) {
|
||||
context.fPlayer.getFaction().paypalSet(context.argAsString(0));
|
||||
context.msg(TL.COMMAND_PAYPALSET_ADMIN_SUCCESSFUL, faction.getTag(), context.argAsString(0));
|
||||
} else {
|
||||
context.msg(TL.COMMAND_PAYPALSET_ADMIN_FAILED, context.argAsString(0));
|
||||
}
|
||||
} else {
|
||||
context.msg(TL.GENERIC_NOPERMISSION, "set another factions paypal!");
|
||||
}
|
||||
} else {
|
||||
context.msg(FactionsPlugin.getInstance().cmdBase.cmdPaypalSet.getUseageTemplate(context));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
context.msg(TL.GENERIC_NOPERMISSION, "set another factions paypal!");
|
||||
}
|
||||
} else {
|
||||
context.msg(FactionsPlugin.getInstance().cmdBase.cmdPaypalSet.getUseageTemplate(context));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isEmail(String email) {
|
||||
return email.contains("@") && email.contains(".");
|
||||
}
|
||||
private boolean isEmail(String email) {
|
||||
return email.contains("@") && email.contains(".");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PAYPALSET_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PAYPALSET_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user