Showing Dropping Anvil Something (Ignore)
This commit is contained in:
@@ -8,44 +8,44 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdMoney extends FCommand {
|
||||
|
||||
public CmdMoneyBalance cmdMoneyBalance = new CmdMoneyBalance();
|
||||
public CmdMoneyDeposit cmdMoneyDeposit = new CmdMoneyDeposit();
|
||||
public CmdMoneyWithdraw cmdMoneyWithdraw = new CmdMoneyWithdraw();
|
||||
public CmdMoneyTransferFf cmdMoneyTransferFf = new CmdMoneyTransferFf();
|
||||
public CmdMoneyTransferFp cmdMoneyTransferFp = new CmdMoneyTransferFp();
|
||||
public CmdMoneyTransferPf cmdMoneyTransferPf = new CmdMoneyTransferPf();
|
||||
public CmdMoneyBalance cmdMoneyBalance = new CmdMoneyBalance();
|
||||
public CmdMoneyDeposit cmdMoneyDeposit = new CmdMoneyDeposit();
|
||||
public CmdMoneyWithdraw cmdMoneyWithdraw = new CmdMoneyWithdraw();
|
||||
public CmdMoneyTransferFf cmdMoneyTransferFf = new CmdMoneyTransferFf();
|
||||
public CmdMoneyTransferFp cmdMoneyTransferFp = new CmdMoneyTransferFp();
|
||||
public CmdMoneyTransferPf cmdMoneyTransferPf = new CmdMoneyTransferPf();
|
||||
|
||||
public CmdMoney() {
|
||||
super();
|
||||
this.aliases.add("money");
|
||||
this.aliases.add("bank");
|
||||
public CmdMoney() {
|
||||
super();
|
||||
this.aliases.add("money");
|
||||
this.aliases.add("bank");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
//this.optionalArgs.put("","")
|
||||
//this.requiredArgs.add("");
|
||||
//this.optionalArgs.put("","")
|
||||
|
||||
this.helpLong.add(FactionsPlugin.getInstance().txt.parseTags(TL.COMMAND_MONEY_LONG.toString()));
|
||||
this.helpLong.add(FactionsPlugin.getInstance().txt.parseTags(TL.COMMAND_MONEY_LONG.toString()));
|
||||
|
||||
this.addSubCommand(this.cmdMoneyBalance);
|
||||
this.addSubCommand(this.cmdMoneyDeposit);
|
||||
this.addSubCommand(this.cmdMoneyWithdraw);
|
||||
this.addSubCommand(this.cmdMoneyTransferFf);
|
||||
this.addSubCommand(this.cmdMoneyTransferFp);
|
||||
this.addSubCommand(this.cmdMoneyTransferPf);
|
||||
}
|
||||
this.addSubCommand(this.cmdMoneyBalance);
|
||||
this.addSubCommand(this.cmdMoneyDeposit);
|
||||
this.addSubCommand(this.cmdMoneyWithdraw);
|
||||
this.addSubCommand(this.cmdMoneyTransferFf);
|
||||
this.addSubCommand(this.cmdMoneyTransferFp);
|
||||
this.addSubCommand(this.cmdMoneyTransferPf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!Conf.econEnabled) {
|
||||
context.msg(TL.ECON_OFF, "economy option is enabled, please set \'econEnabled\' to true in conf.json");
|
||||
return;
|
||||
}
|
||||
context.commandChain.add(this);
|
||||
FactionsPlugin.getInstance().cmdAutoHelp.execute(context);
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!Conf.econEnabled) {
|
||||
context.msg(TL.ECON_OFF, "economy option is enabled, please set \'econEnabled\' to true in conf.json");
|
||||
return;
|
||||
}
|
||||
context.commandChain.add(this);
|
||||
FactionsPlugin.getInstance().cmdAutoHelp.execute(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEY_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEY_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,43 +11,43 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
public class CmdMoneyBalance extends FCommand {
|
||||
|
||||
public CmdMoneyBalance() {
|
||||
super();
|
||||
this.aliases.add("b");
|
||||
this.aliases.add("balance");
|
||||
public CmdMoneyBalance() {
|
||||
super();
|
||||
this.aliases.add("b");
|
||||
this.aliases.add("balance");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
this.setHelpShort(TL.COMMAND_MONEYBALANCE_SHORT.toString());
|
||||
this.setHelpShort(TL.COMMAND_MONEYBALANCE_SHORT.toString());
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_BALANCE).build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_BALANCE).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = context.faction;
|
||||
if (context.argIsSet(0)) {
|
||||
faction = context.argAsFaction(0);
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = context.faction;
|
||||
if (context.argIsSet(0)) {
|
||||
faction = context.argAsFaction(0);
|
||||
}
|
||||
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
if (faction != context.faction && !Permission.MONEY_BALANCE_ANY.has(context.sender, true)) {
|
||||
return;
|
||||
}
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
if (faction != context.faction && !Permission.MONEY_BALANCE_ANY.has(context.sender, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.fPlayer != null) {
|
||||
Econ.sendBalanceInfo((CommandSender) context.fPlayer, faction);
|
||||
} else {
|
||||
Econ.sendBalanceInfo(context.sender, faction);
|
||||
}
|
||||
}
|
||||
if (context.fPlayer != null) {
|
||||
Econ.sendBalanceInfo((CommandSender) context.fPlayer, faction);
|
||||
} else {
|
||||
Econ.sendBalanceInfo(context.sender, faction);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYBALANCE_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYBALANCE_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,37 +14,37 @@ import org.bukkit.ChatColor;
|
||||
|
||||
public class CmdMoneyDeposit extends FCommand {
|
||||
|
||||
public CmdMoneyDeposit() {
|
||||
super();
|
||||
this.aliases.add("d");
|
||||
this.aliases.add("deposit");
|
||||
public CmdMoneyDeposit() {
|
||||
super();
|
||||
this.aliases.add("d");
|
||||
this.aliases.add("deposit");
|
||||
|
||||
this.requiredArgs.add("amount");
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
this.requiredArgs.add("amount");
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_DEPOSIT)
|
||||
.memberOnly()
|
||||
.build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_DEPOSIT)
|
||||
.memberOnly()
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator faction = context.argAsFaction(1, context.faction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
boolean success = Econ.transferMoney(context.fPlayer, context.fPlayer, faction, amount);
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator faction = context.argAsFaction(1, context.faction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
boolean success = Econ.transferMoney(context.fPlayer, context.fPlayer, faction, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), context.fPlayer.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), context.fPlayer.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYDEPOSIT_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYDEPOSIT_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,39 +16,39 @@ import org.bukkit.entity.Player;
|
||||
public class CmdMoneyTransferFf extends FCommand {
|
||||
|
||||
|
||||
public CmdMoneyTransferFf() {
|
||||
this.aliases.add("ff");
|
||||
public CmdMoneyTransferFf() {
|
||||
this.aliases.add("ff");
|
||||
|
||||
this.requiredArgs.add("amount");
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("amount");
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("faction");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_F2F).build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_F2F).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator from = context.argAsFaction(1);
|
||||
if (from == null) {
|
||||
return;
|
||||
}
|
||||
EconomyParticipator to = context.argAsFaction(2);
|
||||
if (to == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator from = context.argAsFaction(1);
|
||||
if (from == null) {
|
||||
return;
|
||||
}
|
||||
EconomyParticipator to = context.argAsFaction(2);
|
||||
if (to == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean success = Econ.transferMoney(context.fPlayer, from, to, amount);
|
||||
boolean success = Econ.transferMoney(context.fPlayer, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
String name = context.sender instanceof Player ? context.fPlayer.getName() : context.sender.getName();
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
String name = context.sender instanceof Player ? context.fPlayer.getName() : context.sender.getName();
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYTRANSFERFF_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYTRANSFERFF_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
@@ -13,38 +13,38 @@ import org.bukkit.ChatColor;
|
||||
|
||||
|
||||
public class CmdMoneyTransferFp extends FCommand {
|
||||
public CmdMoneyTransferFp() {
|
||||
this.aliases.add("fp");
|
||||
public CmdMoneyTransferFp() {
|
||||
this.aliases.add("fp");
|
||||
|
||||
this.requiredArgs.add("amount");
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("player");
|
||||
this.requiredArgs.add("amount");
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("player");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_F2P).build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_F2P).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator from = context.argAsFaction(1);
|
||||
if (from == null) {
|
||||
return;
|
||||
}
|
||||
EconomyParticipator to = context.argAsBestFPlayerMatch(2);
|
||||
if (to == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator from = context.argAsFaction(1);
|
||||
if (from == null) {
|
||||
return;
|
||||
}
|
||||
EconomyParticipator to = context.argAsBestFPlayerMatch(2);
|
||||
if (to == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean success = Econ.transferMoney(context.fPlayer, from, to, amount);
|
||||
boolean success = Econ.transferMoney(context.fPlayer, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), context.fPlayer.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), context.fPlayer.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYTRANSFERFP_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYTRANSFERFP_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,37 +14,37 @@ import org.bukkit.ChatColor;
|
||||
|
||||
public class CmdMoneyTransferPf extends FCommand {
|
||||
|
||||
public CmdMoneyTransferPf() {
|
||||
this.aliases.add("pf");
|
||||
public CmdMoneyTransferPf() {
|
||||
this.aliases.add("pf");
|
||||
|
||||
this.requiredArgs.add("amount");
|
||||
this.requiredArgs.add("player");
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("amount");
|
||||
this.requiredArgs.add("player");
|
||||
this.requiredArgs.add("faction");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_P2F).build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_P2F).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator from = context.argAsBestFPlayerMatch(1);
|
||||
if (from == null) {
|
||||
return;
|
||||
}
|
||||
EconomyParticipator to = context.argAsFaction(2);
|
||||
if (to == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator from = context.argAsBestFPlayerMatch(1);
|
||||
if (from == null) {
|
||||
return;
|
||||
}
|
||||
EconomyParticipator to = context.argAsFaction(2);
|
||||
if (to == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean success = Econ.transferMoney(context.fPlayer, from, to, amount);
|
||||
boolean success = Econ.transferMoney(context.fPlayer, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), context.fPlayer.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), context.fPlayer.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYTRANSFERPF_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYTRANSFERPF_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,42 +17,42 @@ import org.bukkit.ChatColor;
|
||||
|
||||
public class CmdMoneyWithdraw extends FCommand {
|
||||
|
||||
public CmdMoneyWithdraw() {
|
||||
this.aliases.add("w");
|
||||
this.aliases.add("withdraw");
|
||||
public CmdMoneyWithdraw() {
|
||||
this.aliases.add("w");
|
||||
this.aliases.add("withdraw");
|
||||
|
||||
this.requiredArgs.add("amount");
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
this.requiredArgs.add("amount");
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_F2P)
|
||||
.playerOnly()
|
||||
.build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONEY_F2P)
|
||||
.playerOnly()
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator faction = context.argAsFaction(1, context.faction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
double amount = context.argAsDouble(0, 0d);
|
||||
EconomyParticipator faction = context.argAsFaction(1, context.faction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Access access = context.faction.getAccess(context.fPlayer, PermissableAction.WITHDRAW);
|
||||
if (context.fPlayer.getRole() != Role.LEADER) {
|
||||
if (access == Access.DENY) {
|
||||
context.msg(TL.GENERIC_NOPERMISSION, "withdraw", "withdraw money from the bank");
|
||||
return;
|
||||
}
|
||||
}
|
||||
boolean success = Econ.transferMoney(context.fPlayer, faction, context.fPlayer, amount);
|
||||
Access access = context.faction.getAccess(context.fPlayer, PermissableAction.WITHDRAW);
|
||||
if (context.fPlayer.getRole() != Role.LEADER) {
|
||||
if (access == Access.DENY) {
|
||||
context.msg(TL.GENERIC_NOPERMISSION, "withdraw", "withdraw money from the bank");
|
||||
return;
|
||||
}
|
||||
}
|
||||
boolean success = Econ.transferMoney(context.fPlayer, faction, context.fPlayer, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), context.fPlayer.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
FactionsPlugin.getInstance().log(ChatColor.stripColor(FactionsPlugin.getInstance().txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), context.fPlayer.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYWITHDRAW_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_MONEYWITHDRAW_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user