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)); }
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}"); }
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}")); }