當前位置: 首頁>>代碼示例>>Java>>正文


Java Chat類代碼示例

本文整理匯總了Java中net.milkbowl.vault.chat.Chat的典型用法代碼示例。如果您正苦於以下問題:Java Chat類的具體用法?Java Chat怎麽用?Java Chat使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Chat類屬於net.milkbowl.vault.chat包,在下文中一共展示了Chat類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: hook

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
/**
 * Registers the LuckPerms implementation of {@link Permission} and {@link Chat} with
 * the service manager.
 *
 * @param plugin the plugin
 */
public void hook(LPBukkitPlugin plugin) {
    try {
        if (this.permissionHook == null) {
            this.permissionHook = new VaultPermissionHook(plugin);
        }

        if (this.chatHook == null) {
            this.chatHook = new VaultChatHook(plugin, this.permissionHook);
        }

        final ServicesManager sm = plugin.getServer().getServicesManager();
        sm.register(Permission.class, this.permissionHook, plugin, ServicePriority.High);
        sm.register(Chat.class, this.chatHook, plugin, ServicePriority.High);

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:lucko,項目名稱:LuckPerms,代碼行數:25,代碼來源:VaultHookManager.java

示例2: onEnable

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
@Override
public void onEnable()
{
	ServicesManager sm = handler.getServer().getServicesManager();

	RegisteredServiceProvider<Permission> permProvider = sm.getRegistration(Permission.class);
	if (permProvider != null)
		perm = permProvider.getProvider();

	RegisteredServiceProvider<Economy> econProvider = sm.getRegistration(Economy.class);
	if (econProvider != null)
		econ = econProvider.getProvider();

	RegisteredServiceProvider<Chat> chatProvider = sm.getRegistration(Chat.class);
	if (chatProvider != null)
		chat = chatProvider.getProvider();
}
 
開發者ID:dmulloy2,項目名稱:SwornAPI,代碼行數:18,代碼來源:VaultHandler.java

示例3: getVaultChat

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
/**
 * Если Vault установлен на сервере и включён, а также имеется какой-нибудь плагин,
 * предоставляющий нужный интерфейс, он будет возвращён, иначе будет возвращено null.
 * @return net.milkbowl.vault.chat.Chat
 */
public Chat getVaultChat()
{
	if(chat == null)
	{
		if(plugin.getServer().getPluginManager().isPluginEnabled("Vault"))
		{
			plugin.logger.info("Found Vault! Searching for chat plugin...");
			final ServicesManager servicesManager = plugin.getServer().getServicesManager();
			RegisteredServiceProvider<Chat> provider = servicesManager.getRegistration(Chat.class);
			if(provider != null)
				chat = provider.getProvider();
			if(chat != null && chat.isEnabled())
				plugin.logger.log(Level.INFO, "Using {0} as chat provider.", chat.getName());
		}
	}
	return chat;
}
 
開發者ID:RuBukkit,項目名稱:RuBukkit-Template,代碼行數:23,代碼來源:IntegrateVault.java

示例4: ChatRenderer

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
public ChatRenderer(RedisChat plugin) {
	this.plugin = plugin;
	// setup vault perms for looking up players group. and vault chat for getting chat prefixes.
	RegisteredServiceProvider<Permission> rsp = plugin.getServer().getServicesManager().getRegistration(Permission.class);
	vaultPerms = rsp.getProvider();
	if (vaultPerms == null) {
		throw new RuntimeException("Vault and a permissions plugin are required.");
	}

	RegisteredServiceProvider<Chat> rspc = plugin.getServer().getServicesManager().getRegistration(Chat.class);
	vaultChat = rspc.getProvider();
	if (vaultChat == null) {
		throw new RuntimeException("Vault and a permissions plugin are required.");
	}

	// Setup the "base" NBT Tag that we'll use to render sender's hover data
	this.baseTag = new NBTTagCompound();
	this.baseTag.set("id", new NBTTagShort((short) 1));
	this.baseTag.set("Damage", new NBTTagShort((short) 0));
	this.baseTag.set("Count", new NBTTagByte((byte) 1));
	NBTTagCompound tag = new NBTTagCompound();
	NBTTagCompound dispTag = new NBTTagCompound();
	tag.set("display", dispTag);
	this.baseTag.set("tag", tag);
}
 
開發者ID:ulchm,項目名稱:RedisChat,代碼行數:26,代碼來源:ChatRenderer.java

示例5: VaultHook

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
public VaultHook(xEssentials pl) {
	this.pl = pl;
	RegisteredServiceProvider<Economy> ep = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
	RegisteredServiceProvider<Chat> cp = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.chat.Chat.class);
	RegisteredServiceProvider<Permission> pp = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class);

	if(ep instanceof RegisteredServiceProvider) {
		this.econ = ep.getProvider();
	}
	if(cp instanceof RegisteredServiceProvider) {
		this.chat = cp.getProvider();
	}
	if(pp instanceof RegisteredServiceProvider) {
		this.perm = pp.getProvider();
	}

}
 
開發者ID:xEssentials,項目名稱:xEssentials-deprecated-bukkit,代碼行數:18,代碼來源:VaultHook.java

示例6: inGroup

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
@Override
public boolean inGroup(final CommandSender player, final String groupname)
{
	try
	{
		final Chat chat = getServiceProvider(Chat.class);
		for (String group : chat.getPlayerGroups(getPlayer(player)))
		{
			if (group.equalsIgnoreCase(groupname))
			{
				return true;
			}
		}
	}
	catch (Exception e)
	{
		ess.getLogger().log(Level.WARNING, e.getMessage(), e);
	}
	return false;
}
 
開發者ID:Curtis3321,項目名稱:Essentials,代碼行數:21,代碼來源:VaultGroups.java

示例7: invoke

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
public static void invoke()
{
    ServicesManager servicesManager = BukkitBootstrap.getPlugin(BukkitBootstrap.class).getServer().getServicesManager();

    Permission permission = new VaultPermissionImpl();

    servicesManager.register(Permission.class, permission, BukkitBootstrap.getPlugin(BukkitBootstrap.class), ServicePriority.Highest);
    servicesManager.register(Chat.class, new VaultChatImpl(permission), BukkitBootstrap.getPlugin(BukkitBootstrap.class), ServicePriority.Highest);
}
 
開發者ID:Dytanic,項目名稱:CloudNet,代碼行數:10,代碼來源:VaultInvoker.java

示例8: setupChat

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
/**
 * This method will return whether or not the chat provider
 * has been setup or not.
 */
private boolean setupChat ()
{
    RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager ().getRegistration (Chat.class);

    if (null != rsp)
    {
        mChat = rsp.getProvider ();
    }

    return mChat != null;
}
 
開發者ID:MagnaRisa,項目名稱:CraftyProfessions,代碼行數:16,代碼來源:CraftyProfessions.java

示例9: getVaultChat

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
public static Chat getVaultChat() {
    if(chat == null){
        RegisteredServiceProvider<Chat> provider = Bukkit.getServer().getServicesManager().getRegistration(Chat.class);
        if (provider != null) {
            return chat = provider.getProvider();
        } else {
            throw new RuntimeException("Vault Error: No ChatProvider found");
        }
    } else {
        return chat;
    }
}
 
開發者ID:NyaaCat,項目名稱:NyaaCore,代碼行數:13,代碼來源:VaultUtils.java

示例10: setupChat

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
private boolean setupChat() {
	RegisteredServiceProvider<Chat> chatProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.chat.Chat.class);
	if (chatProvider != null) {
		chat = chatProvider.getProvider();
	}
	return chat != null;
}
 
開發者ID:benNek,項目名稱:AsgardAscension,代碼行數:8,代碼來源:Main.java

示例11: refreshVault

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
private void refreshVault() {
    Chat vaultChat = getServer().getServicesManager().load(Chat.class);
    if (vaultChat != this.vaultChat) {
        getLogger().info("New Vault Chat implementation registered: " + (vaultChat == null ? "null" : vaultChat.getName()));
    }
    this.vaultChat = vaultChat;
}
 
開發者ID:lucko,項目名稱:VaultChatFormatter,代碼行數:8,代碼來源:ChatFormatterPlugin.java

示例12: setupChat

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
private boolean setupChat() {
    if (!available()) {
        return false;
    }
    RegisteredServiceProvider<Chat> rsp = Bukkit.getServicesManager().getRegistration(Chat.class);
    if (rsp == null) {
        return false;
    }
    chat = rsp.getProvider();
    return chat != null;
}
 
開發者ID:CyR1en,項目名稱:Minecordbot,代碼行數:12,代碼來源:VaultHook.java

示例13: setupChat

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
public static boolean setupChat()
{
    RegisteredServiceProvider<Chat> chatProvider = Skywars.pl.getServer().getServicesManager().getRegistration(net.milkbowl.vault.chat.Chat.class);
    if (chatProvider != null) {
      Skywars.chat = chatProvider.getProvider();
    }

    return (Skywars.chat != null);
}
 
開發者ID:SpikyBite,項目名稱:BiteSkywars,代碼行數:10,代碼來源:Vault.java

示例14: unhook

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
/**
 * Unregisters the LuckPerms Vault hooks, if present.
 *
 * @param plugin the plugin
 */
public void unhook(LPBukkitPlugin plugin) {
    final ServicesManager sm = plugin.getServer().getServicesManager();

    if (this.permissionHook != null) {
        sm.unregister(Permission.class, this.permissionHook);
        this.permissionHook.getExecutor().shutdown();
        this.permissionHook = null;
    }

    if (this.chatHook != null) {
        sm.unregister(Chat.class, this.chatHook);
        this.chatHook = null;
    }
}
 
開發者ID:lucko,項目名稱:LuckPerms,代碼行數:20,代碼來源:VaultHookManager.java

示例15: init

import net.milkbowl.vault.chat.Chat; //導入依賴的package包/類
@SuppressWarnings("null")
@Override
protected boolean init() {
	economy = Bukkit.getServicesManager().getRegistration(Economy.class) == null ? null : Bukkit.getServicesManager().getRegistration(Economy.class).getProvider();
	chat = Bukkit.getServicesManager().getRegistration(Chat.class) == null ? null : Bukkit.getServicesManager().getRegistration(Chat.class).getProvider();
	return economy != null || chat != null;
}
 
開發者ID:nfell2009,項目名稱:Skript,代碼行數:8,代碼來源:VaultHook.java


注:本文中的net.milkbowl.vault.chat.Chat類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。