Fix command restrict
This commit is contained in:
parent
015021bbf0
commit
4810eb0ac4
@ -20,13 +20,14 @@ public class CommandRestrict implements Listener {
|
|||||||
String playercommand = event.getMessage().toLowerCase();
|
String playercommand = event.getMessage().toLowerCase();
|
||||||
if (plugin.sit.containsKey(player.getName()))
|
if (plugin.sit.containsKey(player.getName()))
|
||||||
{
|
{
|
||||||
|
if (plugin.sitDisableAllCommands)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage(plugin.msgCommandRestricted);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (String disabledCommand : plugin.sitDisabledCommands)
|
for (String disabledCommand : plugin.sitDisabledCommands)
|
||||||
{
|
{
|
||||||
if (plugin.sitDisableAllCommands)
|
|
||||||
{
|
|
||||||
event.setCancelled(true);
|
|
||||||
player.sendMessage(plugin.msgCommandRestricted);
|
|
||||||
} else
|
|
||||||
if (disabledCommand.startsWith(playercommand))
|
if (disabledCommand.startsWith(playercommand))
|
||||||
{
|
{
|
||||||
String therest = disabledCommand.replace(playercommand, "");
|
String therest = disabledCommand.replace(playercommand, "");
|
||||||
@ -34,6 +35,7 @@ public class CommandRestrict implements Listener {
|
|||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(plugin.msgCommandRestricted);
|
player.sendMessage(plugin.msgCommandRestricted);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user