Files
Opis/mcp/mobius/opis/commands/CommandStop.java
T
ProfMobius 9a474fc6ea Solved issue #1
Might have solved issue #2
2013-11-10 19:02:11 +01:00

42 lines
1.0 KiB
Java

package mcp.mobius.opis.commands;
import mcp.mobius.opis.modOpis;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.dedicated.DedicatedServer;
public class CommandStop extends CommandBase {
@Override
public String getCommandName() {
return "opis_stop";
}
@Override
public String getCommandUsage(ICommandSender icommandsender) {
return "";
}
@Override
public void processCommand(ICommandSender icommandsender, String[] astring) {
modOpis.profilerRun = false;
notifyAdmins(icommandsender, "Opis stopped.", new Object[] {});
}
@Override
public int getRequiredPermissionLevel()
{
return 3;
}
@Override
public boolean canCommandSenderUseCommand(ICommandSender sender)
{
if (sender instanceof DedicatedServer) return true;
return MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(((EntityPlayerMP)sender).username);
}
}