org.bukkit.event.player
Class PlayerCommandPreprocessEvent

java.lang.Object
  extended by org.bukkit.event.Event
      extended by org.bukkit.event.player.PlayerEvent
          extended by org.bukkit.event.player.PlayerCommandPreprocessEvent
All Implemented Interfaces:
Cancellable

public class PlayerCommandPreprocessEvent
extends PlayerEvent
implements Cancellable

Called early in the command handling process. This event is only for very exceptional cases and you should not normally use it.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
 
Field Summary
 
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
 
Constructor Summary
PlayerCommandPreprocessEvent(Player player, String message)
           
PlayerCommandPreprocessEvent(Player player, String message, Set<Player> recipients)
           
 
Method Summary
 String getFormat()
          Deprecated. This method is provided for backward compatibility with no guarantee to the use of the format.
static HandlerList getHandlerList()
           
 HandlerList getHandlers()
           
 String getMessage()
          Gets the command that the player is attempting to send.
 Set<Player> getRecipients()
          Deprecated. This method is provided for backward compatibility with no guarantee to the effect of viewing or modifying the set.
 boolean isCancelled()
          Gets the cancellation state of this event.
 void setCancelled(boolean cancel)
          Sets the cancellation state of this event.
 void setFormat(String format)
          Deprecated. This method is provided for backward compatibility with no guarantee to the effect of modifying the format.
 void setMessage(String command)
          Sets the command that the player will send.
 void setPlayer(Player player)
          Sets the player that this command will be executed as.
 
Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
 
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayerCommandPreprocessEvent

public PlayerCommandPreprocessEvent(Player player,
                                    String message)

PlayerCommandPreprocessEvent

public PlayerCommandPreprocessEvent(Player player,
                                    String message,
                                    Set<Player> recipients)
Method Detail

isCancelled

public boolean isCancelled()
Description copied from interface: Cancellable
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Specified by:
isCancelled in interface Cancellable
Returns:
true if this event is cancelled

setCancelled

public void setCancelled(boolean cancel)
Description copied from interface: Cancellable
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Specified by:
setCancelled in interface Cancellable
Parameters:
cancel - true if you wish to cancel this event

getMessage

public String getMessage()
Gets the command that the player is attempting to send. All commands begin with a special character; implementations do not consider the first character when executing the content.

Returns:
Message the player is attempting to send

setMessage

public void setMessage(String command)
                throws IllegalArgumentException
Sets the command that the player will send. All commands begin with a special character; implementations do not consider the first character when executing the content.

Parameters:
command - New message that the player will send
Throws:
IllegalArgumentException - if command is null or empty

setPlayer

public void setPlayer(Player player)
               throws IllegalArgumentException
Sets the player that this command will be executed as.

Parameters:
player - New player which this event will execute as
Throws:
IllegalArgumentException - if the player provided is null

getFormat

@Deprecated
public String getFormat()
Deprecated. This method is provided for backward compatibility with no guarantee to the use of the format.

Gets the format to use to display this chat message

Returns:
String.Format compatible format string

setFormat

@Deprecated
public void setFormat(String format)
Deprecated. This method is provided for backward compatibility with no guarantee to the effect of modifying the format.

Sets the format to use to display this chat message

Parameters:
format - String.Format compatible format string

getRecipients

@Deprecated
public Set<Player> getRecipients()
Deprecated. This method is provided for backward compatibility with no guarantee to the effect of viewing or modifying the set.

Gets a set of recipients that this chat message will be displayed to. The set returned is not guaranteed to be mutable and may auto-populate on access. Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation. Listeners should be aware that modifying the list may throw UnsupportedOperationException if the event caller provides an unmodifiable set.

Returns:
All Players who will see this chat message

getHandlers

public HandlerList getHandlers()
Specified by:
getHandlers in class Event

getHandlerList

public static HandlerList getHandlerList()


Copyright © 2013. All Rights Reserved.