当前位置: 首页>>代码示例>>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;未经允许,请勿转载。