Remove MPluginSecretServerListener. Fixes #414
This commit is contained in:
parent
11bd632b15
commit
c68d3e8e2f
@ -182,8 +182,7 @@ public class P extends MPlugin {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] split) {
|
||||
// if bare command at this point, it has already been handled by MPlugin's command listeners
|
||||
if (split == null || split.length == 0) {
|
||||
if (split.length == 0) {
|
||||
return handleCommand(sender, "/f help", false);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,6 @@ public abstract class MPlugin extends JavaPlugin {
|
||||
|
||||
// Listeners
|
||||
private MPluginSecretPlayerListener mPluginSecretPlayerListener;
|
||||
private MPluginSecretServerListener mPluginSecretServerListener;
|
||||
|
||||
// Our stored base commands
|
||||
private List<MCommand<?>> baseCommands = new ArrayList<MCommand<?>>();
|
||||
@ -98,11 +97,9 @@ public abstract class MPlugin extends JavaPlugin {
|
||||
} catch (ClassCastException ex) {
|
||||
}
|
||||
|
||||
// Create and register listeners
|
||||
// Create and register player command listener
|
||||
this.mPluginSecretPlayerListener = new MPluginSecretPlayerListener(this);
|
||||
this.mPluginSecretServerListener = new MPluginSecretServerListener(this);
|
||||
getServer().getPluginManager().registerEvents(this.mPluginSecretPlayerListener, this);
|
||||
getServer().getPluginManager().registerEvents(this.mPluginSecretServerListener, this);
|
||||
|
||||
// Register recurring tasks
|
||||
if (saveTask == null && Conf.saveToFileEveryXMinutes > 0.0) {
|
||||
|
@ -1,27 +0,0 @@
|
||||
package com.massivecraft.factions.zcore;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.ServerCommandEvent;
|
||||
|
||||
public class MPluginSecretServerListener implements Listener {
|
||||
|
||||
private MPlugin p;
|
||||
|
||||
public MPluginSecretServerListener(MPlugin p) {
|
||||
this.p = p;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onServerCommand(ServerCommandEvent event) {
|
||||
if (event.getCommand().length() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.handleCommand(event.getSender(), event.getCommand())) {
|
||||
event.setCommand(p.refCommand);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user