public class Common
extends java.lang.Object
implements com.greatmancode.tools.interfaces.Common
| Constructor and Description |
|---|
Common() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetricsGraph(java.lang.String title,
boolean value)
Add a graph to Metrics
|
void |
addMetricsGraph(java.lang.String title,
java.lang.String value)
Add a graph to Metrics
|
java.lang.String |
format(java.lang.String worldName,
Currency currency,
double balance)
Format a balance to a readable string with the default formatting.
|
java.lang.String |
format(java.lang.String worldName,
Currency currency,
double balance,
DisplayFormat format)
Format a balance to a readable string.
|
AccountManager |
getAccountManager()
Retrieve the Account Manager.
|
double |
getBankPrice()
Retrieve the price of a bank account creation
|
com.greatmancode.tools.commands.CommandHandler |
getCommandManager()
Retrieve the Command Manager.
|
com.greatmancode.tools.configuration.ConfigurationManager |
getConfigurationManager()
Retrieve the Configuration Manager.
|
CurrencyManager |
getCurrencyManager()
Retrieve the Currency Manager.
|
double |
getDefaultHoldings()
Get the default amount of money a account will have
|
DisplayFormat |
getDisplayFormat()
Retrieve the display format for any formatting through
format(String, com.greatmancode.craftconomy3.currency.Currency, double, DisplayFormat) |
EventManager |
getEventManager()
Retrieve the Event manager.
|
static Common |
getInstance()
Retrieve the instance of Common.
|
com.greatmancode.tools.language.LanguageManager |
getLanguageManager()
Retrieve the
LanguageManager |
java.util.logging.Logger |
getLogger()
Retrieve the logger associated with this plugin.
|
com.greatmancode.tools.configuration.Config |
getMainConfig()
Retrieve the main configuration file
|
com.greatmancode.tools.interfaces.caller.ServerCaller |
getServerCaller()
Retrieve the Server Caller.
|
StorageHandler |
getStorageHandler()
Retrieve the Storage Handler.
|
com.greatmancode.tools.utils.Updater |
getVersionChecker()
Get the version Checker.
|
WorldGroupsManager |
getWorldGroupManager()
Retrieve the
WorldGroupsManager |
void |
initialiseDatabase()
Initialize the database Manager
|
void |
initializeCurrency()
Initialize the
CurrencyManager |
void |
initializeWorldGroup()
Initialize the
WorldGroupsManager |
static boolean |
isInitialized()
Check if the system has been initialized.
|
void |
loadDefaultSettings()
Reload the default settings.
|
void |
onDisable()
Disable the plugin.
|
void |
onEnable(com.greatmancode.tools.interfaces.caller.ServerCaller serverCaller,
java.util.logging.Logger log)
Initialize the Common core.
|
void |
reloadPlugin()
Reload the plugin.
|
void |
sendConsoleMessage(java.util.logging.Level level,
java.lang.String msg)
Sends a message to the console through the Logge.r
|
void |
setBankPrice(double value)
Set the bank account creation price
|
void |
setDefaultHoldings(double value)
Set the default amount of money a account will have
|
void |
setDisplayFormat(DisplayFormat format)
Set the display format for any formatting through
format(String, com.greatmancode.craftconomy3.currency.Currency, double, DisplayFormat) |
void |
startMetrics()
Start Metrics.
|
void |
startUp()
Initialize the
AccountManager, Metrics and EventManager |
void |
writeLog(LogInfo info,
Cause cause,
java.lang.String causeReason,
Account account,
double amount,
Currency currency,
java.lang.String worldName)
Write a transaction to the Log.
|
public void onEnable(com.greatmancode.tools.interfaces.caller.ServerCaller serverCaller,
java.util.logging.Logger log)
onEnable in interface com.greatmancode.tools.interfaces.Commonpublic void onDisable()
onDisable in interface com.greatmancode.tools.interfaces.Commonpublic void reloadPlugin()
public com.greatmancode.tools.configuration.Config getMainConfig()
public java.util.logging.Logger getLogger()
public void sendConsoleMessage(java.util.logging.Level level,
java.lang.String msg)
level - The log level to show.msg - The message to send.public static Common getInstance()
public AccountManager getAccountManager()
public com.greatmancode.tools.configuration.ConfigurationManager getConfigurationManager()
public StorageHandler getStorageHandler()
public CurrencyManager getCurrencyManager()
public com.greatmancode.tools.commands.CommandHandler getCommandManager()
public com.greatmancode.tools.interfaces.caller.ServerCaller getServerCaller()
public java.lang.String format(java.lang.String worldName,
Currency currency,
double balance,
DisplayFormat format)
worldName - The world Name associated with this balancecurrency - The currency instance associated with this balance.balance - The balance.format - the display format to usepublic java.lang.String format(java.lang.String worldName,
Currency currency,
double balance)
worldName - The world Name associated with this balancecurrency - The currency instance associated with this balance.balance - The balance.public void initialiseDatabase()
public void initializeCurrency()
CurrencyManagerpublic void initializeWorldGroup()
WorldGroupsManagerpublic void startUp()
AccountManager, Metrics and EventManagerpublic void addMetricsGraph(java.lang.String title,
java.lang.String value)
title - The title of the Graphvalue - The value of the entrypublic void addMetricsGraph(java.lang.String title,
boolean value)
title - The title of the Graphvalue - The value of the entrypublic void startMetrics()
public void writeLog(LogInfo info, Cause cause, java.lang.String causeReason, Account account, double amount, Currency currency, java.lang.String worldName)
info - The type of transaction to log.cause - The cause of the transaction.causeReason - The reason of the causeaccount - The account being impacted by the changeamount - The amount of money in this transaction.currency - The currency associated with this transactionworldName - The world name associated with this transactionpublic com.greatmancode.tools.utils.Updater getVersionChecker()
public EventManager getEventManager()
public com.greatmancode.tools.language.LanguageManager getLanguageManager()
LanguageManagerLanguageManagerpublic WorldGroupsManager getWorldGroupManager()
WorldGroupsManagerWorldGroupsManagerpublic static boolean isInitialized()
public void loadDefaultSettings()
public DisplayFormat getDisplayFormat()
format(String, com.greatmancode.craftconomy3.currency.Currency, double, DisplayFormat)public void setDisplayFormat(DisplayFormat format)
format(String, com.greatmancode.craftconomy3.currency.Currency, double, DisplayFormat)format - The format display to be set topublic double getDefaultHoldings()
public void setDefaultHoldings(double value)
value - the default amount of moneypublic double getBankPrice()
public void setBankPrice(double value)
value - the bank account creation price