Exemplo n.º 1
0
        internal static bool DoResize(Player p, string[] args, CommandData data, out bool needConfirm)
        {
            needConfirm = false;
            Level lvl = Matcher.FindLevels(p, args[0]);

            if (lvl == null)
            {
                return(true);
            }
            if (!LevelInfo.Check(p, data.Rank, lvl, "resize this level"))
            {
                return(false);
            }

            ushort x = 0, y = 0, z = 0;

            if (!MapGen.GetDimensions(p, args, 1, ref x, ref y, ref z))
            {
                return(false);
            }

            bool confirmed = args.Length > 4 && args[4].CaselessEq("confirm");

            if (!confirmed && (x < lvl.Width || y < lvl.Height || z < lvl.Length))
            {
                p.Message("New level dimensions are smaller than the current dimensions, &Wyou will lose blocks&S.");
                needConfirm = true;
                return(false);
            }

            LevelActions.Resize(ref lvl, x, y, z);
            return(true);
        }