net.minecraft.command.ServerCommandManager Java Examples

The following examples show how to use net.minecraft.command.ServerCommandManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VSModCommandRegistry.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
public static void registerCommands(MinecraftServer server) {
    ServerCommandManager manager = (ServerCommandManager) server.getCommandManager();
    manager.registerCommand(
        new VSConfigCommandBase("vsconfig", VSConfig.class, "vsc"));
    manager.registerCommand(new VSCommandBase<>(MainCommand.class));
    manager.registerCommand(new PhysSettingsCommand());
    manager.registerCommand(new AirshipMapCommand());
}
 
Example #2
Source File: GokiStats.java    From GokiStats with MIT License 5 votes vote down vote up
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent event) {
    MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
    ICommandManager command = server.getCommandManager();
    ServerCommandManager serverCommand = (ServerCommandManager) command;
    serverCommand.registerCommand(new StatsCommand());
    // TODO notice it's a reversion
}
 
Example #3
Source File: LookingGlass.java    From LookingGlass with GNU General Public License v3.0 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 #4
Source File: NBTEdit.java    From NBTEdit with GNU General Public License v3.0 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 #5
Source File: Roguelike.java    From minecraft-roguelike with GNU General Public License v3.0 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 #6
Source File: Signals.java    From Signals with GNU General Public License v3.0 4 votes vote down vote up
@EventHandler
public void onServerStart(FMLServerStartingEvent event){
    ServerCommandManager comManager = (ServerCommandManager)event.getServer().getCommandManager();
    comManager.registerCommand(new CommandSignals());
}
 
Example #7
Source File: FaweForge.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
public void insertCommands() {
    for (Map.Entry<String, FaweCommand> entry : commands.entrySet()) {
        ServerCommandManager scm = (ServerCommandManager) FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager();
        scm.registerCommand(new ForgeCommand(entry.getKey(), entry.getValue()));
    }
}
 
Example #8
Source File: FaweForge.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
public void insertCommands() {
    for (Map.Entry<String, FaweCommand> entry : commands.entrySet()) {
        ServerCommandManager scm = (ServerCommandManager) FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager();
        scm.registerCommand(new ForgeCommand(entry.getKey(), entry.getValue()));
    }
}
 
Example #9
Source File: FaweForge.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
public void insertCommands() {
    for (Map.Entry<String, FaweCommand> entry : commands.entrySet()) {
        ServerCommandManager scm = (ServerCommandManager) FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager();
        scm.registerCommand(new ForgeCommand(entry.getKey(), entry.getValue()));
    }
}
 
Example #10
Source File: PneumaticCraft.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@EventHandler
public void onServerStart(FMLServerStartingEvent event){
    ServerCommandManager comManager = (ServerCommandManager)MinecraftServer.getServer().getCommandManager();
    new PCCommandManager().init(comManager);
}
 
Example #11
Source File: PCCommandManager.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
public void init(ServerCommandManager commandManager){
    commandManager.registerCommand(new CommandAmazonDelivery());
    commandManager.registerCommand(new CommandGetGlobalVariable());
    commandManager.registerCommand(new CommandSetGlobalVariable());
}