public override void Execute(CommandReader reader)
        {
            string name = reader.Next();

            if (String.IsNullOrEmpty(name))
            {
                game.Chat.Add("&e/client model: &cYou didn't specify a model name.");
            }
            else
            {
                game.LocalPlayer.SetModel(Utils.ToLower(name));
            }
        }
예제 #2
0
        public override void Execute(CommandReader reader)
        {
            string property = reader.Next();

            if (property == null)
            {
                game.Chat.Add("&e/client: &cYou didn't specify a new render type.");
            }
            else if (game.SetRenderType(property))
            {
                game.Chat.Add("&e/client: &fRender type is now " + property + ".");
            }
            else
            {
                game.Chat.Add("&e/client: &cUnrecognised render type &f\"" + property + "\"&c.");
            }
        }
        public void Execute(string text)
        {
            CommandReader reader = new CommandReader(text);

            if (reader.TotalArgs == 0)
            {
                game.Chat.Add("&eList of client commands:");
                PrintDefinedCommands(game);
                game.Chat.Add("&eTo see a particular command's help, type /client help [cmd name]");
                return;
            }
            string  commandName = reader.Next();
            Command cmd         = GetMatchingCommand(commandName);

            if (cmd != null)
            {
                cmd.Execute(reader);
            }
        }
        public override void Execute(CommandReader reader)
        {
            game.UserEvents.BlockChanged -= BlockChanged;
            block   = 0xFF;
            mark1   = new Vector3I(int.MaxValue);
            mark2   = new Vector3I(int.MaxValue);
            persist = false;

            if (!ParseBlock(reader))
            {
                return;
            }
            string arg = reader.Next();

            if (arg != null && Utils.CaselessEquals(arg, "yes"))
            {
                persist = true;
            }

            game.Chat.Add("&eCuboid: &fPlace or delete a block.", MessageType.ClientStatus3);
            game.UserEvents.BlockChanged += BlockChanged;
        }
예제 #5
0
        public override void Execute(CommandReader reader)
        {
            string property = reader.Next();

            if (property == null)
            {
                game.Chat.Add("&e/client info: &cYou didn't specify a property.");
            }
            else if (Utils.CaselessEquals(property, "pos"))
            {
                game.Chat.Add("Feet: " + game.LocalPlayer.Position);
                game.Chat.Add("Eye: " + game.LocalPlayer.EyePosition);
                Vector3I p = Vector3I.Floor(game.LocalPlayer.Position);
                game.Chat.Add(game.World.GetLightHeight(p.X, p.Z).ToString());
            }
            else if (Utils.CaselessEquals(property, "target"))
            {
                PickedPos pos = game.SelectedPos;
                if (!pos.Valid)
                {
                    game.Chat.Add("Currently not targeting a block");
                }
                else
                {
                    game.Chat.Add("Currently targeting at: " + pos.BlockPos);
                    game.Chat.Add("ID of block targeted: " + game.World.SafeGetBlock(pos.BlockPos));
                }
            }
            else if (Utils.CaselessEquals(property, "dimensions"))
            {
                game.Chat.Add("map width: " + game.World.Width);
                game.Chat.Add("map height: " + game.World.Height);
                game.Chat.Add("map length: " + game.World.Length);
            }
            else
            {
                game.Chat.Add("&e/client info: Unrecognised property: \"&f" + property + "&e\".");
            }
        }
예제 #6
0
        public override void Execute(CommandReader reader)
        {
            string cmdName = reader.Next();

            if (cmdName == null)
            {
                game.Chat.Add("&eList of client commands:");
                game.CommandManager.PrintDefinedCommands(game);
                game.Chat.Add("&eTo see a particular command's help, type /client help [cmd name]");
            }
            else
            {
                Command cmd = game.CommandManager.GetMatchingCommand(cmdName);
                if (cmd != null)
                {
                    string[] help = cmd.Help;
                    for (int i = 0; i < help.Length; i++)
                    {
                        game.Chat.Add(help[i]);
                    }
                }
            }
        }
예제 #7
0
 public override void Execute(CommandReader reader)
 {
     game.CommandManager.PrintDefinedCommands(game);
 }
예제 #8
0
 public abstract void Execute(CommandReader reader);