mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-26 06:53:01 +00:00
44 lines
1.2 KiB
Java
44 lines
1.2 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.network.MemoryConnection;
|
|
import net.minecraft.server.MinecraftServer;
|
|
import net.minecraft.server.dedicated.DedicatedServer;
|
|
|
|
public class CommandStart extends CommandBase {
|
|
|
|
@Override
|
|
public String getCommandName() {
|
|
return "opis_start";
|
|
}
|
|
|
|
@Override
|
|
public String getCommandUsage(ICommandSender icommandsender) {
|
|
return "";
|
|
}
|
|
|
|
@Override
|
|
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
|
modOpis.profilerRun = true;
|
|
notifyAdmins(icommandsender, "Opis started with a tick delay %s.", new Object[] {modOpis.profilerDelay});
|
|
}
|
|
|
|
@Override
|
|
public int getRequiredPermissionLevel()
|
|
{
|
|
return 3;
|
|
}
|
|
|
|
@Override
|
|
public boolean canCommandSenderUseCommand(ICommandSender sender)
|
|
{
|
|
if (sender instanceof DedicatedServer) return true;
|
|
if (((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
|
return MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(((EntityPlayerMP)sender).username);
|
|
}
|
|
|
|
}
|