return new EconomyResponse(0, groupBank.getBalance(), ResponseType.FAILURE, String.format(api.getMsg("PlayerNotOwner"), account.getName(), groupBank.getName()));
}
@Override
public EconomyResponse isBankMember (String name, String playerName) {
GroupBank groupBank = api.getGroupBank(name);
if (groupBank == null) {
return new EconomyResponse(0, 0, ResponseType.FAILURE, api.getMsg("GroupBankNotExists"));
}
Account account = api.getAccount(name);
if (account == null) {
return new EconomyResponse(0, groupBank.getBalance(), ResponseType.FAILURE, api.getMsg("PlayerNotExist"));
}
if (groupBank.groupMembers.getMembers().containsKey(playerName)) {
return new EconomyResponse(0, groupBank.getBalance(), ResponseType.SUCCESS, null);
}
return new EconomyResponse(0, groupBank.getBalance(), ResponseType.FAILURE, String.format(api.getMsg("NotAMemberOf"), groupBank.getName(), account.getName()));
}