package openmods.utils;

import java.util.List;

import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;

public abstract class SidedCommand implements ICommand {

	protected final String name;
	protected final boolean restricted;

	public SidedCommand(String name, boolean restricted) {
		this.name = name;
		this.restricted = restricted;
	}

	@Override
	public int compareTo(Object o) {
		return name.compareTo(((ICommand)o).getCommandName());
	}

	@Override
	public String getCommandName() {
		return name;
	}

	@Override
	public List<?> getCommandAliases() {
		return null;
	}

	@Override
	public boolean canCommandSenderUseCommand(ICommandSender sender) {
		int level = restricted? 4 : 0;
		return sender.canCommandSenderUseCommand(level, name);
	}
}

@@ -688,19 +688,14 @@
 %7B%0A%09%09
-int level =
+return
  res
@@ -706,24 +706,8 @@
 ted?
- 4 : 0;%0A%09%09return
  sen
@@ -741,20 +741,23 @@
 and(
-level
+4
 , name)
+ : true
 ;%0A%09%7D

Fix commands permissions