Changes Adding
This commit is contained in:
@@ -100,6 +100,9 @@ public class CmdCreate extends FCommand {
|
||||
if (Conf.logFactionCreate) {
|
||||
P.p.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
|
||||
}
|
||||
if (P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
this.fme.msg(TL.COMMAND_PAYPALSET_CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,50 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
public class CmdPaypalSee {
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
public class CmdPaypalSee extends FCommand{
|
||||
public CmdPaypalSee() {
|
||||
aliases.add("seepaypal");
|
||||
aliases.add("getpaypal");
|
||||
requiredArgs.add("faction");
|
||||
permission = Permission.ADMIN.node;
|
||||
disableOnLock = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
} else {
|
||||
Faction faction = argAsFaction(0);
|
||||
String paypal = argAsString(1);
|
||||
|
||||
if (faction != null) {
|
||||
if (!faction.isWilderness() && !faction.isSafeZone() && !faction.isWarZone()) {
|
||||
if (faction.getPaypal() != null) {
|
||||
fme.msg(TL.COMMAND_PAYPALSEE_FACTION_PAYPAL.toString(), faction.getTag(), faction.getPaypal());
|
||||
} else {
|
||||
fme.msg(TL.COMMAND_PAYPALSEE_FACTION_NOTSET.toString(), faction.getTag(), faction.getPaypal());
|
||||
}
|
||||
|
||||
} else {
|
||||
fme.msg(TL.COMMAND_PAYPALSEE_FACTION_NOFACTION.toString(), me.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PAYPALSEE_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,38 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
public class CmdPaypalSet {
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPaypalSet extends FCommand{
|
||||
|
||||
public CmdPaypalSet() {
|
||||
this.aliases.add("setpaypal");
|
||||
this.aliases.add("paypal");
|
||||
this.requiredArgs.add("email");
|
||||
this.permission = Permission.PAYPALSET.node;
|
||||
this.disableOnLock = false;
|
||||
this.senderMustBePlayer = true;
|
||||
this.senderMustBeMember = false;
|
||||
this.senderMustBeModerator = false;
|
||||
this.senderMustBeColeader = true;
|
||||
this.senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
} else {
|
||||
String paypal = argAsString(0);
|
||||
if (paypal != null) {
|
||||
myFaction.paypalSet(paypal);
|
||||
fme.msg(TL.COMMAND_PAYPALSET_SUCCESSFUL, paypal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PAYPALSET_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ public class FCmdRoot extends FCommand {
|
||||
public CmdSB cmdSB = new CmdSB();
|
||||
public CmdShowInvites cmdShowInvites = new CmdShowInvites();
|
||||
public CmdAnnounce cmdAnnounce = new CmdAnnounce();
|
||||
public CmdPaypalSet cmdPaypalSet = new CmdPaypalSet();
|
||||
public CmdPaypalSee cmdPaypalSee = new CmdPaypalSee();
|
||||
public CmdSeeChunk cmdSeeChunk = new CmdSeeChunk();
|
||||
public CmdConvert cmdConvert = new CmdConvert();
|
||||
public CmdFWarp cmdFWarp = new CmdFWarp();
|
||||
@@ -231,6 +233,10 @@ public class FCmdRoot extends FCommand {
|
||||
P.p.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
|
||||
this.addSubCommand(this.cmdTop);
|
||||
}
|
||||
if (P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
this.addSubCommand(this.cmdPaypalSet);
|
||||
this.addSubCommand(this.cmdPaypalSee);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user