Java Code Examples for net.minecraft.command.ServerCommandManager

The following are top voted examples for showing how to use net.minecraft.command.ServerCommandManager. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Overlord   File: Overlord.java   Source Code and License 6 votes vote down vote up
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent event) {
	MinecraftServer server = event.getServer();
	ICommandManager command = server.getCommandManager();

	ServerCommandManager serverCommand = (ServerCommandManager) command;

	serverCommand.registerCommand(new CommandAlly());
	serverCommand.registerCommand(new CommandAllyAccept());
	serverCommand.registerCommand(new CommandAllyList());
	serverCommand.registerCommand(new CommandAllyReject());
	serverCommand.registerCommand(new CommandAllyRemove());
	serverCommand.registerCommand(new CommandEnemy());
	serverCommand.registerCommand(new CommandEnemyList());
	serverCommand.registerCommand(new CommandEnemyRemove());
}
 
Example 2
Project: TiM   File: TModifiers.java   Source Code and License 6 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartedEvent event)
{
	((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandTModifiers());

	if(!jsonFile.exists())
		try {
			jsonFile.createNewFile();
			PrintStream out = new PrintStream(new FileOutputStream(jsonFile));
			writeDefaultJSON(out);
			out.close();
		} catch (IOException e) {
			Logger.getLogger(NAME).log(Level.WARNING, "Could not create json file - " + e);
		}

	reloadModifiers();

	//		for(ItemModifier mod : ModifyBuilder.instance.itemModifiers)
	//			System.out.println(mod.getClass());

	new Thread(){
		public void run(){
			ItemUpdate.checkForUpdate();
		}
	}.start();
}
 
Example 3
Project: TiM   File: TModifiers.java   Source Code and License 6 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartedEvent event)
{
	((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandTModifiers());

	if(!jsonFile.exists())
		try {
			jsonFile.createNewFile();
			PrintStream out = new PrintStream(new FileOutputStream(jsonFile));
			writeDefaultJSON(out);
			out.close();
		} catch (IOException e) {
			Logger.getLogger(NAME).log(Level.WARNING, "Could not create json file - " + e);
		}

	reloadModifiers();

	//		for(ItemModifier mod : ModifyBuilder.instance.itemModifiers)
	//			System.out.println(mod.getClass());

	new Thread(){
		public void run(){
			ItemUpdate.checkForUpdate();
		}
	}.start();
}
 
Example 4
Project: morecommands   File: CommonProxy.java   Source Code and License 6 votes vote down vote up
/**
 * Registers all server commands
 * 
 * @return Whether the server commands were registered successfully
 */
private void registerServerCommands(MinecraftServer server) throws Exception {
	List<Class<? extends StandardCommand>> serverCommands = this.mod.getServerCommandClasses();
	if (serverCommands == null) throw new RuntimeException("Server Command Classes not loaded");
	ServerCommandManager commandManager = (ServerCommandManager) server.getCommandManager(); 
	
	for (Class<? extends StandardCommand> cmdClass : serverCommands) {
		try {
			StandardCommand cmd = cmdClass.newInstance();
			
			if (cmd instanceof MultipleCommands) {
				Constructor<? extends StandardCommand> ctr = cmdClass.getConstructor(int.class);
				
				for (int i = 0; i < ((MultipleCommands) cmd).getCommandNames().length; i++)
					if (this.mod.isCommandEnabled(((MultipleCommands) cmd).getCommandNames()[i]))
						commandManager.registerCommand(new ServerCommand(ServerCommand.upcast(ctr.newInstance(i))));
			}
			else if (this.mod.isCommandEnabled(cmd.getCommandName()))
				commandManager.registerCommand(new ServerCommand(ServerCommand.upcast(cmd)));
		}
		catch (Exception ex) {
			this.mod.getLogger().warn("Skipping Server Command " + cmdClass.getName() + " due to the following exception during loading", ex);
		}
	}
}
 
Example 5
Project: Progression   File: Progression.java   Source Code and License 6 votes vote down vote up
@EventHandler
public void onServerStarting(FMLServerStartingEvent event) {
    ICommandManager manager = event.getServer().getCommandManager();
    if (manager instanceof ServerCommandManager) {
        ((ServerCommandManager) manager).registerCommand(CommandManager.INSTANCE);
    }

    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
        Progression.logger.log(Level.INFO, "How did a client get in the server start?");
        return;
    }

    
    //Remap all relevant data, Loads in the server data
    RemappingHandler.reloadServerData(JSONLoader.getServerTabData(RemappingHandler.getHostName()), false);
    
    World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
    data = (PlayerSavedData) world.loadItemData(PlayerSavedData.class, MODNAME);
    if (data == null) {
        createWorldData();
    }
}
 
Example 6
Project: Cauldron   File: MinecraftServer.java   Source Code and License 6 votes vote down vote up
public MinecraftServer(File p_i45281_1_, Proxy p_i45281_2_)
{
    this.field_152366_X = new PlayerProfileCache(this, field_152367_a);
    mcServer = this;
    this.serverProxy = p_i45281_2_;
    this.anvilFile = p_i45281_1_;
    this.field_147144_o = new NetworkSystem(this);
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i45281_1_);
    this.field_152364_T = new YggdrasilAuthenticationService(p_i45281_2_, UUID.randomUUID().toString());
    this.field_147143_S = this.field_152364_T.createMinecraftSessionService();
    this.field_152365_W = this.field_152364_T.createProfileRepository();
    this.primaryThread = new Thread(this, "Server thread"); // CraftBukkit
    this.cauldronConfig = new CauldronConfig("cauldron.yml", "cauldron");
    this.tileEntityConfig = new TileEntityConfig("tileentities.yml", "cauldron_te");
}
 
Example 7
Project: RuneCraftery   File: MinecraftServer.java   Source Code and License 6 votes vote down vote up
public MinecraftServer(File par1File)
{
    this.serverProxy = Proxy.NO_PROXY;
    this.field_143008_E = 0;
    this.sentPacketCountArray = new long[100];
    this.sentPacketSizeArray = new long[100];
    this.receivedPacketCountArray = new long[100];
    this.receivedPacketSizeArray = new long[100];
    this.tickTimeArray = new long[100];
    this.texturePack = "";
    mcServer = this;
    this.anvilFile = par1File;
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(par1File);
    this.registerDispenseBehaviors();
}
 
Example 8
Project: GriefGuardian   File: GriefGuardian.java   Source Code and License 6 votes vote down vote up
@EventHandler
public void onServerStarting(FMLServerStartedEvent event){
	ServerCommandManager mgr = (ServerCommandManager) MinecraftServer.getServer().getCommandManager();
	mgr.registerCommand(new ClaimCommand());
	mgr.registerCommand(new DeleteClaim());
	mgr.registerCommand(new ModifyACL());
	mgr.registerCommand(new ShowClaims());
	mgr.registerCommand(new HideClaims());
	mgr.registerCommand(new TransferClaim());
	mgr.registerCommand(new Execute());
	mgr.registerCommand(new AdminInvisibility());
	mgr.registerCommand(new AdminMode());
	
	mgr.registerCommand(new TempBan());
	mgr.registerCommand(new PermaBan());
	mgr.registerCommand(new UnBan());
	
	mgr.registerCommand(new OpenInventory());
	mgr.registerCommand(new Warp());
}
 
Example 9
Project: BetterNutritionMod   File: MinecraftServer.java   Source Code and License 6 votes vote down vote up
public MinecraftServer(File par1File)
{
    this.serverProxy = Proxy.NO_PROXY;
    this.field_143008_E = 0;
    this.sentPacketCountArray = new long[100];
    this.sentPacketSizeArray = new long[100];
    this.receivedPacketCountArray = new long[100];
    this.receivedPacketSizeArray = new long[100];
    this.tickTimeArray = new long[100];
    this.texturePack = "";
    mcServer = this;
    this.anvilFile = par1File;
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(par1File);
    this.registerDispenseBehaviors();
}
 
Example 10
Project: minecraft-hue   File: HueMod.java   Source Code and License 5 votes vote down vote up
/**
 * Save the instance of the command manager and initialize the commands.
 *
 * @param event The server starting event that was fired.
 */
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    MinecraftServer server = event.getServer();
    HueManager hueManager = HueManager.getInstance();
    hueManager.setMinecraftServer(server);
    this.listener.setWorld(server.getEntityWorld());
    this.commandManager = (ServerCommandManager) server.getCommandManager();
    this.initCommands();
}
 
Example 11
Project: Rival-Rebels-Mod   File: RivalRebels.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
	ICommandManager commandManager = MinecraftServer.getServer().getCommandManager();
	ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager);
	addCommands(serverCommandManager);
}
 
Example 12
Project: Rival-Rebels-Mod   File: RivalRebels.java   Source Code and License 5 votes vote down vote up
public void addCommands(ServerCommandManager manager)
{
	manager.registerCommand(new CommandResetGame());
	manager.registerCommand(new CommandPassword());
	manager.registerCommand(new CommandKillme());
	manager.registerCommand(new CommandPlaySound());
	manager.registerCommand(new CommandStopRounds());
	manager.registerCommand(new CommandContinueRound());
	manager.registerCommand(new CommandInspect());
	manager.registerCommand(new CommandMotD());
	manager.registerCommand(new CommandKillAll());
	manager.registerCommand(new CommandRobot());
	manager.registerCommand(new CommandConfig());
	manager.registerCommand(new CommandHotPotato());
}
 
Example 13
Project: Hammer-Mod   File: HammerMod.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
     MinecraftServer server = MinecraftServer.getServer();
     // Get's the current server instance
     
     ICommandManager command = server.getCommandManager();
     ServerCommandManager manager = (ServerCommandManager) command;
     
     //manager.registerCommand(new CommandModInfo());
     manager.registerCommand(new CommandChangelog());
     manager.registerCommand(new CommandAbilities());
}
 
Example 14
Project: BetterChat   File: BetterChat.java   Source Code and License 5 votes vote down vote up
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent e)
{
    MinecraftServer server = getServer();
    ICommandManager iCommandManager = server.getCommandManager();
    ServerCommandManager serverCommandManager = (ServerCommandManager)iCommandManager;

    serverCommandManager.registerCommand(new CommandHandler());
}
 
Example 15
Project: PopularMMOS-EpicProportions-Mod   File: EpicProportionsMod.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
	//Thread.currentThread().setName("EpicProportionsMod");
     MinecraftServer server = MinecraftServer.getServer();
     // Get's the current server instance
     
     ICommandManager command = server.getCommandManager();
     ServerCommandManager manager = (ServerCommandManager) command;
     
     manager.registerCommand(new CommandModInfo());
     manager.registerCommand(new CommandChangelog());
}
 
Example 16
Project: EnderPay   File: EnderPay.java   Source Code and License 5 votes vote down vote up
private void registerCommands(FMLServerStartingEvent event) {
    MinecraftServer server = event.getServer();
    ICommandManager command = server.getCommandManager();
    ServerCommandManager manager = (ServerCommandManager) command;
    manager.registerCommand(new CommandWallet());
    manager.registerCommand(new CommandBalance());
    manager.registerCommand(new CommandPay());
}
 
Example 17
Project: TaleCraft   File: TaleCraft.java   Source Code and License 5 votes vote down vote up
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event){
	MinecraftServer server = event.getServer();

	ICommandManager cmdmng = server.getCommandManager();
	if (cmdmng instanceof ServerCommandManager && cmdmng instanceof CommandHandler) {
		CommandHandler cmdhnd = (CommandHandler) cmdmng;
		TaleCraftCommands.register(cmdhnd);
	}

	// By calling this method, we create the ServerMirror for the given server.
	ServerHandler.getServerMirror(server);
}
 
Example 18
Project: LookingGlass   File: LookingGlass.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
	MinecraftServer mcserver = event.getServer();
	// Register commands
	((ServerCommandManager) mcserver.getCommandManager()).registerCommand(new CommandCreateView());
	// Start up the packet dispatcher we use for throttled data to client.
	ServerPacketDispatcher.getInstance().start(); //Note: This might need to be preceded by a force init of the ServerPacketDispatcher.  Doesn't seem to currently have any issues, though.
}
 
Example 19
Project: vintagetg   File: VintageTG.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void onServerStart(FMLServerStartingEvent evt) {
	MinecraftServer server = MinecraftServer.getServer();
	ICommandManager command = server.getCommandManager();
	ServerCommandManager manager = (ServerCommandManager) command;
	manager.registerCommand(new VintageCraftCommands());
}
 
Example 20
Project: UniversalCoins   File: UniversalCoins.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
	ICommandManager command = event.getServer().getCommandManager();
	ServerCommandManager manager = (ServerCommandManager) command;
	manager.registerCommand(new UCCommand());
	manager.registerCommand(new UCBalance());
	manager.registerCommand(new UCRebalance());
	manager.registerCommand(new UCGive());
	manager.registerCommand(new UCSend());
}
 
Example 21
Project: morecommands   File: CommandCommand.java   Source Code and License 5 votes vote down vote up
@Override
public String execute(CommandSender sender, String[] params) throws CommandException {
	if (params.length > 1) {
		if (params[0].equalsIgnoreCase("enable")) {
			ICommand enable = this.disabledCommands.get(params[1]);
			
			if (enable != null) {
				((ServerCommandManager) sender.getServer().getCommandManager()).registerCommand(enable);
				this.disabledCommands.remove(params[1]);
				sender.sendLangfileMessage("command.command.enabled");
			}
			else throw new CommandException("command.command.alreadyEnabled", sender);
		}
		else if (params[0].equalsIgnoreCase("disable")) {
			if (params[1].equals(this.getCommandName())) throw new CommandException("command.command.wantedToDisable", sender);
			
			ICommand disable = (ICommand) ((ServerCommandManager) sender.getServer().getCommandManager()).getCommands().get(params[1]);
			
			if (disable != null) {
				this.disabledCommands.put(disable.getName(), disable);
				((ServerCommandManager) sender.getServer().getCommandManager()).getCommands().remove(params[1]);
				sender.sendLangfileMessage("command.command.disabled");
			}
			else throw new CommandException("command.command.alreadyDisabled", sender);
		}
		else throw new CommandException("command.generic.invalidUsage", sender, this.getCommandName());
	}
	else throw new CommandException("command.generic.invalidUsage", sender, this.getCommandName());
	
	return null;
}
 
Example 22
Project: bfsr   File: BFSR.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
    ServerCommandManager manager = (ServerCommandManager) event.getServer().getCommandManager();
    manager.registerCommand(new BfsrSpawnCommand());
    manager.registerCommand(new BfsrGotoNurseryCommand());
    manager.registerCommand(new BfsrRegenTutorialDimension());
    manager.registerCommand(new BfsrTeleportCommand());
}
 
Example 23
Project: Wars-Mod   File: WarsMod.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
	MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
	ICommandManager command = server.getCommandManager();

	ServerCommandManager serverCommand = (ServerCommandManager) command;

	serverCommand.registerCommand(new CommandKills());
	serverCommand.registerCommand(new CommandShowKills());
	serverCommand.registerCommand(new CommandSetBase());
	serverCommand.registerCommand(new CommandEditMode());
}
 
Example 24
Project: Resilience-Client-Source   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File p_i45281_1_, Proxy p_i45281_2_)
{
    mcServer = this;
    this.serverProxy = p_i45281_2_;
    this.anvilFile = p_i45281_1_;
    this.field_147144_o = new NetworkSystem(this);
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i45281_1_);
    this.field_147143_S = (new YggdrasilAuthenticationService(p_i45281_2_, UUID.randomUUID().toString())).createMinecraftSessionService();
}
 
Example 25
Project: SpongeBukkit   File: BukkitCommandMap.java   Source Code and License 5 votes vote down vote up
public BukkitCommandMap(BukkitServer server)
{
    super(server);
    this.server = server;
    manager = (ServerCommandManager) server.getVanillaServer().commandManager;

    for(Object[] args: delayedRegisters)
    {
        registerInForge((Boolean)args[0], (String)args[1], (String)args[2], (Command)args[3]);
    }
    delayedRegisters = null;
}
 
Example 26
Project: fortressmod   File: FortressMod.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
     MinecraftServer server = MinecraftServer.getServer();
     
     ICommandManager command = server.getCommandManager();
     ServerCommandManager manager = (ServerCommandManager) command;
     StuckCommand stuckCommand = new StuckCommand();
     FMLCommonHandler.instance().bus().register(stuckCommand); //listen for ticks
     manager.registerCommand(stuckCommand);
}
 
Example 27
Project: Runecraft-2   File: Runecraft2.java   Source Code and License 5 votes vote down vote up
@EventHandler
  public void serverStart(FMLServerStartingEvent event)
  {
MinecraftServer server = MinecraftServer.getServer();
ICommandManager command = server.getCommandManager();
ServerCommandManager manager = (ServerCommandManager) command;
manager.registerCommand(new HomeTeleportCMD());
manager.registerCommand(new SkillsCMD());
manager.registerCommand(new SuppressExpMessagesCMD());
manager.registerCommand(new Runecraft2Help());
  }
 
Example 28
Project: vintagecraft   File: VintageCraft.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void onServerStart(FMLServerStartingEvent evt) {
	MinecraftServer server = MinecraftServer.getServer();
	ICommandManager command = server.getCommandManager();
	ServerCommandManager manager = (ServerCommandManager) command;
	manager.registerCommand(new ServerCommandsVC());
}
 
Example 29
Project: ZeroQuest   File: ZeroQuest.java   Source Code and License 5 votes vote down vote up
@EventHandler //TODO
public void serverStart(FMLServerStartingEvent event)        
{   
	Log.info("-----SERVER CONTENT LOAD INITATING-----");
	Log.info("Loading Commands...");     
    MinecraftServer server = MinecraftServer.getServer();
    ServerCommandManager cmdman = (ServerCommandManager) server.getCommandManager(); 
    cmdman.registerCommand(new CommandZeroQuest());
	Log.info("Commands Loaded Successfully!");  
	Log.info("-----SERVER CONTENT LOAD FINSHED-----");
	
}
 
Example 30
Project: mcplus_mods   File: _API.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void onServerStart(FMLServerStartingEvent parEvent)
{
	ServerCommandManager manager = CommandHandler.getCommandManager();

	Iterator<CommandBase> iter = CommandHandler.INSTANCE.iterator();
	while(iter.hasNext())
	{
		CommandBase command = iter.next();
		manager.registerCommand(command);
	}

	CommandHandler.lock();
}
 
Example 31
Project: Cauldron   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File p_i45281_1_, Proxy p_i45281_2_)
{
    this.field_152366_X = new PlayerProfileCache(this, field_152367_a);
    mcServer = this;
    this.serverProxy = p_i45281_2_;
    this.anvilFile = p_i45281_1_;
    this.field_147144_o = new NetworkSystem(this);
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i45281_1_);
    this.field_152364_T = new YggdrasilAuthenticationService(p_i45281_2_, UUID.randomUUID().toString());
    this.field_147143_S = this.field_152364_T.createMinecraftSessionService();
    this.field_152365_W = this.field_152364_T.createProfileRepository();
}
 
Example 32
Project: N-API   File: CommandRegistry.java   Source Code and License 5 votes vote down vote up
/**
 * Registers the command so you don't have to edit the base file. Is somewhat complex as
 * the register method isn't static.
 * @param command The command to register.
 */
public static void registerModCommand(ICommand command)
{
	//The check here stops an NPE.
	if (MCData.isServerSide())
	{
		((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(command);
	}
}
 
Example 33
Project: Narutocraft-PL_Mod   File: NCFMLEventHandler.java   Source Code and License 5 votes vote down vote up
/**
 * Register commands on Server Start
 * 
 * @param event
 *            "unused"
 */
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
	MinecraftServer server = MinecraftServer.getServer();
	ICommandManager command = server.getCommandManager();
	ServerCommandManager manager = (ServerCommandManager) command;
	NCCommandHandler commandHandler = new NCCommandHandler(manager);
	commandHandler.registerCommands(false);
}
 
Example 34
Project: NBTEdit   File: NBTEdit.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
	MinecraftServer server= event.getServer();
	ServerCommandManager serverCommandManager = (ServerCommandManager) server.getCommandManager();
	serverCommandManager.registerCommand(new CommandNBTEdit());
	logger.fine("Server Starting -- Added \"/nbtedit\" command");
}
 
Example 35
Project: RuneCraftery   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File p_i1498_1_) {
   this.field_110456_c = Proxy.NO_PROXY;
   this.field_143008_E = 0;
   this.field_71300_f = new long[100];
   this.field_71301_g = new long[100];
   this.field_71313_h = new long[100];
   this.field_71314_i = new long[100];
   this.field_71311_j = new long[100];
   this.field_71297_P = "";
   field_71309_l = this;
   this.field_71308_o = p_i1498_1_;
   this.field_71321_q = new ServerCommandManager();
   this.field_71310_m = new AnvilSaveConverter(p_i1498_1_);
   this.func_82355_al();
}
 
Example 36
Project: Mini-Bosses   File: MiniBosses.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void onServerStart(FMLServerStartingEvent event) {
	MinecraftServer server = event.getServer();
	ServerCommandManager manager = (ServerCommandManager)server.getCommandManager();
	
	manager.registerCommand(new CommandMiniBosses());
}
 
Example 37
Project: BetterNutritionMod   File: MyMod.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
	commandManager = (ServerCommandManager) MinecraftServer.getServer().getCommandManager();
 	commandManager.registerCommand(new BNCNutrition());
 	
}
 
Example 38
Project: MineChess   File: MineChess.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void onServerStart(FMLServerStartingEvent event){
    ServerCommandManager comManager = (ServerCommandManager)MinecraftServer.getServer().getCommandManager();
    comManager.registerCommand(new CommandAIDepth());
    comManager.registerCommand(new CommandKillPiece());
    comManager.registerCommand(new CommandDraw());
}
 
Example 39
Project: minecraft-roguelike   File: Roguelike.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event){
	MinecraftServer server = event.getServer();
	ICommandManager command = server.getCommandManager();
	ServerCommandManager serverCommand = ((ServerCommandManager) command);
	serverCommand.registerCommand(new CommandRoguelike());
}
 
Example 40
Project: secri   File: Maeme.java   Source Code and License 5 votes vote down vote up
@ServerStarting
public void onServerStart(FMLServerStartingEvent event) {
	if (MinecraftServer.getServer().getCommandManager() instanceof ServerCommandManager) {
		((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandSpawn());
		((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandStruc());
		((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandFreeze());
		((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandHeal());
	}
}