mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Show command conflict in debug mode.
This commit is contained in:
parent
ea21e402ec
commit
90f87804b1
2 changed files with 12 additions and 6 deletions
|
@ -1,6 +1,8 @@
|
||||||
package com.earth2me.essentials;
|
package com.earth2me.essentials;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
import org.bukkit.command.PluginCommandYamlParser;
|
import org.bukkit.command.PluginCommandYamlParser;
|
||||||
|
@ -9,8 +11,9 @@ import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
public class AlternativeCommandsHandler
|
public class AlternativeCommandsHandler
|
||||||
{
|
{
|
||||||
|
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||||
private final transient Map<String, List<PluginCommand>> altcommands = new HashMap<String, List<PluginCommand>>();
|
private final transient Map<String, List<PluginCommand>> altcommands = new HashMap<String, List<PluginCommand>>();
|
||||||
private final transient Map<String, String> executed = new HashMap<String, String>();
|
private final transient Map<String, String> disabledList = new HashMap<String, String>();
|
||||||
private final transient IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public AlternativeCommandsHandler(final IEssentials ess)
|
public AlternativeCommandsHandler(final IEssentials ess)
|
||||||
|
@ -118,13 +121,17 @@ public class AlternativeCommandsHandler
|
||||||
return commands.get(0);
|
return commands.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void executed(final String label, final String otherlabel)
|
public void executed(final String label, final String otherLabel)
|
||||||
{
|
{
|
||||||
executed.put(label, otherlabel);
|
if (ess.getSettings().isDebug())
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + otherLabel);
|
||||||
|
}
|
||||||
|
disabledList.put(label, otherLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> disabledCommands()
|
public Map<String, String> disabledCommands()
|
||||||
{
|
{
|
||||||
return executed;
|
return disabledList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,7 +310,6 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||||
if (pc != null)
|
if (pc != null)
|
||||||
{
|
{
|
||||||
alternativeCommandsHandler.executed(commandLabel, pc.getLabel());
|
alternativeCommandsHandler.executed(commandLabel, pc.getLabel());
|
||||||
LOGGER.log(Level.FINE, "Essentials: Alternative command " + commandLabel + " found, using " + pc.getLabel());
|
|
||||||
return pc.execute(sender, commandLabel, args);
|
return pc.execute(sender, commandLabel, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue