mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Restore ability to change message in ClientChatEvent (#9377)
This commit is contained in:
1 parent
b493a63fb6
commit
6e1de81ff5
2 files changed
+17
-16
No files matched your search
@@ -24,36 +24,37 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
@Cancelable
|
||||
public class ClientChatEvent extends Event
|
||||
{
|
||||
// private String message;
|
||||
private String message;
|
||||
private final String originalMessage;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public ClientChatEvent(String message)
|
||||
{
|
||||
// this.setMessage(message);
|
||||
this.setMessage(message);
|
||||
this.originalMessage = Strings.nullToEmpty(message);
|
||||
this.message = this.originalMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the message that will be sent to the server, if the event is not cancelled}
|
||||
* {@return the message that will be sent to the server, if the event is not cancelled. This can be changed by mods}
|
||||
*/
|
||||
public String getMessage()
|
||||
{
|
||||
return this.originalMessage;
|
||||
return this.message;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Sets the new message to be sent to the server, if the event is not cancelled.
|
||||
// *
|
||||
// * @param message the new message to be sent
|
||||
// */
|
||||
// public void setMessage(String message)
|
||||
// {
|
||||
// this.message = Strings.nullToEmpty(message);
|
||||
// }
|
||||
/**
|
||||
* Sets the new message to be sent to the server, if the event is not cancelled.
|
||||
*
|
||||
* @param message the new message to be sent
|
||||
*/
|
||||
public void setMessage(String message)
|
||||
{
|
||||
this.message = Strings.nullToEmpty(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the original message that was to be sent to the server}
|
||||
* {@return the original message that was to be sent to the server. This cannot be changed by mods}
|
||||
*/
|
||||
public String getOriginalMessage()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user