1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-12 01:25:26 +02:00

More API work

This commit is contained in:
Iaccidentally
2013-05-25 15:40:44 -04:00
parent 1129a6af88
commit bc29f9d4b1
2 changed files with 51 additions and 34 deletions

View File

@@ -134,11 +134,8 @@ public class Essentials implements IEssentials
storageQueue.setEnabled(true); storageQueue.setEnabled(true);
execTimer = new ExecuteTimer(); execTimer = new ExecuteTimer();
execTimer.start(); execTimer.start();
execTimer.mark("I18n1"); execTimer.mark("I18n1");
execTimer.mark("BukkitCheck"); execTimer.mark("BukkitCheck");
reloadList = new ArrayList<IReload>(); reloadList = new ArrayList<IReload>();
settings = new SettingsHolder(this); settings = new SettingsHolder(this);
reloadList.add(settings); reloadList.add(settings);
@@ -166,13 +163,9 @@ public class Essentials implements IEssentials
spawns = new SpawnsHolder(this); spawns = new SpawnsHolder(this);
reloadList.add(spawns); reloadList.add(spawns);
onReload(); onReload();
backup = new Backup(this); backup = new Backup(this);
jails = new Jails(this); jails = new Jails(this);
reloadList.add(jails); reloadList.add(jails);
timer = new EssentialsTimer(this); timer = new EssentialsTimer(this);
getPlugin().scheduleSyncRepeatingTask(timer, 1, 100); getPlugin().scheduleSyncRepeatingTask(timer, 1, 100);
execTimer.mark("RegListeners"); execTimer.mark("RegListeners");
@@ -211,7 +204,6 @@ public class Essentials implements IEssentials
iReload.onReload(); iReload.onReload();
execTimer.mark("Reload(" + iReload.getClass().getSimpleName() + ")"); execTimer.mark("Reload(" + iReload.getClass().getSimpleName() + ")");
} }
i18n.updateLocale(settings.getLocale()); i18n.updateLocale(settings.getLocale());
} }
@@ -253,7 +245,6 @@ public class Essentials implements IEssentials
delivered++; delivered++;
} }
} }
return delivered; return delivered;
} }

View File

@@ -20,161 +20,187 @@ public interface IEssentials extends IComponent
void addReloadListener(IReload listener); void addReloadListener(IReload listener);
/** /**
* Used to send a message to one or more users
* *
* @param sender * @param sender the user sending the message
* @param message * @param message the message to send
* @return * @return the number users the message was sent to
*/ */
int broadcastMessage(IUser sender, String message); int broadcastMessage(IUser sender, String message);
/** /**
* Used to get the i18n interface
* *
* @return * @return the interface
*/ */
II18n getI18n(); II18n getI18n();
/** /**
* Used to get the Settings interface
* *
* @return * @return the interface
*/ */
ISettings getSettings(); ISettings getSettings();
/** /**
* Used to get the Ranks interface
* *
* @return * @return the interface
*/ */
IRanks getRanks(); IRanks getRanks();
/** /**
* Used to get the Jails interface
* *
* @return * @return the interface
*/ */
IJails getJails(); IJails getJails();
/** /**
* Used to get the Kits interface
* *
* @return * @return the interface
*/ */
IKits getKits(); IKits getKits();
/** /**
* Used to get the Warps interface
* *
* @return * @return the interface
*/ */
IWarps getWarps(); IWarps getWarps();
/** /**
* Used to get the Worth interface
* *
* @return * @return the interface
*/ */
IWorth getWorth(); IWorth getWorth();
/** /**
* Used to get the ItemDb interface
* *
* @return * @return the interface
*/ */
IItemDb getItemDb(); IItemDb getItemDb();
/** /**
* Used to get the UserMap interface
* *
* @return * @return the interface
*/ */
IUserMap getUserMap(); IUserMap getUserMap();
/** /**
* Used to get the Backup interface
* *
* @return * @return the interface
*/ */
IBackup getBackup(); IBackup getBackup();
/** /**
* Used to get the CommandHandler interface
* *
* @return * @return the interface
*/ */
ICommandHandler getCommandHandler(); ICommandHandler getCommandHandler();
/** /**
* Used to get a world with the given name
* *
* @param name * @param name the name of the world
* @return * @return the world
*/ */
World getWorld(String name); World getWorld(String name);
/** /**
* Used to get the payment method being used, such as Vault or Boseconomy
* *
* @return * @return the current payment method
*/ */
Methods getPaymentMethod(); Methods getPaymentMethod();
/** /**
*
* *
* @param groups * @param groups
*/ */
void setRanks(IRanks groups); void setRanks(IRanks groups);
/** /**
*
* *
* @param groups * @param groups
*/ */
void removeReloadListener(IReload groups); void removeReloadListener(IReload groups);
/** /**
* Used to get the Economy interface
* *
* @return * @return the interface
*/ */
IEconomy getEconomy(); IEconomy getEconomy();
/** /**
* Used to get the Server instance
* *
* @return * @return the instance of Server
*/ */
Server getServer(); Server getServer();
/** /**
* Used to get the Logger instance
* *
* @return * @return the instance of Logger
*/ */
Logger getLogger(); Logger getLogger();
/** /**
* Used to get the Plugin Interface
* *
* @return * @return the interface
*/ */
IPlugin getPlugin(); IPlugin getPlugin();
/** /**
* Used to get a List of vanished players by name
* *
* @return * @return a List of vanished players
*/ */
List<String> getVanishedPlayers(); List<String> getVanishedPlayers();
/** /**
* Used to get the timer
* *
* @return * @return the instance of EssentialsTimer
*/ */
EssentialsTimer getTimer(); EssentialsTimer getTimer();
/** /**
* Used internally. **maybe we should make this private**
* *
* @return * @return
*/ */
Metrics getMetrics(); Metrics getMetrics();
/** /**
* Used internally. **maybe we should make this private**
* *
* @param metrics * @param metrics
*/ */
void setMetrics(Metrics metrics); void setMetrics(Metrics metrics);
/** /**
* Used to get the instance of SpawnsHolder
* *
* @return * @return the instance
*/ */
SpawnsHolder getSpawns(); SpawnsHolder getSpawns();
/** /**
* Used to get the instance of StorageQueue
* *
* @return * @return the instance
*/ */
StorageQueue getStorageQueue(); StorageQueue getStorageQueue();
} }