当前位置: 首页>>代码示例>>Java>>正文


Java Vault类代码示例

本文整理汇总了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.");
}
 
开发者ID:AnonymousDr,项目名称:ADR,代码行数:23,代码来源:mobs.java

示例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;
}
 
开发者ID:GameBoxx,项目名称:GameBoxx,代码行数:12,代码来源:GameBoxx.java

示例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;
}
 
开发者ID:mcardy,项目名称:Zephyrus-II,代码行数:11,代码来源:VaultHook.java

示例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");
    }
}
 
开发者ID:endercrest,项目名称:ColorCube,代码行数:16,代码来源:ColorCube.java

示例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);
    }
}
 
开发者ID:weaondara,项目名称:BungeePerms,代码行数:38,代码来源:VaultBridge.java

示例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);
    }
}
 
开发者ID:weaondara,项目名称:BungeePerms,代码行数:29,代码来源:VaultBridge.java

示例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();
    }
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:8,代码来源:VaultEco.java

示例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();
	}
}
 
开发者ID:Curtis3321,项目名称:Essentials,代码行数:12,代码来源:VaultEco.java

示例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;
}
 
开发者ID:DemigodsRPG,项目名称:Capitalism,代码行数:10,代码来源:CapitalismPlugin.java

示例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;
	}
}
 
开发者ID:mcardy,项目名称:Zephyrus,代码行数:15,代码来源:SpellBook.java

示例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();
    }
}
 
开发者ID:cybertiger,项目名称:Bukkit-Instances,代码行数:9,代码来源:VaultBankFactory.java

示例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 ;

		}
					
	}
	
}
 
开发者ID:Pishka,项目名称:MineDonate,代码行数:23,代码来源:VaultBukkitPlugin.java

示例13: getVault

import net.milkbowl.vault.Vault; //导入依赖的package包/类
public Vault getVault() {
    return vault;
}
 
开发者ID:GameBoxx,项目名称:GameBoxx,代码行数:4,代码来源:GameBoxx.java

示例14: getPlugin

import net.milkbowl.vault.Vault; //导入依赖的package包/类
public Vault getPlugin() {
    return this.vault;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:4,代码来源:VaultEco.java

示例15: isCompatible

import net.milkbowl.vault.Vault; //导入依赖的package包/类
public boolean isCompatible(Plugin plugin) {
    return plugin instanceof Vault;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:4,代码来源:VaultEco.java


注:本文中的net.milkbowl.vault.Vault类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。