Archived
0

Fixed sudo blacklist not working on console

This commit is contained in:
Pepich
2018-01-19 04:39:01 +01:00
parent ae02c2c9b6
commit 7e07dcf707

View File

@@ -32,7 +32,7 @@ import net.nemez.chatapi.click.Message;
@Commands(CommandHolderType.String)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 2, compatible = 4)
@Version(major = 4, minor = 0, revision = 3, compatible = 4)
public class Misc implements Module, Listener
{
private final String[] sudoBlacklist = new String[] {"(.*:)?e?sudo", "(.*:)?script.*", "(.*:)?stop",
@@ -218,7 +218,7 @@ public class Misc implements Module, Listener
String[] args = command.split(" ");
for (String regex : sudoBlacklist)
{
if (args[0].matches("\\/" + regex))
if (args[0].matches((target.equals(Bukkit.getConsoleSender()) ? "" : "\\/") + regex))
{
getLogger().message(sender, true, "You can't sudo anyone into using that command!");
return true;