Exemplo n.º 1
0
        public static PlotCoordinates ConvertToPlotCoordinates(BlockCoordinates coords)
        {
            if (PlotWorldGenerator.IsXRoad(coords.X, true) || PlotWorldGenerator.IsZRoad(coords.Z, true))
            {
                return(null);
            }

            int plotX = coords.X / PlotWorldGenerator.PlotAreaWidth + (Math.Sign(coords.X));
            int plotZ = coords.Z / PlotWorldGenerator.PlotAreaDepth + (Math.Sign(coords.Z));

            return(new PlotCoordinates(plotX, plotZ));
        }
Exemplo n.º 2
0
        public string PlotAuto(Player player)
        {
            BlockCoordinates coords = (BlockCoordinates)player.KnownPosition;

            if (PlotWorldGenerator.IsXRoad(coords.X, true) || PlotWorldGenerator.IsZRoad(coords.Z, true))
            {
                return("Not able to claim plot at this position.");
            }

            int plotX = coords.X / PlotWorldGenerator.PlotAreaWidth + Math.Sign(coords.X);
            int plotZ = coords.Z / PlotWorldGenerator.PlotAreaDepth + Math.Sign(coords.Z);

            return($"Claimed plot {plotX}:{plotZ} at {coords}");
        }
Exemplo n.º 3
0
        public VanillaCommands.SimpleResponse PlotAuto(Player player)
        {
            BlockCoordinates coords = (BlockCoordinates)player.KnownPosition;

            if (PlotWorldGenerator.IsXRoad(coords.X, true) || PlotWorldGenerator.IsZRoad(coords.Z, true))
            {
                return new VanillaCommands.SimpleResponse()
                       {
                           Body = "Not able to claim plot at this position."
                       }
            }
            ;

            int plotX = coords.X / PlotWorldGenerator.PlotAreaWidth + Math.Sign(coords.X);
            int plotZ = coords.Z / PlotWorldGenerator.PlotAreaDepth + Math.Sign(coords.Z);

            return(new VanillaCommands.SimpleResponse($"Claimed plot {plotX}:{plotZ} at {coords}"));
        }