Class MVMessaging

    • Constructor Summary

      Constructors 
      Constructor Description
      MVMessaging()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCooldown()
      Gets the message-cooldown.
      boolean sendMessage​(org.bukkit.command.CommandSender sender, java.lang.String message, boolean ignoreCooldown)
      Sends a message to the specified sender if the cooldown has passed.
      boolean sendMessages​(org.bukkit.command.CommandSender sender, java.lang.String[] messages, boolean ignoreCooldown)
      Sends a group of messages to the specified sender if the cooldown has passed.
      boolean sendMessages​(org.bukkit.command.CommandSender sender, java.util.Collection<java.lang.String> messages, boolean ignoreCooldown)
      Sends a group of messages to the specified sender if the cooldown has passed.
      void setCooldown​(int milliseconds)
      Sets the message-cooldown.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MVMessaging

        public MVMessaging()
    • Method Detail

      • setCooldown

        public void setCooldown​(int milliseconds)
        Sets the message-cooldown.
        Specified by:
        setCooldown in interface MultiverseMessaging
        Parameters:
        milliseconds - The new message-cooldown in milliseconds.
      • sendMessage

        public boolean sendMessage​(org.bukkit.command.CommandSender sender,
                                   java.lang.String message,
                                   boolean ignoreCooldown)
        Sends a message to the specified sender if the cooldown has passed.
        Specified by:
        sendMessage in interface MultiverseMessaging
        Parameters:
        sender - The person/console to send the message to.
        message - The message to send.
        ignoreCooldown - If true this message will always be sent. Useful for things like menus
        Returns:
        true if the message was sent, false if not.
      • sendMessages

        public boolean sendMessages​(org.bukkit.command.CommandSender sender,
                                    java.lang.String[] messages,
                                    boolean ignoreCooldown)
        Sends a group of messages to the specified sender if the cooldown has passed. This method is needed, since sending many messages in quick succession would violate the cooldown.
        Specified by:
        sendMessages in interface MultiverseMessaging
        Parameters:
        sender - The person/console to send the message to.
        messages - The messages to send.
        ignoreCooldown - If true these messages will always be sent. Useful for things like menus
        Returns:
        true if the message was sent, false if not.
      • sendMessages

        public boolean sendMessages​(org.bukkit.command.CommandSender sender,
                                    java.util.Collection<java.lang.String> messages,
                                    boolean ignoreCooldown)
        Sends a group of messages to the specified sender if the cooldown has passed. This method is needed, since sending many messages in quick succession would violate the cooldown.
        Specified by:
        sendMessages in interface MultiverseMessaging
        Parameters:
        sender - The person/console to send the message to.
        messages - The messages to send.
        ignoreCooldown - If true these messages will always be sent. Useful for things like menus
        Returns:
        true if the message was sent, false if not.
      • getCooldown

        public int getCooldown()
        Gets the message-cooldown.
        Specified by:
        getCooldown in interface MultiverseMessaging
        Returns:
        The message-cooldown.