当前位置: 首页>>代码示例>>Java>>正文


Java ServerCommandManager类代码示例

本文整理汇总了Java中net.minecraft.command.ServerCommandManager的典型用法代码示例。如果您正苦于以下问题:Java ServerCommandManager类的具体用法?Java ServerCommandManager怎么用?Java ServerCommandManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServerCommandManager类属于net.minecraft.command包,在下文中一共展示了ServerCommandManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: serverStart

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@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());
}
 
开发者ID:The-Fireplace-Minecraft-Mods,项目名称:Overlord,代码行数:17,代码来源:Overlord.java

示例2: serverStart

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@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();
}
 
开发者ID:UnderMybrella,项目名称:TiM,代码行数:27,代码来源:TModifiers.java

示例3: registerServerCommands

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
/**
 * 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);
		}
	}
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:30,代码来源:CommonProxy.java

示例4: onServerStarting

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@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();
    }
}
 
开发者ID:joshiejack,项目名称:Progression,代码行数:23,代码来源:Progression.java

示例5: MinecraftServer

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
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");
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:17,代码来源:MinecraftServer.java

示例6: MinecraftServer

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
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();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:17,代码来源:MinecraftServer.java

示例7: onServerStarting

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@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());
}
 
开发者ID:Mithion,项目名称:GriefGuardian,代码行数:21,代码来源:GriefGuardian.java

示例8: serverStarting

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:remcohaszing,项目名称:minecraft-hue,代码行数:15,代码来源:HueMod.java

示例9: serverStarting

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
	ICommandManager commandManager = MinecraftServer.getServer().getCommandManager();
	ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager);
	addCommands(serverCommandManager);
}
 
开发者ID:rodolphito,项目名称:Rival-Rebels-Mod,代码行数:8,代码来源:RivalRebels.java

示例10: addCommands

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
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());
}
 
开发者ID:rodolphito,项目名称:Rival-Rebels-Mod,代码行数:16,代码来源:RivalRebels.java

示例11: serverStart

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@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());
}
 
开发者ID:jtrent238,项目名称:Hammer-Mod,代码行数:14,代码来源:HammerMod.java

示例12: serverStart

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent e)
{
    MinecraftServer server = getServer();
    ICommandManager iCommandManager = server.getCommandManager();
    ServerCommandManager serverCommandManager = (ServerCommandManager)iCommandManager;

    serverCommandManager.registerCommand(new CommandHandler());
}
 
开发者ID:mads256c,项目名称:BetterChat,代码行数:10,代码来源:BetterChat.java

示例13: serverStart

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@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());
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:14,代码来源:EpicProportionsMod.java

示例14: registerCommands

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
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());
}
 
开发者ID:kamildanak,项目名称:EnderPay,代码行数:9,代码来源:EnderPay.java

示例15: serverStarting

import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@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);
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:14,代码来源:TaleCraft.java


注:本文中的net.minecraft.command.ServerCommandManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。