Skip to content

Commit

Permalink
update Register (adds 3co), add spawn eggs, fixed inventory restock e…
Browse files Browse the repository at this point in the history
…rror with chests
  • Loading branch information
jascotty2 committed Jan 27, 2012
1 parent 3b5e12f commit 11acf03
Show file tree
Hide file tree
Showing 21 changed files with 2,088 additions and 120 deletions.
15 changes: 12 additions & 3 deletions changelog
Expand Up @@ -2,10 +2,16 @@
BetterShop Changelog: (the (?) means plugin didn't report that as the version.. sorry :))
===============================================================================

Version 2.1.0 - ?
items & entities updated for 1.0 (bukkit ####)
Version 2.1.1 - ?
updated register to 1.5 (adds 3co)
added spawn eggs to the shop


Version 2.1.0 - 1/10/12
items & entities updated for 1.0 (craftbukkit 1597)
fixed a bug with added items sometimes registering -1 max
added discount selling options, but recommend leaving at default
removed bukkit command-based permissions.. user.* wasn't working
changed permissions error handling.. shouldn't spam more than one error for a nested command
- (and none for a usage lookup)
added option to replace econ with exp or total exp (which is used in enchantments)
Expand All @@ -14,7 +20,10 @@ removed ftp stats tracking snippet (added in 1.6.7)
- changed to another i found with a web interface
- http://pluginstats.randomappdev.com/plugin.aspx?pid=27
- still waiting on bukkit for their implementation...

fixed non-data items, like pistons..
fixed a new spout item gui display error (added an enable delay timer)
fixed an itemstack addition bug with data values
fixed sign buy/sell with categories


Version 2.0.5 - 10/13/11
Expand Down
183 changes: 183 additions & 0 deletions src/com/nijikokun/register_1_5/payment/Method.java
@@ -0,0 +1,183 @@
package com.nijikokun.register_1_5.payment;

import org.bukkit.plugin.Plugin;

/**
* Interface to be implemented by a payment method.
*
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun)
* @copyright Copyright (C) 2011
* @license AOL license <http://aol.nexua.org>
*/
public interface Method {
/**
* Encodes the Plugin into an Object disguised as the Plugin.
* If you want the original Plugin Class you must cast it to the correct
* Plugin, to do so you have to verify the name and or version then cast.
*
* <pre>
* if(method.getName().equalsIgnoreCase("iConomy"))
* iConomy plugin = ((iConomy)method.getPlugin());</pre>
*
* @return <code>Object</code>
* @see #getName()
* @see #getVersion()
*/
public Object getPlugin();

/**
* Returns the actual name of this method.
*
* @return <code>String</code> Plugin name.
*/
public String getName();

/**
* Returns the actual version of this method.
*
* @return <code>String</code> Plugin version.
*/
public String getVersion();

/**
* Returns the amount of decimal places that get stored
* NOTE: it will return -1 if there is no rounding
*
* @return <code>int</code> for each decimal place
*/
public int fractionalDigits();

/**
* Formats amounts into this payment methods style of currency display.
*
* @param amount Double
* @return <code>String</code> - Formatted Currency Display.
*/
public String format(double amount);

/**
* Allows the verification of bank API existence in this payment method.
*
* @return <code>boolean</code>
*/
public boolean hasBanks();

/**
* Determines the existence of a bank via name.
*
* @param bank Bank name
* @return <code>boolean</code>
* @see #hasBanks
*/
public boolean hasBank(String bank);

/**
* Determines the existence of an account via name.
*
* @param name Account name
* @return <code>boolean</code>
*/
public boolean hasAccount(String name);

/**
* Check to see if an account <code>name</code> is tied to a <code>bank</code>.
*
* @param bank Bank name
* @param name Account name
* @return <code>boolean</code>
*/
public boolean hasBankAccount(String bank, String name);

/**
* Forces an account creation
*
* @param name Account name
* @return <code>boolean</code>
*/
public boolean createAccount(String name);

/**
* Forces an account creation
*
* @param name Account name
* @param balance Initial account balance
* @return <code>boolean</code>
*/
public boolean createAccount(String name, double balance);

/**
* Returns a <code>MethodAccount</code> class for an account <code>name</code>.
*
* @param name Account name
* @return <code>MethodAccount</code> <em>or</em> <code>Null</code>
*/
public MethodAccount getAccount(String name);


/**
* Returns a <code>MethodBankAccount</code> class for an account <code>name</code>.
*
* @param bank Bank name
* @param name Account name
* @return <code>MethodBankAccount</code> <em>or</em> <code>Null</code>
*/
public MethodBankAccount getBankAccount(String bank, String name);

/**
* Checks to verify the compatibility between this Method and a plugin.
* Internal usage only, for the most part.
*
* @param plugin Plugin
* @return <code>boolean</code>
*/
public boolean isCompatible(Plugin plugin);

/**
* Set Plugin data.
*
* @param plugin Plugin
*/
public void setPlugin(Plugin plugin);

/**
* Contains Calculator and Balance functions for Accounts.
*/
public interface MethodAccount {
public double balance();
public boolean set(double amount);
public boolean add(double amount);
public boolean subtract(double amount);
public boolean multiply(double amount);
public boolean divide(double amount);
public boolean hasEnough(double amount);
public boolean hasOver(double amount);
public boolean hasUnder(double amount);
public boolean isNegative();
public boolean remove();

@Override
public String toString();
}

/**
* Contains Calculator and Balance functions for Bank Accounts.
*/
public interface MethodBankAccount {
public double balance();
public String getBankName();
public int getBankId();
public boolean set(double amount);
public boolean add(double amount);
public boolean subtract(double amount);
public boolean multiply(double amount);
public boolean divide(double amount);
public boolean hasEnough(double amount);
public boolean hasOver(double amount);
public boolean hasUnder(double amount);
public boolean isNegative();
public boolean remove();

@Override
public String toString();
}
}

0 comments on commit 11acf03

Please sign in to comment.