mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Changes to the changes to the ChatAPI.
mcMMO will not pass null for any events that it creates about itself. Older plugins which are using depricated methods in ChatAPI will be null. Newer plugins passing null to ChatAPI will also be null. Null guarantees that it is not from mcMMO, but from an external plugin that is not specified.
This commit is contained in:
@ -61,7 +61,7 @@ public class ACommand implements CommandExecutor {
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
|
||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), message);
|
||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(mcMMO.p, player.getName(), message);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
if (chatEvent.isCancelled()) {
|
||||
@ -80,7 +80,7 @@ public class ACommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
else {
|
||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent("Console", message);
|
||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(mcMMO.p, "Console", message);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
if (chatEvent.isCancelled()) {
|
||||
|
@ -74,7 +74,7 @@ public class PCommand implements CommandExecutor {
|
||||
|
||||
String message = buffer.toString();
|
||||
|
||||
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(player.getName(), party.getName(), message);
|
||||
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(plugin, player.getName(), party.getName(), message);
|
||||
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
if (chatEvent.isCancelled()) {
|
||||
@ -111,7 +111,7 @@ public class PCommand implements CommandExecutor {
|
||||
|
||||
String message = buffer.toString();
|
||||
|
||||
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent("Console", args[0], message);
|
||||
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(plugin, "Console", args[0], message);
|
||||
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
if (chatEvent.isCancelled()) {
|
||||
|
Reference in New Issue
Block a user