Package net.milkbowl.vault.chat

Examples of net.milkbowl.vault.chat.Chat


    }

    private void hookChat (String name, Class<? extends Chat> hookClass, ServicePriority priority, String...packages) {
        try {
            if (packagesExists(packages)) {
                Chat chat = hookClass.getConstructor(Plugin.class, Permission.class).newInstance(this, perms);
                sm.register(Chat.class, chat, this, priority);
                log.info(String.format("[Chat] %s found: %s", name, chat.isEnabled() ? "Loaded" : "Waiting"));
            }
        } catch (Exception e) {
            log.severe(String.format("[Chat] There was an error hooking %s - check to make sure you're using a compatible version!", name));
        }
    }
View Full Code Here


        }

        String registeredChats = null;
        Collection<RegisteredServiceProvider<Chat>> chats = this.getServer().getServicesManager().getRegistrations(Chat.class);
        for (RegisteredServiceProvider<Chat> chat : chats) {
            Chat c = chat.getProvider();
            if (registeredChats == null) {
                registeredChats = c.getName();
            } else {
                registeredChats += ", " + c.getName();
            }
        }

        // Get Economy & Permission primary Services
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        Economy econ = null;
        if (rsp != null) {
            econ = rsp.getProvider();
        }
        Permission perm = null;
        RegisteredServiceProvider<Permission> rspp = getServer().getServicesManager().getRegistration(Permission.class);
        if (rspp != null) {
            perm = rspp.getProvider();
        }
        Chat chat = null;
        RegisteredServiceProvider<Chat> rspc = getServer().getServicesManager().getRegistration(Chat.class);
        if (rspc != null) {
            chat = rspc.getProvider();
        }
        // Send user some info!
        sender.sendMessage(String.format("[%s] Vault v%s Information", getDescription().getName(), getDescription().getVersion()));
        sender.sendMessage(String.format("[%s] Economy: %s [%s]", getDescription().getName(), econ == null ? "None" : econ.getName(), registeredEcons));
        sender.sendMessage(String.format("[%s] Permission: %s [%s]", getDescription().getName(), perm == null ? "None" : perm.getName(), registeredPerms));
        sender.sendMessage(String.format("[%s] Chat: %s [%s]", getDescription().getName(), chat == null ? "None" : chat.getName(), registeredChats));
    }
View Full Code Here

        });

        // Create our Chat Graph and Add our chat Plotters
        Graph chatGraph = createGraph("Chat");
        RegisteredServiceProvider<Chat> rspChat = Bukkit.getServer().getServicesManager().getRegistration(Chat.class);
        Chat chat = null;
        if (rspChat != null) {
            chat = rspChat.getProvider();
        }
        final String chatName = chat != null ? chat.getName() : "No Chat";
        // Add our Chat Plotters
        chatGraph.addPlotter(new Metrics.Plotter(chatName) {

            @Override
            public int getValue() {
View Full Code Here

  public String applyFormat(String format, String originalFormat, Player sender)
  {
    format = this.applyFormat(format, originalFormat);
    format = format.replace("{plainsender}", sender.getName());
    format = format.replace("{world}", sender.getWorld().getName());
    Chat chat = Herochat.getChatService();
    if (chat != null)
    {
      try
      {
        String prefix = chat.getPlayerPrefix(sender);
        if (prefix == null || prefix == "")
        {
          prefix = chat.getPlayerPrefix((String)null, sender.getName());
        }
        String suffix = chat.getPlayerSuffix(sender);
        if (suffix == null || suffix == "")
        {
          suffix = chat.getPlayerSuffix((String)null, sender.getName());
        }
        String group = chat.getPrimaryGroup(sender);
        String groupPrefix = group == null ? "" : chat.getGroupPrefix(sender.getWorld(), group);
        if (group != null && (groupPrefix == null || groupPrefix == ""))
        {
          groupPrefix = chat.getGroupPrefix((String)null, group);
        }
        String groupSuffix = group == null ? "" : chat.getGroupSuffix(sender.getWorld(), group);
        if (group != null && (groupSuffix == null || groupSuffix == ""))
        {
          groupSuffix = chat.getGroupSuffix((String)null, group);
        }
        format = format.replace("{prefix}", prefix == null ? "" : prefix.replace("%", "%%"));
        format = format.replace("{suffix}", suffix == null ? "" : suffix.replace("%", "%%"));
        format = format.replace("{group}", group == null ? "" : group.replace("%", "%%"));
        format = format.replace("{groupprefix}", groupPrefix == null ? "" : groupPrefix.replace("%", "%%"));
View Full Code Here

TOP

Related Classes of net.milkbowl.vault.chat.Chat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.