mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-10 21:01:03 +01:00
added bankBalance method woops! - fixed bank error message in
MineConomy.
This commit is contained in:
parent
36f6a15fd3
commit
2d92a152d3
@ -84,6 +84,13 @@ public interface Economy {
|
||||
*/
|
||||
public EconomyResponse createBank(String name, String player);
|
||||
|
||||
/**
|
||||
* Returns the amount the bank has
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public EconomyResponse bankBalance(String name);
|
||||
|
||||
/**
|
||||
* Returns true or false whether the bank has the amount specified
|
||||
* @param name
|
||||
|
@ -221,4 +221,9 @@ public class Economy_3co implements Economy {
|
||||
public EconomyResponse isBankMember(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
}
|
||||
}
|
||||
|
@ -270,4 +270,13 @@ public class Economy_BOSE6 implements Economy {
|
||||
} else
|
||||
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That player is not a bank member!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
if (!economy.bankExists(name))
|
||||
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That bank does not exist!");
|
||||
|
||||
double bankMoney = economy.getBankMoney(name);
|
||||
return new EconomyResponse(0, bankMoney, ResponseType.SUCCESS, null);
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +264,16 @@ public class Economy_BOSE7 implements Economy {
|
||||
} else
|
||||
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That player is not a bank member!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
if (!economy.bankExists(name))
|
||||
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That bank does not exist!");
|
||||
|
||||
double bankMoney = economy.getBankMoney(name);
|
||||
return new EconomyResponse(0, bankMoney, ResponseType.SUCCESS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String playerName, double amount) {
|
||||
return getBalance(playerName) >= amount;
|
||||
|
@ -244,4 +244,9 @@ public class Economy_Essentials implements Economy {
|
||||
public EconomyResponse isBankMember(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "Essentials Eco does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "Essentials Eco does not support bank accounts!");
|
||||
}
|
||||
}
|
@ -126,31 +126,36 @@ public class Economy_MineConomy implements Economy {
|
||||
|
||||
@Override
|
||||
public EconomyResponse createBank(String name, String player) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankHas(String name, double amount) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankWithdraw(String name, double amount) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankDeposit(String name, double amount) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse isBankOwner(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse isBankMember(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
|
||||
}
|
||||
}
|
||||
|
@ -224,4 +224,9 @@ public class Economy_MultiCurrency implements Economy {
|
||||
public EconomyResponse isBankMember(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MultiCurrency does not support bank accounts");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MultiCurrency does not support bank accounts");
|
||||
}
|
||||
}
|
||||
|
@ -160,4 +160,9 @@ public class Economy_eWallet implements Economy {
|
||||
public EconomyResponse isBankMember(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
|
||||
}
|
||||
}
|
||||
|
@ -235,4 +235,9 @@ public class Economy_iConomy4 implements Economy {
|
||||
public EconomyResponse isBankMember(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy4 does not support bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy4 does not support bank accounts!");
|
||||
}
|
||||
}
|
@ -198,4 +198,9 @@ public class Economy_iConomy5 implements Economy {
|
||||
public EconomyResponse isBankMember(String name, String playerName) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy5 does not support single bank accounts!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy5 does not support single bank accounts!");
|
||||
}
|
||||
}
|
@ -189,4 +189,12 @@ public class Economy_iConomy6 implements Economy {
|
||||
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy 6 does not support Bank members.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse bankBalance(String name) {
|
||||
if (!accounts.exists(name))
|
||||
return new EconomyResponse(0, 0, ResponseType.FAILURE, "There is no bank account with that name");
|
||||
else
|
||||
return new EconomyResponse(0, accounts.get(name).getHoldings().getBalance(), ResponseType.SUCCESS, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user