mirror of https://github.com/MilkBowl/VaultAPI.git
Improved EconomyWrapper, IdentityEconomyWrapper and MultiEconomyWrapper performance
This commit is contained in:
parent
6abcb5ea27
commit
dfd74cea31
|
@ -30,10 +30,12 @@ public class EconomyWrapper {
|
|||
*/
|
||||
public boolean registerProviders(boolean force){
|
||||
ServicesManager manager = Bukkit.getServicesManager();
|
||||
if (!force && manager.isProvidedFor(IdentityEconomy.class))
|
||||
return false;
|
||||
if (!force && manager.isProvidedFor(Economy.class))
|
||||
return false;
|
||||
if (!force){
|
||||
if (manager.isProvidedFor(IdentityEconomy.class))
|
||||
return false;
|
||||
if (manager.isProvidedFor(Economy.class))
|
||||
return false;
|
||||
}
|
||||
LegacyEconomy legacy = legacy();
|
||||
manager.register(IdentityEconomy.class, legacy,
|
||||
Bukkit.getPluginManager().getPlugin("Vault"), ServicePriority.Normal);
|
||||
|
|
|
@ -20,10 +20,12 @@ public class IdentityEconomyWrapper {
|
|||
*/
|
||||
public boolean registerProviders(boolean force){
|
||||
ServicesManager manager = Bukkit.getServicesManager();
|
||||
if (!force && manager.isProvidedFor(IdentityEconomy.class))
|
||||
return false;
|
||||
if (!force && manager.isProvidedFor(Economy.class))
|
||||
return false;
|
||||
if (!force){
|
||||
if (manager.isProvidedFor(IdentityEconomy.class))
|
||||
return false;
|
||||
if (manager.isProvidedFor(Economy.class))
|
||||
return false;
|
||||
}
|
||||
manager.register(IdentityEconomy.class, economy,
|
||||
Bukkit.getPluginManager().getPlugin("Vault"), ServicePriority.Normal);
|
||||
manager.register(Economy.class, economy,
|
||||
|
|
|
@ -21,12 +21,14 @@ public class MultiEconomyWrapper {
|
|||
*/
|
||||
public boolean registerProviders(boolean force){
|
||||
ServicesManager manager = Bukkit.getServicesManager();
|
||||
if (!force && manager.isProvidedFor(MultiEconomy.class))
|
||||
return false;
|
||||
if (!force && manager.isProvidedFor(IdentityEconomy.class))
|
||||
return false;
|
||||
if (!force && manager.isProvidedFor(Economy.class))
|
||||
return false;
|
||||
if (!force){
|
||||
if (manager.isProvidedFor(MultiEconomy.class))
|
||||
return false;
|
||||
if (manager.isProvidedFor(IdentityEconomy.class))
|
||||
return false;
|
||||
if (manager.isProvidedFor(Economy.class))
|
||||
return false;
|
||||
}
|
||||
manager.register(MultiEconomy.class, economy,
|
||||
Bukkit.getPluginManager().getPlugin("Vault"), ServicePriority.Normal);
|
||||
manager.register(IdentityEconomy.class, economy.getDefault(),
|
||||
|
|
Loading…
Reference in New Issue