示例#1
0
        //todo: load chunk observers async version

        protected override void Process()
        {
            if (!BCUtils.CheckWorld(out var world))
            {
                return;
            }

            var command = new BCMCmdArea(Params, Options, "Export");

            if (!BCUtils.ProcessParams(command, 14))
            {
                SendOutput(GetHelp());

                return;
            }

            if (!BCUtils.GetIds(world, command, out var entity))
            {
                SendOutput("Command requires a position when not run by a player.");

                return;
            }

            if (!command.HasChunkPos && !command.HasPos && !BCUtils.GetEntPos(command, entity))
            {
                SendOutput("Unable to get position.");

                return;
            }

            BCUtils.DoProcess(world, command, this);
        }
示例#2
0
        public override void Process()
        {
            var world = GameManager.Instance.World;

            if (world == null)
            {
                SendOutput("World not initialized.");

                return;
            }

            var command = new BCMCmdArea(Params, Options, "Export");

            if (!BCUtils.ProcessParams(command, 14))
            {
                SendOutput(GetHelp());

                return;
            }

            if (!BCUtils.GetIds(world, command, out var entity))
            {
                SendOutput("Command requires a position when not run by a player.");

                return;
            }

            if (!command.HasChunkPos && !command.HasPos && !BCUtils.GetEntPos(command, entity))
            {
                SendOutput("Unable to get position.");

                return;
            }

            BCUtils.DoProcess(world, command, this);
        }