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:
NuclearW
2013-01-26 22:13:49 -05:00
parent 251c152efa
commit 7ccadae489
9 changed files with 10 additions and 31 deletions

View File

@ -9,8 +9,4 @@ public class McMMOAdminChatEvent extends McMMOChatEvent {
public McMMOAdminChatEvent(Plugin plugin, String sender, String message) {
super(plugin, sender, message);
}
public McMMOAdminChatEvent(String sender, String message) {
this(null, sender, message);
}
}

View File

@ -5,8 +5,6 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.mcMMO;
public class McMMOChatEvent extends Event implements Cancellable {
private boolean cancelled;
private Plugin plugin;
@ -14,17 +12,13 @@ public class McMMOChatEvent extends Event implements Cancellable {
private String message;
protected McMMOChatEvent(Plugin plugin, String sender, String message) {
if (plugin == null) {
plugin = mcMMO.p;
}
this.plugin = plugin;
this.sender = sender;
this.message = message;
}
/**
* @return The plugin responsible for this event
* @return The plugin responsible for this event, note this can be null
*/
public Plugin getPlugin() {
return plugin;

View File

@ -13,10 +13,6 @@ public class McMMOPartyChatEvent extends McMMOChatEvent {
this.party = party;
}
public McMMOPartyChatEvent(String sender, String party, String message) {
this(null, sender, party, message);
}
/**
* @return String name of the party the message will be sent to
*/