@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()); }
@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 + ""); } }
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; } }
@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; }
@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(); } }
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; }
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; } }
/** * 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; } } }
@Mod.EventHandler public void beforeServerStart(FMLServerAboutToStartEvent event) { ICommandManager manager = event.getServer().getCommandManager(); if (manager instanceof CommandHandler) { ((CommandHandler) manager).registerCommand(new DebugDamageCommand()); } }
@EventHandler public void serverStarting(FMLServerStartingEvent event) { ICommandManager commandManager = MinecraftServer.getServer().getCommandManager(); ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager); addCommands(serverCommandManager); }
@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); } } }
@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()); }
@Mod.EventHandler public void serverStart(FMLServerStartingEvent e) { MinecraftServer server = getServer(); ICommandManager iCommandManager = server.getCommandManager(); ServerCommandManager serverCommandManager = (ServerCommandManager)iCommandManager; serverCommandManager.registerCommand(new CommandHandler()); }
@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()); }
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()); }
@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); }
@EventHandler public void onServerStart(FMLServerStartingEvent evt) { MinecraftServer server = MinecraftServer.getServer(); ICommandManager command = server.getCommandManager(); ServerCommandManager manager = (ServerCommandManager) command; manager.registerCommand(new VintageCraftCommands()); }
@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()); }
public void execute(MinecraftServer minecraftserver) { ICommandManager icommandmanager = minecraftserver.getCommandManager(); int value = icommandmanager.executeCommand(minecraftserver, "/schematicaGenerate " + schematic + " " + Integer.toString(x) + " " + Integer.toString(y) + " "+ Integer.toString(z)); if (value < 1) { FMLLog.getLogger().error("Schematica failed to generate the cheat area- code "+value); return; } }
@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()); }
/** * Send variable number of JSON Objects to a player. * Note: It is recommended to use SendJsonFormatted() if you want to format a text * This function will just glue all elements together! * * @param pPlayer * @param pChatObjects */ public static void SendJsonRaw( EntityPlayer pPlayer, JSONChatText... pChatObjects ) { MinecraftServer tMCServer = MinecraftServer.getServer(); ICommandManager tCmdMngr = tMCServer.getCommandManager(); if( tMCServer != null ) { String tConstructedJSON = ""; if( pChatObjects.length > 1 ) { boolean tFirst = true; tConstructedJSON = "["; for( JSONChatText pChatObject : pChatObjects ) { if( tFirst ) tFirst = false; else tConstructedJSON += ", "; tConstructedJSON += pChatObject.getConstructed(); } tConstructedJSON += "]"; } else tConstructedJSON = pChatObjects[0].getConstructed(); tCmdMngr.executeCommand( tMCServer, "tellraw " + pPlayer.getCommandSenderName() + " " + tConstructedJSON ); } }
/** * @author jamierocks - 3rd September 2016 * @reason Support Canary commands */ @Overwrite public void trigger(net.minecraft.world.World worldIn) { if (worldIn.isRemote) { this.successCount = 0; } MinecraftServer minecraftserver = MinecraftServer.getServer(); if (minecraftserver != null && minecraftserver.isAnvilFileSet() && minecraftserver.isCommandBlockEnabled()) { ICommandManager icommandmanager = minecraftserver.getCommandManager(); try { this.lastOutput = null; // Neptune - Canary commands this.successCount = this.handleCommandExecution(icommandmanager, (CommandBlockLogic) (Object) this, this.commandStored); // Neptune - end } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Executing command block"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Command to be executed"); crashreportcategory.addCrashSectionCallable("Command", this::getCommand); crashreportcategory.addCrashSectionCallable("Name", this::getName); throw new ReportedException(crashreport); } } else { this.successCount = 0; } }
@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); }
@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()); }
@EventHandler public void onServerStart(FMLServerStartingEvent evt) { MinecraftServer server = MinecraftServer.getServer(); ICommandManager command = server.getCommandManager(); ServerCommandManager manager = (ServerCommandManager) command; manager.registerCommand(new ServerCommandsVC()); }
/** * 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); }
public int func_82351_a(World p_82351_1_) { if(p_82351_1_.field_72995_K) { return 0; } else { MinecraftServer var2 = MinecraftServer.func_71276_C(); if(var2 != null && var2.func_82356_Z()) { ICommandManager var3 = var2.func_71187_D(); return var3.func_71556_a(this, this.field_82354_a); } else { return 0; } } }
public void initCommands(MinecraftServer server) { ICommandManager manager = server.getCommandManager(); if(manager instanceof CommandHandler) { CommandHandler handler = (CommandHandler)manager; handler.registerCommand(new CommandHats()); } }
public void initCommands(MinecraftServer server) { ICommandManager manager = server.getCommandManager(); if(manager instanceof CommandHandler) { CommandHandler handler = (CommandHandler)manager; handler.registerCommand(new CommandMorph()); } }
@EventHandler public void serverStart(FMLServerStartingEvent event){ MinecraftServer server = event.getServer(); ICommandManager command = server.getCommandManager(); ServerCommandManager serverCommand = ((ServerCommandManager) command); serverCommand.registerCommand(new CommandRoguelike()); }
public ICommandManager getCommandManager() { return this.commandManager; }
public void trigger(World worldIn) { if (worldIn.isRemote) { this.successCount = 0; } MinecraftServer minecraftserver = MinecraftServer.getServer(); if (minecraftserver != null && minecraftserver.isAnvilFileSet() && minecraftserver.isCommandBlockEnabled()) { ICommandManager icommandmanager = minecraftserver.getCommandManager(); try { this.lastOutput = null; this.successCount = icommandmanager.executeCommand(this, this.commandStored); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Executing command block"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Command to be executed"); crashreportcategory.addCrashSectionCallable("Command", new Callable<String>() { public String call() throws Exception { return CommandBlockLogic.this.getCommand(); } }); crashreportcategory.addCrashSectionCallable("Name", new Callable<String>() { public String call() throws Exception { return CommandBlockLogic.this.getName(); } }); throw new ReportedException(crashreport); } } else { this.successCount = 0; } }