EconomyAPI icon

EconomyAPI -----

Provides economy api



added bank
added bank
example
Code (Java):
public class EconomyAPIProvider implements EconomyProvider {
    private EssentialsA getEss ( ) {
        return EssentialsA. getInstance ( ) ;
    }
    @Override
    public boolean isEnable ( ) {
        return getEss ( ). getConfig ( ). getBoolean ( "economy.enable" ) ;
    }

    /**
     * Plugin Name
     *
     * @return
     */

    @Override
    public String getName ( ) {
        return getEss ( ). name ( ) ;
    }

    /**
     * Your own format
     *
     * @param value
     * @return
     */

    @Override
    public String format ( double value ) {
        return getEss ( ). getEconomyHandler ( ). format (value ) ;
    }

    /**
     * Currency symbol such as $
     *
     * @return
     */

    @Override
    public String currency ( ) {
        return getEss ( ). getEconomyHandler ( ). currency ( ) ;
    }

    /**
     * If player has account
     *
     * @param offlinePlayer
     */

    @Override
    public boolean exists (OfflinePlayer offlinePlayer ) {
        return getEss ( ). getUserdata (offlinePlayer ). exists ( ) ;
    }

    /**
     * Create player account/file
     *
     * @param offlinePlayer
     */

    @Override
    public void create (OfflinePlayer offlinePlayer ) {
        getEss ( ). getUserdata (offlinePlayer ). setup ( ) ;
    }

    /**
     * Get raw Double account
     *
     * @param offlinePlayer
     */

    @Override
    public double get (OfflinePlayer offlinePlayer ) {
        return getEss ( ). getEconomyHandler ( ). get (offlinePlayer ) ;
    }

    /**
     * If player has
     *
     * @param offlinePlayer
     * @param amount
     */

    @Override
    public boolean has (OfflinePlayer offlinePlayer, double amount ) {
        return getEss ( ). getEconomyHandler ( ). has (offlinePlayer, amount ) ;
    }

    /**
     * Add Economy to Target
     *
     * @param offlinePlayer
     * @param amount
     */

    @Override
    public void add (OfflinePlayer offlinePlayer, double amount ) {
        getEss ( ). getEconomyHandler ( ). add (offlinePlayer, amount ) ;
    }

    /**
     * Remove Economy from Target
     *
     * @param offlinePlayer
     * @param amount
     */

    @Override
    public void remove (OfflinePlayer offlinePlayer, double amount ) {
        getEss ( ). getEconomyHandler ( ). remove (offlinePlayer, amount ) ;
    }

    /**
     * If Your Plugin supports Bank function
     *
     * @return
     */

    @Override
    public boolean supportsBank ( ) {
        return true ;
    }

    /**
     * Gets raw Double Bank account
     *
     * @param owner
     * @return
     */

    @Override
    public double getBank (OfflinePlayer owner ) {
        return getEss ( ). getEconomyHandler ( ). getBank (owner ) ;
    }

    /**
     * if Target has Bank account
     *
     * @param owner
     * @param amount
     * @return
     */

    @Override
    public boolean hasBank (OfflinePlayer owner, double amount ) {
        return getEss ( ). getEconomyHandler ( ). hasBank (owner, amount ) ;
    }

    /**
     * Add Bank Economy to Target
     *
     * @param owner
     * @param amount
     */

    @Override
    public void addBank (OfflinePlayer owner, double amount ) {
        getEss ( ). getEconomyHandler ( ). addBank (owner, amount ) ;
    }

    /**
     * Remove Bank Economy from Target
     *
     * @param owner
     * @param amount
     */

    @Override
    public void removeBank (OfflinePlayer owner, double amount ) {
        getEss ( ). getEconomyHandler ( ). removeBank (owner, amount ) ;
    }

    /**
     * if Target is Bank Member for Owner
     *
     * @param owner
     * @param target
     * @return
     */

    @Override
    public boolean isBankMember (OfflinePlayer owner, OfflinePlayer target ) {
        return false ;
    }
}
----------, Aug 28, 2024
Resource Information
Author:
----------
Total Downloads: 52
First Release: Aug 28, 2024
Last Update: Aug 28, 2024
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings