Format source
This commit is contained in:
@@ -16,25 +16,19 @@ public class CommandRestrict implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOWEST)
|
||||
public void onPlayerCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
String playercommand = event.getMessage().toLowerCase();
|
||||
if (plugin.getPlayerSitData().isSitting(player))
|
||||
{
|
||||
if (plugin.sitDisableAllCommands)
|
||||
{
|
||||
if (plugin.getPlayerSitData().isSitting(player)) {
|
||||
if (plugin.sitDisableAllCommands) {
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(plugin.msgCommandRestricted);
|
||||
return;
|
||||
}
|
||||
for (String disabledCommand : plugin.sitDisabledCommands)
|
||||
{
|
||||
if (disabledCommand.startsWith(playercommand))
|
||||
{
|
||||
for (String disabledCommand : plugin.sitDisabledCommands) {
|
||||
if (disabledCommand.startsWith(playercommand)) {
|
||||
String therest = playercommand.replace(disabledCommand, "");
|
||||
if (therest.isEmpty() || therest.startsWith(" "))
|
||||
{
|
||||
if (therest.isEmpty() || therest.startsWith(" ")) {
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(plugin.msgCommandRestricted);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user