BankMaster

BankMaster

BankMaster is a server economy that uses blocks for currency. Each player who opens an account can store currency blocks in the account. While the account contains money, it receives interest on each calendar (real) day. The player can withdraw money from his account at any Bank or ATM sign. If configured, the player can also borrow money from the bank, up to a server defined limit.

There are four kinds of signs: Bank, ATM, Loans, and XP Bank. These signs can be placed anywhere an admin chooses, but only admins can create them.

When a player right-clicks on a valid Bank sign, an inventory view is opened, like this:

Inventory shown by bank sign

The upper inventory represents the player's bank account. The lower part is the player's own inventory. To deposit money in the account, just move currency blocks from the player's inventory into the account inventory. To withdraw money, move currency blocks in the opposite direction, from account to player. If you want to deposit more blocks than will fit in the display, simply close it (press 'e') and click on the Bank sign again, to get a fresh display. Only a portion of the player's current account is shown so that there is always room to add more into the account. If you're withdrawing money and exhaust the stacks shown, close the inventory and click on the Bank sign again to re-open it. This refreshes the display with more blocks.

Bank accounts cannot grow above a configured maximum, usually ten million units. Once the account reaches that value, more money cannot be deposited, and interest will no longer be added.

Loans work similarly. Right clicking on a Loans sign opens an inventory view. The bank's money is shown on top, and the player inventory on the bottom. To borrow money, simply move blocks into the player inventory. To repay a loan, move blocks into the Bank inventory on top. (If you repay more than you owe, the excess money is deposited in the bank account.) Note that loans are treated separately from the account itself: You can make deposits and withdraw from the account without affecting the loan, and depositing money in the account does not automatically repay a loan. You can only do that at a Loans sign.

ATM signs have the word "ATM" on the first line, and are used much like Bank signs. They are meant to be posted near shops that do not support the Vault interface, to allow players easy access to their money, much like real ATM's are posted in shopping malls and businesses in the real world, for the same purpose. Operationally, there is no difference between a Bank and an ATM sign.

Interest

Interest is computed on accounts once every real calendar day. It is not actually deposited into accounts, though, until the account owner accesses the account. The next time the player clicks on a Bank or ATM sign, the amount of interest accrued since his last visit is computed and added to the account. The money is then displayed in the inventory window. This means that server down time does not impact interest accrual, and the server does not have to cycle through all accounts on a daily basis.

The interest rate paid by the bank is set in the config file (see below).

XP Bank

An XP Bank sign can be created only by an op or user with BankMaster.admin permission. When right clicked, the sign stores the player's current XP levels as Bottles o' Enchanting and presents the current XP bank status in an inventory display. Only the first nine slots are shown. If the stored XP levels exceeds nine stacks of bottles, only the first nine stacks are shown.

XP banking dialog

You may move bottles from the upper inventory into your inventory on the bottom. Bottles moved will be added to your current XP levels when you close the dialog. Moving bottles from the upper to lower inventory is how you withdraw banked XP. (Due to synchronization issues in the game, the bottles may appear for a short while in your inventory after closing the dialog.)

Installation

Installation is a four step process:

  1. Drop the jar file into your plugins folder
  2. Download Vault and add to your plugins folder (if you haven't already done so)
  3. Edit the config.yml file to reflect the banking options and settings you want, and restart the server.
  4. Create Bank, ATM, and Loans signs at strategic locations for your players to use.

If you want shops plugins to access BankMaster accounts. make sure to include the Vault plugin (available separately) in your plugins. BankMaster interfaces through Vault with a wide variety of shops plugins, including SignShops and BookShelf. Shops that use Vault can take money from, and add money to, player accounts. This relieves the player of the burden of carrying money, and is the recommended way of using BankMaster, but it's not required. You can use BankMaster to manage money only. The advantage of BankMaster is that the player does not need to provide storage for currency blocks. The account is maintained as records in custom .yml files referenced by player UUID, and so cannot be raided or destroyed.

Signs

There are four kinds of signs: Bank signs, ATM signs, Loans signs, and XP Bank signs. Only admins can create these signs. An admin is an Op or a player with BankMaster.admin permission.

To create a Bank sign, place a sign with the words "Money Bank" on the first line. (You can customize this text in the config.yml file.) If successfully created, the color of the text is changed to dark green, and the second line is set to "~~~~~~~~~~". Lines 3 and 4 of the sign are ignored.

ATM, Loans, and XP Bank signs are created the same way. The first line must contain the word ATM, Loans, or XP Bank. The rest of the sign should be blank. Successful creation is indicated by changing the color to dark green, and setting the second line to ~~~~~~~~~.

Configuration

A config.yml file is created when the plugin is first installed, as shown below.

bank:
  moneySign: Money Bank
  XPSign: XP Bank
  ATMSign: ATM
  LoanSign: Loans
  maxMoney: 10000000
  interestDays: 180
  maxLoans: 10000
  currency:
    decimals: 2
    denominations:
    - EMERALD_BLOCK,9
    - EMERALD,1

As usual with .yml files, you must not use tabs for indentation. Two spaces per level of indentation is the customary rule. The first level entry must be "bank:" Following entries should be indented one level:

moneySign: <text>
This is the text you want to appear on the top line of the Bank sign. When creating the sign, use the same text as you specify here.

XPSign: <text>
This is the text you want to appear on the top line of an XP Bank sign. You must create the sign using the same text you specify here.

ATMSign: <text>
This is the text you want to appear on the top line of an ATM sign. You must create the sign using the same text you specify here.

LoanSign: <text>
This is the text you want to appear on the top line of a Loans sign. Use the same text you specify here when creating the sign.

maxMoney: <integer>
Specify the maxim size of a bank account. The account will not be able to grow larger than this value.

interestDays: <integer>
Specify the number of days of interest that will double the player's money. Do NOT use an actual interest rate here. The value must be an integer number from 0 to 365. The effective interest rate will be computed by the plugin. For example, if you specify 30 days, an account of $100 will double to $200 in 30 days. Interest calculation uses real calendar days, not Minecraft days. Setting the interestDays to zero disables interest calculations.

maxLoans: <integer>
Specify the maximum total bank loans the player may have outstanding at one time. When the total loans on an account reaches this value, the player will not be allowed to borrow more money. The player can still use Loans signs to make payments on the loan.

currency:
This is a mandatory entry. Entries in this section specify the kind of Minecraft blocks that are to be used as money by the bank, as follows. The following items must be indented underneath currency:

decimals: <integer>
Optional entry. Must be an integer from 0 to 2. This setting is used only for displaying amounts. Account values are always carried to at least two decimal positions for calculating interest.

denominations:
String list of block types and values. Each type of block must be listed on a separate line beginning with -. These lines should be indented to the same level as "denominations" itself. Each line contains "- " to mark it as a list item, followed by the block type, a comma, and then the relative value of the block. Block types must conform to the official minecraft block names. (Typical types are EMERALD, EMERALD_BLOCK, DIAMOND, DIAMOND_BLOCK, GOLD_BLOCK, GOLD_INGOT.) At least one of the items should specify a value of 1. In the example shown, an Emerald Block is worth 9, and an Emerald is worth 1 unit.

Permissions

There are two permissions provided with BankMaster.

bankmaster.use: true

Defaults to all players have access to use bank signs.

bankmaster.admin: Op

Players with admin permission can create bank signs and use the audit and bankmaster commands.

Commands

bank
The /bank command displays your account status. You must have bankmaster.use permission (default for all users).

/bank

All players can use the bank command to display their current account status. It displays the amount of money in the account, and the current total loans outstanding.

/bank pay <player> <amount>

Withdraw <amount> from the your account and pay to <player>. This command is not yet available.

/bankmaster or /master or /bm

This admin command has the following formats:

/bm set <player> <amount>

Sets the player account to <amount> and clears loans to zero.

/bm add <player> <amount>

Adds <amount> to the named player's account.

/bm rem <player> <amount>

Removes <amount> from the named player's account. The removed money vanishes.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

Bukkit