mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
Tweak to PlayerChatEvent, allow plugins to set the player that the chat/command executes as
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
b63f46250a
commit
304ad67759
2 changed files with 11 additions and 1 deletions
|
@ -52,4 +52,14 @@ public class PlayerChatEvent extends PlayerEvent {
|
||||||
public void setMessage(String message) {
|
public void setMessage(String message) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player that this message will display as, or command will be
|
||||||
|
* executed as
|
||||||
|
*
|
||||||
|
* @param player New player which this event will execute as
|
||||||
|
*/
|
||||||
|
public void setPlayer(final Player player) {
|
||||||
|
this.player = player;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.Event;
|
||||||
* Represents a player related event
|
* Represents a player related event
|
||||||
*/
|
*/
|
||||||
public class PlayerEvent extends Event {
|
public class PlayerEvent extends Event {
|
||||||
private final Player player;
|
protected Player player;
|
||||||
|
|
||||||
public PlayerEvent(final Event.Type type, final Player who) {
|
public PlayerEvent(final Event.Type type, final Player who) {
|
||||||
super(type);
|
super(type);
|
||||||
|
|
Loading…
Reference in a new issue