Make bare /f command show help.
Just making the plugin think they actually executed the help command because the help pages are built inside of that class and I'd rather not worry about moving them out of there or easily accessible.
This commit is contained in:
parent
2db15f6447
commit
5938a4987e
@ -169,14 +169,13 @@ public class P extends MPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly) {
|
public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly) {
|
||||||
return sender instanceof Player && FactionsPlayerListener.preventCommand(commandString, (Player) sender) || super.handleCommand(sender, commandString, testOnly);
|
return sender instanceof Player && FactionsPlayerListener.preventCommand(commandString, (Player) sender) || super.handleCommand(sender, commandString, testOnly);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] split) {
|
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 bare command at this point, it has already been handled by MPlugin's command listeners
|
||||||
if (split == null || split.length == 0) {
|
if (split == null || split.length == 0) {
|
||||||
return true;
|
return handleCommand(sender, "/f help", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, needs to be handled; presumably another plugin directly ran the command
|
// otherwise, needs to be handled; presumably another plugin directly ran the command
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
package com.massivecraft.factions.zcore;
|
|
||||||
|
|
||||||
import com.massivecraft.factions.P;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
import org.bukkit.command.CommandExecutor;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
|
|
||||||
public class FCommandHandler implements CommandExecutor {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
|
||||||
if (P.p.handleCommand(sender, cmd.getName() + args)) {
|
|
||||||
if (P.p.logPlayerCommands()) {
|
|
||||||
Bukkit.getLogger().info("[PLAYER_COMMAND] " + sender.getName() + ": " + cmd.getName() + args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
@ -94,8 +94,6 @@ public abstract class MPlugin extends JavaPlugin {
|
|||||||
this.mPluginSecretServerListener = new MPluginSecretServerListener(this);
|
this.mPluginSecretServerListener = new MPluginSecretServerListener(this);
|
||||||
getServer().getPluginManager().registerEvents(this.mPluginSecretPlayerListener, this);
|
getServer().getPluginManager().registerEvents(this.mPluginSecretPlayerListener, this);
|
||||||
getServer().getPluginManager().registerEvents(this.mPluginSecretServerListener, this);
|
getServer().getPluginManager().registerEvents(this.mPluginSecretServerListener, this);
|
||||||
getCommand("factions").setExecutor(new FCommandHandler());
|
|
||||||
|
|
||||||
|
|
||||||
// Register recurring tasks
|
// Register recurring tasks
|
||||||
if (saveTask == null && Conf.saveToFileEveryXMinutes > 0.0) {
|
if (saveTask == null && Conf.saveToFileEveryXMinutes > 0.0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user