本文整理汇总了Java中net.milkbowl.vault.Vault类的典型用法代码示例。如果您正苦于以下问题:Java Vault类的具体用法?Java Vault怎么用?Java Vault使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Vault类属于net.milkbowl.vault包,在下文中一共展示了Vault类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEnable
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public void onEnable()
{
this.DisabledPlayersHashMap = new HashMap<String, Boolean>();
this.DisabledEntitiesHashMap = new HashMap<Object, Boolean>();
this.MobsTimerHashMap = new HashMap<String, Integer>();
if ((Bukkit.getPluginManager().getPlugin("Vault") instanceof Vault))
{
RegisteredServiceProvider<Economy> service = Bukkit.getServicesManager().getRegistration(Economy.class);
if (service != null) {
eco = (Economy)service.getProvider();
}
}
else
{
System.out.print("[MobMoney] Error with Vault, it's necessary to starts this plugin.");
getServer().getPluginManager().disablePlugin(this);
}
onReloadConfig();
setConfig();
getServer().getPluginManager().registerEvents(this, this);
System.out.print("[MobMoney] Enabled correctly.");
}
示例2: loadEconomy
import net.milkbowl.vault.Vault; //导入依赖的package包/类
private boolean loadEconomy() {
Plugin vaultPlugin = getServer().getPluginManager().getPlugin("Vault");
if (vaultPlugin != null) {
vault = (Vault) vaultPlugin;
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
}
return economy != null;
}
示例3: checkHook
import net.milkbowl.vault.Vault; //导入依赖的package包/类
@Override
public boolean checkHook() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("Vault");
if (plugin != null && plugin instanceof Vault
&& Bukkit.getServer().getServicesManager().getRegistration(Economy.class) != null) {
Zephyrus.getPlugin().getLogger().info("[Plugin Hooks] Found and hooked Vault economy");
return true;
}
return false;
}
示例4: loadDependencies
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public void loadDependencies(){
worldEdit = (WorldEditPlugin)getServer().getPluginManager().getPlugin("WorldEdit");
if (worldEdit != null) {
MessageManager.getInstance().log("&eWorldEdit has been found.");
} else {
MessageManager.getInstance().log("&cWorldEdit not found! Disabling plugin.");
Bukkit.getPluginManager().disablePlugin(this);
}
vault = (Vault) getServer().getPluginManager().getPlugin("Vault");
if(vault != null){
MessageManager.getInstance().log("&eVault has been found");
}else{
MessageManager.getInstance().log("&cVault not found! Disabling Economy Support");
}
}
示例5: inject
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public void inject(Plugin plugin)
{
BungeePerms.getLogger().info("Injection of Bungeeperms into Vault");
try
{
Vault v = (Vault) plugin;
if (!v.isEnabled())
{
return;
}
//inject BungeePerms permissions
Method m = v.getClass().getDeclaredMethod("hookPermission", String.class, Class.class, ServicePriority.class, String[].class);
m.setAccessible(true);
m.invoke(v, "BungeePerms", Permission_BungeePerms.class, ServicePriority.Normal, new String[]
{
"net.alpenblock.bungeeperms.platform.bukkit.BukkitPlugin"
});
Field f = v.getClass().getDeclaredField("perms");
f.setAccessible(true);
f.set(v, Bukkit.getServicesManager().getRegistration(Permission.class).getProvider());
//inject BungeePerms chat
m = v.getClass().getDeclaredMethod("hookChat", String.class, Class.class, ServicePriority.class, String[].class);
m.setAccessible(true);
m.invoke(v, "BungeePerms", Chat_BungeePerms.class, ServicePriority.Normal, new String[]
{
"net.alpenblock.bungeeperms.platform.bukkit.BukkitPlugin"
});
}
catch (Exception ex)
{
BungeePerms.getInstance().getDebug().log(ex);
}
}
示例6: uninject
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public void uninject(Plugin plugin)
{
BungeePerms.getLogger().info("Uninjection of Bungeeperms into Vault");
try
{
Vault v = (Vault) plugin;
if (!v.isEnabled())
{
return;
}
//uninject BungeePerms permissions
Method m = v.getClass().getDeclaredMethod("loadChat");
m.setAccessible(true);
m.invoke(v);
//inject BungeePerms chat
m = v.getClass().getDeclaredMethod("loadPermission");
m.setAccessible(true);
m.invoke(v);
}
catch (Exception ex)
{
BungeePerms.getInstance().getDebug().log(ex);
}
}
示例7: setPlugin
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public void setPlugin(Plugin plugin) {
this.vault = (Vault) plugin;
RegisteredServiceProvider<Economy> economyProvider = this.vault.getServer().getServicesManager().getRegistration(Economy.class);
if (economyProvider != null) {
this.economy = economyProvider.getProvider();
}
}
示例8: setPlugin
import net.milkbowl.vault.Vault; //导入依赖的package包/类
@Override
public void setPlugin(Plugin plugin)
{
this.vault = (Vault)plugin;
RegisteredServiceProvider<Economy> economyProvider = this.vault.getServer().getServicesManager().getRegistration(
net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null)
{
this.economy = economyProvider.getProvider();
}
}
示例9: checkForVault
import net.milkbowl.vault.Vault; //导入依赖的package包/类
private boolean checkForVault()
{
// Check for Vault
Plugin check = Bukkit.getPluginManager().getPlugin("Vault");
if(check instanceof Vault && check.getDescription().getVersion().startsWith(VAULT_VERSION)) return true;
getLogger().severe("Capitalism cannot load without Vault installed.");
// TODO Auto-download/update.
return false;
}
示例10: setUpEcon
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public void setUpEcon() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("Vault");
if (plugin instanceof Vault) {
isVault = true;
RegisteredServiceProvider<Economy> rsp = Bukkit.getServer()
.getServicesManager().getRegistration(Economy.class);
if (rsp != null) {
econ = rsp.getProvider();
}
} else {
isVault = false;
econ = null;
}
}
示例11: VaultBank
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public VaultBank(Plugin plugin) {
this.plugin = (Vault) plugin;
this.provider = plugin.getServer().getServicesManager().getRegistration(Economy.class);
this.economy = provider.getProvider();
if (economy == null) {
throw new NullPointerException();
}
}
示例12: load
import net.milkbowl.vault.Vault; //导入依赖的package包/类
@Override
public void load ( Map < String, Object > prop ) {
if ( ! loaded ) {
Object vaultPlugin = ( Vault ) Bukkit . getPluginManager ( ) . getPlugin ( "Vault" ) ;
if ( vaultPlugin == null ) {
System . err . println ( "[ERROR] VaultPlugin not found!" ) ;
} else {
economy = Bukkit . getServer ( ) . getServicesManager ( ) . load ( Economy . class ) ;
loaded = true ;
}
}
}
示例13: getVault
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public Vault getVault() {
return vault;
}
示例14: getPlugin
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public Vault getPlugin() {
return this.vault;
}
示例15: isCompatible
import net.milkbowl.vault.Vault; //导入依赖的package包/类
public boolean isCompatible(Plugin plugin) {
return plugin instanceof Vault;
}