Fixed Money Spam if Amount is 0

This commit is contained in:
Driftay 2020-03-26 01:11:57 -04:00
parent 66ad927b2f
commit cd24b053dc
6 changed files with 27 additions and 0 deletions

View File

@ -36,6 +36,11 @@ public class CmdMoneyDeposit extends FCommand {
public void perform(CommandContext context) {
double amount = context.argAsDouble(0, 0d);
EconomyParticipator faction = context.argAsFaction(1, context.faction);
if(amount <= 0){
return;
}
if (faction == null) {
return;
}

View File

@ -33,6 +33,12 @@ public class CmdMoneyTransferFf extends FCommand {
@Override
public void perform(CommandContext context) {
double amount = context.argAsDouble(0, 0d);
if(amount <= 0){
return;
}
EconomyParticipator from = context.argAsFaction(1);
if (from == null) {
return;

View File

@ -32,6 +32,11 @@ public class CmdMoneyTransferFp extends FCommand {
@Override
public void perform(CommandContext context) {
double amount = context.argAsDouble(0, 0d);
if(amount <= 0){
return;
}
EconomyParticipator from = context.argAsFaction(1);
if (from == null) {
return;

View File

@ -32,6 +32,11 @@ public class CmdMoneyTransferPf extends FCommand {
@Override
public void perform(CommandContext context) {
double amount = context.argAsDouble(0, 0d);
if(amount <= 0){
return;
}
EconomyParticipator from = context.argAsBestFPlayerMatch(1);
if (from == null) {
return;

View File

@ -39,6 +39,11 @@ public class CmdMoneyWithdraw extends FCommand {
@Override
public void perform(CommandContext context) {
double amount = context.argAsDouble(0, 0d);
if(amount <= 0){
return;
}
EconomyParticipator faction = context.argAsFaction(1, context.faction);
if (faction == null) {
return;

View File

@ -451,6 +451,7 @@ public class FactionsPlayerListener implements Listener {
case CHIPPED_ANVIL:
case DAMAGED_ANVIL:
case BREWING_STAND:
return PermissableAction.CONTAINER;
default:
return null;