Exemplo n.º 1
0
        public string PlotDelete(Player player, bool force = false)
        {
            PlotCoordinates coords = (PlotCoordinates)player.KnownPosition;

            if (!force && !_plotManager.HasClaim(coords, player))
            {
                return("Not able to reset plot at this position.");
            }
            if (!_plotManager.TryGetPlot(coords, out Plot plot) && !force)
            {
                return("Not able to delete plot at this position.");
            }
            if (plot != null && !_plotManager.Delete(plot))
            {
                return("Not able to delete plot at this position.");
            }

            PlotWorldGenerator.ResetBlocks(player.Level, PlotManager.GetBoundingBoxForPlot(coords), true);

            return($"Deleted plot {coords.X},{coords.Z}.");
        }
Exemplo n.º 2
0
        public string PlotClear(Player player)
        {
            PlotCoordinates coords = (PlotCoordinates)player.KnownPosition;

            if (coords == null)
            {
                return("Not able to reset plot at this position.");
            }

            if (!_plotManager.HasClaim(coords, player))
            {
                return("Not able to reset plot at this position.");
            }
            if (!_plotManager.TryGetPlot(coords, out Plot plot))
            {
                return("Not able to reset plot at this position.");
            }

            PlotWorldGenerator.ResetBlocks(player.Level, PlotManager.GetBoundingBoxForPlot(plot.Coordinates));

            return($"Reset plot {plot.Coordinates.X},{plot.Coordinates.Z}.");
        }