mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Allow non-plugin delegate handlers to cancel player events.
This commit is contained in:
parent
9c34a134c1
commit
cac87fa7e6
@ -22,12 +22,12 @@ namespace MCGalaxy {
|
||||
/// <summary> This is the player object </summary>
|
||||
public sealed partial class Player {
|
||||
|
||||
internal bool cancelcommand = false;
|
||||
internal bool cancelchat = false;
|
||||
internal bool cancelmove = false;
|
||||
internal bool cancelBlock = false;
|
||||
internal bool cancelmysql = false;
|
||||
internal bool cancelmessage = false;
|
||||
public bool cancelcommand = false;
|
||||
public bool cancelchat = false;
|
||||
public bool cancelmove = false;
|
||||
public bool cancelBlock = false;
|
||||
public bool cancelmysql = false;
|
||||
public bool cancelmessage = false;
|
||||
internal bool HasBlockchange { get { return Blockchange != null; } }
|
||||
|
||||
//Should people be able to cancel this event?
|
||||
|
@ -215,10 +215,7 @@ namespace MCGalaxy {
|
||||
if (OnMessageRecieve != null)
|
||||
OnMessageRecieve(this, message);
|
||||
OnMessageRecieveEvent.Call(this, message);
|
||||
if ( cancelmessage ) {
|
||||
cancelmessage = false;
|
||||
return;
|
||||
}
|
||||
if (cancelmessage) { cancelmessage = false; return; }
|
||||
|
||||
retryTag: try {
|
||||
foreach (string raw in LineWrapper.Wordwrap(message)) {
|
||||
|
@ -528,9 +528,7 @@ return;
|
||||
if (PlayerChat != null) PlayerChat(this, text);
|
||||
OnPlayerChatEvent.Call(this, text);
|
||||
|
||||
if (cancelchat) {
|
||||
cancelchat = false; return;
|
||||
}
|
||||
if (cancelchat) { cancelchat = false; return; }
|
||||
if (Server.worldChat) {
|
||||
SendChatFrom(this, text);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user