This commit is contained in:
Olof Larsson 2011-10-16 12:12:49 +02:00
parent 3d33088f47
commit aad9819ae9
2 changed files with 7 additions and 1 deletions

View File

@ -119,7 +119,12 @@ public abstract class MPlugin extends JavaPlugin
public void registerEvent(Event.Type type, Listener listener, Event.Priority priority) public void registerEvent(Event.Type type, Listener listener, Event.Priority priority)
{ {
Bukkit.getServer().getPluginManager().registerEvent(type, listener, priority, this); Bukkit.getServer().getPluginManager().registerEvent(type, listener, priority, this);
}
public void registerEvent(Event.Type type, Listener listener)
{
registerEvent(type, listener, Event.Priority.Normal);
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -19,6 +19,7 @@ public class MPluginSecretServerListener extends ServerListener
// reference command will be used to prevent "unknown command" console messages // reference command will be used to prevent "unknown command" console messages
try try
{ {
@SuppressWarnings("unchecked")
Map<String, Object> refCmd = (Map<String, Object>) p.getDescription().getCommands(); Map<String, Object> refCmd = (Map<String, Object>) p.getDescription().getCommands();
if (refCmd != null && !refCmd.isEmpty()) if (refCmd != null && !refCmd.isEmpty())
refCommand = (String)(refCmd.keySet().toArray()[0]); refCommand = (String)(refCmd.keySet().toArray()[0]);