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


Java ICommandManager类代码示例

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


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

示例1: serverStart

import net.minecraft.command.ICommandManager; //导入依赖的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: doAction

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
@Override
public void doAction(World world, IStructure structure, Point3i worldPos) {
  if(commands.isEmpty()) {
    return;
  }
  MinecraftServer minecraftserver = MinecraftServer.getServer();
  if(minecraftserver != null) {           
    Point3i wp = getWorldPosition(structure, worldPos);            
    InnerSender sender = new InnerSender(world, structure, wp);      
    ICommandManager icommandmanager = minecraftserver.getCommandManager();
    
    boolean origValue = minecraftserver.worldServers[0].getGameRules().getGameRuleBooleanValue("commandBlockOutput");      
    minecraftserver.worldServers[0].getGameRules().setOrCreateGameRule("commandBlockOutput", "false");
    
    for(String cmd : commands) {
      icommandmanager.executeCommand(sender, cmd);
    }     
    
    minecraftserver.worldServers[0].getGameRules().setOrCreateGameRule("commandBlockOutput", origValue + "");
  }
}
 
开发者ID:SleepyTrousers,项目名称:Structures,代码行数:22,代码来源:ExecuteCommandAction.java

示例3: func_145755_a

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
public void func_145755_a(World p_145755_1_)
{
    if (p_145755_1_.isClient)
    {
        this.field_145764_b = 0;
    }

    MinecraftServer var2 = MinecraftServer.getServer();

    if (var2 != null && var2.isCommandBlockEnabled())
    {
        ICommandManager var3 = var2.getCommandManager();
        this.field_145764_b = var3.executeCommand(this, this.field_145763_e);
    }
    else
    {
        this.field_145764_b = 0;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:20,代码来源:CommandBlockLogic.java

示例4: runCommand

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
@SuppressWarnings("unused")
public int runCommand(String... args) {
    if (FMLCommonHandler.instance().getMinecraftServerInstance() != null &&
            FMLCommonHandler.instance().getMinecraftServerInstance().isCallingFromMinecraftThread()) {
        if (reduxEngine.globalObjectExists("entity") && reduxEngine.getJavaObject("entity", Entity.class) instanceof Entity) {
            lastEntity = (Entity) reduxEngine.getJavaObject("entity", Entity.class);
        } else {
            lastEntity = null;
        }
        if (reduxEngine.globalObjectExists("world") && reduxEngine.getJavaObject("world", World.class) instanceof World) {
            lastWorld = (World) reduxEngine.getJavaObject("world", World.class);
        } else {
            lastWorld = null;
        }
        if (reduxEngine.globalObjectExists("pos") && reduxEngine.getJavaObject("pos", BlockPos.class) instanceof BlockPos) {
            lastBlockPos = (BlockPos) reduxEngine.getJavaObject("pos", BlockPos.class);
        } else {
            lastBlockPos = null;
        }
        ICommandManager manager = FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager();
        manager.executeCommand(this, StringUtils.join(args));
    }
    return 0;
}
 
开发者ID:Quiddity-Modding,项目名称:Redux,代码行数:25,代码来源:ReduxAPI.java

示例5: onServerStarting

import net.minecraft.command.ICommandManager; //导入依赖的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

示例6: handleCommandExecution

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
private int handleCommandExecution(ICommandManager commandManager, CommandBlockLogic commandBlockLogic, String commandStored) {
    final String[] args = commandStored.split(" ");
    String commandName = args[0];
    if (commandName.startsWith("/")) {
        commandName = commandName.substring(1);
    }

    CommandBlockCommandHook commandHook = (CommandBlockCommandHook) new CommandBlockCommandHook(
            (net.canarymod.api.CommandBlockLogic) commandBlockLogic, args).call();

    if (!commandHook.isCanceled()
            && (Configuration.getServerConfig().isCommandBlockOpped()
            || ((net.canarymod.api.CommandBlockLogic) commandBlockLogic).hasPermission("canary.command." + commandName))) {
        int result = commandManager.executeCommand(commandBlockLogic, commandStored);
        if (result == 0) {
            // Minecraft found no command, now its our turn
            Canary.getServer().consoleCommand(commandStored, (net.canarymod.api.CommandBlockLogic) commandBlockLogic);
        }
        return result;
    }

    return 0;
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:24,代码来源:MixinCommandBlockLogic.java

示例7: func_145755_a

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
public void func_145755_a(World p_145755_1_)
{
    if (p_145755_1_.isRemote)
    {
        this.field_145764_b = 0;
    }

    MinecraftServer minecraftserver = MinecraftServer.getServer();

    if (minecraftserver != null && minecraftserver.isCommandBlockEnabled())
    {
        ICommandManager icommandmanager = minecraftserver.getCommandManager();
        this.field_145764_b = icommandmanager.executeCommand(this, this.field_145763_e);
    }
    else
    {
        this.field_145764_b = 0;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:20,代码来源:CommandBlockLogic.java

示例8: executeCommandOnPowered

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
/**
 * Execute the command, called when the command block is powered.
 */
public int executeCommandOnPowered(World par1World)
{
    if (par1World.isRemote)
    {
        return 0;
    }
    else
    {
        MinecraftServer minecraftserver = MinecraftServer.getServer();

        if (minecraftserver != null && minecraftserver.isCommandBlockEnabled())
        {
            ICommandManager icommandmanager = minecraftserver.getCommandManager();
            return icommandmanager.executeCommand(this, this.command);
        }
        else
        {
            return 0;
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:TileEntityCommandBlock.java

示例9: beforeServerStart

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
@Mod.EventHandler
public void beforeServerStart(FMLServerAboutToStartEvent event) {
    ICommandManager manager = event.getServer().getCommandManager();
    if (manager instanceof CommandHandler) {
        ((CommandHandler) manager).registerCommand(new DebugDamageCommand());
    }
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:8,代码来源:FirstAid.java

示例10: serverStarting

import net.minecraft.command.ICommandManager; //导入依赖的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

示例11: apply

import net.minecraft.command.ICommandManager; //导入依赖的package包/类
@Override
public void apply(EntityActor actor)
{
    if (!this.command.isEmpty())
    {
        MinecraftServer server = actor.worldObj.getMinecraftServer();

        if (server != null)
        {
            ICommandManager manager = server.commandManager;

            manager.executeCommand(new CommandSender(actor), this.command);
        }
    }
}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:16,代码来源:CommandAction.java

示例12: serverStart

import net.minecraft.command.ICommandManager; //导入依赖的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

示例13: serverStart

import net.minecraft.command.ICommandManager; //导入依赖的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

示例14: serverStart

import net.minecraft.command.ICommandManager; //导入依赖的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

示例15: registerCommands

import net.minecraft.command.ICommandManager; //导入依赖的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


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