當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。