Notes="Clears the object, resets it to zero size",
},
constructor=
{
Returns=
{
{
Type="cBlockArea",
},
},
Notes="Creates a new empty cBlockArea object",
},
CopyFrom=
{
Params=
{
{
Name="BlockAreaSrc",
Type="cBlockArea",
},
},
Notes="Copies contents from BlockAreaSrc into self",
},
CopyTo=
{
Params=
{
{
Name="BlockAreaDst",
Type="cBlockArea",
},
},
Notes="Copies contents from self into BlockAreaDst.",
},
CountNonAirBlocks=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the count of blocks that are not air. Returns 0 if blocktypes not available. Block metas are ignored (if present, air with any meta is still considered air).",
},
CountSpecificBlocks=
{
{
Params=
{
{
Name="BlockType",
Type="number",
},
},
Returns=
{
{
Type="number",
},
},
Notes="Counts the number of occurences of the specified blocktype contained in the area.",
},
{
Params=
{
{
Name="BlockType",
Type="number",
},
{
Name="BlockMeta",
Type="number",
},
},
Returns=
{
{
Type="number",
},
},
Notes="Counts the number of occurrences of the specified blocktype + blockmeta combination contained in the area.",
},
},
Create=
{
{
Params=
{
{
Name="SizeX",
Type="number",
},
{
Name="SizeY",
Type="number",
},
{
Name="SizeZ",
Type="number",
},
},
Notes="Initializes this BlockArea to an empty area of the specified size and origin of {0, 0, 0}. Datatypes are set to baTypes + baMetas. Any previous contents are lost.",
Notes="Initializes this BlockArea to an empty area of the specified size and origin of {0, 0, 0}. Any previous contents are lost.",
},
{
Params=
{
{
Name="Size",
Type="Vector3i",
},
},
Notes="Creates a new area of the specified size. Datatypes are set to baTypes + baMetas. Origin is set to all zeroes. BlockTypes are set to air, block metas to zero, blocklights to zero and skylights to full light.",
Notes="Creates a new area of the specified size and contents. Origin is set to all zeroes. BlockTypes are set to air, block metas to zero, blocklights to zero and skylights to full light.",
},
},
Crop=
{
Params=
{
{
Name="AddMinX",
Type="number",
},
{
Name="SubMaxX",
Type="number",
},
{
Name="AddMinY",
Type="number",
},
{
Name="SubMaxY",
Type="number",
},
{
Name="AddMinZ",
Type="number",
},
{
Name="SubMaxZ",
Type="number",
},
},
Notes="Crops the specified number of blocks from each border. Modifies the size of this blockarea object.",
},-- Crop
DoWithBlockEntityAt=
{
{
Params=
{
{
Name="BlockX",
Type="number",
},
{
Name="BlockY",
Type="number",
},
{
Name="BlockZ",
Type="number",
},
{
Name="Callback",
Type="function",
},
},
Returns=
{
Name="HasCalled",
Type="boolean",
},
Notes="Calls the specified callback with the block entity at the specified absolute coords. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> Returns false if there's no block entity at the specified coords. Returns the value that the callback has returned otherwise.",
},
{
Params=
{
{
Name="Coords",
Type="Vector3i",
},
{
Name="Callback",
Type="function",
},
},
Returns=
{
Name="HasCalled",
Type="boolean",
},
Notes="Calls the specified callback with the block entity at the specified absolute coords. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> Returns false if there's no block entity at the specified coords. Returns the value that the callback has returned otherwise.",
},
},-- DoWithBlockEntityAt
DoWithBlockEntityRelAt=
{
{
Params=
{
{
Name="RelX",
Type="number",
},
{
Name="RelY",
Type="number",
},
{
Name="RelZ",
Type="number",
},
{
Name="Callback",
Type="function",
},
},
Returns=
{
Name="HasCalled",
Type="boolean",
},
Notes="Calls the specified callback with the block entity at the specified relative coords. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> Returns false if there's no block entity at the specified coords. Returns the value that the callback has returned otherwise.",
},
{
Params=
{
{
Name="RelCoords",
Type="Vector3i",
},
{
Name="Callback",
Type="function",
},
},
Returns=
{
Name="HasCalled",
Type="boolean",
},
Notes="Calls the specified callback with the block entity at the specified relative coords. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> Returns false if there's no block entity at the specified coords. Returns the value that the callback has returned otherwise.",
},
},-- DoWithBlockEntityRelAt
DumpToRawFile=
{
Params=
{
{
Name="FileName",
Type="string",
},
},
Notes="Dumps the raw data into a file. For debugging purposes only.",
},
Expand=
{
Params=
{
{
Name="SubMinX",
Type="number",
},
{
Name="AddMaxX",
Type="number",
},
{
Name="SubMinY",
Type="number",
},
{
Name="AddMaxY",
Type="number",
},
{
Name="SubMinZ",
Type="number",
},
{
Name="AddMaxZ",
Type="number",
},
},
Notes="Expands the specified number of blocks from each border. Modifies the size of this blockarea object. New blocks created with this operation are filled with zeroes.",
Notes="Fills the specified cuboid with the same values (like Fill() ).",
},
},
ForEachBlockEntity=
{
Params=
{
{
Name="Coords",
Type="Vector3i",
},
{
Name="Callback",
Type="function",
},
},
Returns=
{
Name="HasProcessedAll",
Type="boolean",
},
Notes="Calls the specified callback with the block entity for each block entity contained in the object. Returns true if all block entities have been processed (including when there are zero block entities), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> The callback should return false or no value to continue with the next block entity, or true to abort the enumeration.",
},-- ForEachBlockEntity
GetBlockLight=
{
Params=
{
{
Name="BlockX",
Type="number",
},
{
Name="BlockY",
Type="number",
},
{
Name="BlockZ",
Type="number",
},
},
Returns=
{
{
Name="BlockLight",
Type="number",
},
},
Notes="Returns the blocklight (emissive light) at the specified absolute coords",
},
GetBlockMeta=
{
Params=
{
{
Name="BlockX",
Type="number",
},
{
Name="BlockY",
Type="number",
},
{
Name="BlockZ",
Type="number",
},
},
Returns=
{
{
Name="BlockMeta",
Type="number",
},
},
Notes="Returns the block meta at the specified absolute coords",
},
GetBlockSkyLight=
{
Params=
{
{
Name="BlockX",
Type="number",
},
{
Name="BlockY",
Type="number",
},
{
Name="BlockZ",
Type="number",
},
},
Returns=
{
{
Name="BlockSkyLight",
Type="number",
},
},
Notes="Returns the skylight at the specified absolute coords",
},
GetBlockType=
{
Params=
{
{
Name="BlockX",
Type="number",
},
{
Name="BlockY",
Type="number",
},
{
Name="BlockZ",
Type="number",
},
},
Returns=
{
{
Name="BLOCKTYPE",
Type="number",
},
},
Notes="Returns the block type at the specified absolute coords",
Notes="Returns the {{cCuboid|cuboid}} that specifies the original coords of the world from which the area was read. Basically constructs a {{cCuboid}} out of GetOrigin() and GetOrigin() + GetCoordRange().",
Notes="Returns the maximum relative coords in all 3 axes. See also GetSize().",
},
GetDataTypes=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the mask of datatypes (ba* constants added together) that the object is currently holding.",
},
GetNonAirCropRelCoords=
{
Params=
{
{
Name="IgnoredBlockType",
Type="number",
IsOptional=true,
},
},
Returns=
{
{
Name="MinRelX",
Type="number",
},
{
Name="MinRelY",
Type="number",
},
{
Name="MinRelZ",
Type="number",
},
{
Name="MaxRelX",
Type="number",
},
{
Name="MaxRelY",
Type="number",
},
{
Name="MaxRelZ",
Type="number",
},
},
Notes="Returns the minimum and maximum coords in each direction for the first block in each direction of type different to IgnoredBlockType (E_BLOCK_AIR by default). If there are no non-ignored blocks within the area, or blocktypes are not present, the returned values are reverse-ranges (MinX <- m_RangeX, MaxX <- 0 etc.). IgnoreBlockType defaults to air.",
},
GetOrigin=
{
Returns=
{
{
Name="OriginX",
Type="number",
},
{
Name="OriginY",
Type="number",
},
{
Name="OriginZ",
Type="number",
},
},
Notes="Returns the origin coords of where the area was read from.",
},
GetOriginX=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the origin x-coord",
},
GetOriginY=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the origin y-coord",
},
GetOriginZ=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the origin z-coord",
},
GetRelBlockLight=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
},
Returns=
{
{
Name="NIBBLETYPE",
Type="number",
},
},
Notes="Returns the blocklight at the specified relative coords",
},
GetRelBlockMeta=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
},
Returns=
{
{
Name="NIBBLETYPE",
Type="number",
},
},
Notes="Returns the block meta at the specified relative coords",
},
GetRelBlockSkyLight=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
},
Returns=
{
{
Name="NIBBLETYPE",
Type="number",
},
},
Notes="Returns the skylight at the specified relative coords",
},
GetRelBlockType=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
},
Returns=
{
{
Name="BLOCKTYPE",
Type="number",
},
},
Notes="Returns the block type at the specified relative coords",
},
GetRelBlockTypeMeta=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
},
Returns=
{
{
Name="BLOCKTYPE",
Type="number",
},
{
Name="NIBBLETYPE",
Type="number",
},
},
Notes="Returns the block type and meta at the specified relative coords",
},
GetSize=
{
Returns=
{
{
Name="SizeX",
Type="number",
},
{
Name="SizeY",
Type="number",
},
{
Name="SizeZ",
Type="number",
},
},
Notes="Returns the size of the area in all 3 axes. See also GetCoordRange().",
},
GetSizeX=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the size of the held data in the x-axis",
},
GetSizeY=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the size of the held data in the y-axis",
},
GetSizeZ=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the size of the held data in the z-axis",
},
GetVolume=
{
Returns=
{
{
Type="number",
},
},
Notes="Returns the volume of the area - the total number of blocks stored within.",
},
GetWEOffset=
{
Returns=
{
{
Type="Vector3i",
},
},
Notes="Returns the WE offset, a data value sometimes stored in the schematic files. Cuberite doesn't use this value, but provides access to it using this method. The default is {0, 0, 0}.",
},
HasBlockEntities=
{
Returns=
{
{
Type="boolean",
},
},
Notes="Returns true if current datatypes include block entities.",
},
HasBlockLights=
{
Returns=
{
{
Type="boolean",
},
},
Notes="Returns true if current datatypes include blocklight",
},
HasBlockMetas=
{
Returns=
{
{
Type="boolean",
},
},
Notes="Returns true if current datatypes include block metas",
},
HasBlockSkyLights=
{
Returns=
{
{
Type="boolean",
},
},
Notes="Returns true if current datatypes include skylight",
},
HasBlockTypes=
{
Returns=
{
{
Type="boolean",
},
},
Notes="Returns true if current datatypes include block types",
Notes="Returns true if the specified combination of datatypes (ba* constants added together) is valid. Most combinations are valid, but for example baBlockEntities without baTypes is an invalid combination.",
Notes="Returns true if the specified relative coords are within the area.",
},
},-- IsValidRelCoords
LoadFromSchematicFile=
{
Params=
{
{
Name="FileName",
Type="string",
},
},
Returns=
{
{Type="boolean"},
},
Notes="Clears current content and loads new content from the specified schematic file. Returns true if successful. Returns false and logs error if unsuccessful, old content is preserved in such a case.",
},
LoadFromSchematicString=
{
Params=
{
{
Name="SchematicData",
Type="string",
},
},
Returns=
{
{Type="boolean"},
},
Notes="Clears current content and loads new content from the specified string (assumed to contain .schematic data). Returns true if successful. Returns false and logs error if unsuccessful, old content is preserved in such a case.",
},
Merge=
{
{
Params=
{
{
Name="BlockAreaSrc",
Type="cBlockArea",
},
{
Name="RelMinCoords",
Type="number",
},
{
Name="Strategy",
Type="string",
},
},
Notes="Merges BlockAreaSrc into this object at the specified relative coords, using the specified strategy",
},
{
Params=
{
{
Name="BlockAreaSrc",
Type="cBlockArea",
},
{
Name="RelX",
Type="number",
},
{
Name="RelY",
Type="number",
},
{
Name="RelZ",
Type="number",
},
{
Name="Strategy",
Type="string",
},
},
Notes="Merges BlockAreaSrc into this object at the specified relative coords, using the specified strategy",
},
},
MirrorXY=
{
Notes="Mirrors this block area around the XY plane. Modifies blocks' metas (if present) to match (i. e. furnaces facing the opposite direction).",
},
MirrorXYNoMeta=
{
Notes="Mirrors this block area around the XY plane. Doesn't modify blocks' metas.",
},
MirrorXZ=
{
Notes="Mirrors this block area around the XZ plane. Modifies blocks' metas (if present)",
},
MirrorXZNoMeta=
{
Notes="Mirrors this block area around the XZ plane. Doesn't modify blocks' metas.",
},
MirrorYZ=
{
Notes="Mirrors this block area around the YZ plane. Modifies blocks' metas (if present)",
},
MirrorYZNoMeta=
{
Notes="Mirrors this block area around the YZ plane. Doesn't modify blocks' metas.",
},
Read=
{
{
Params=
{
{
Name="World",
Type="cWorld",
},
{
Name="Cuboid",
Type="cCuboid",
},
},
Returns=
{
{
Name="IsSuccess",
Type="boolean",
},
},
Notes="Reads the area from World, returns true if successful. baTypes and baMetas are read.",
},
{
Params=
{
{
Name="World",
Type="cWorld",
},
{
Name="Cuboid",
Type="cCuboid",
},
{
Name="DataTypes",
Type="number",
},
},
Returns=
{
{
Name="IsSuccess",
Type="boolean",
},
},
Notes="Reads the area from World, returns true if successful. DataTypes is the sum of baXXX datatypes to be read",
},
{
Params=
{
{
Name="World",
Type="cWorld",
},
{
Name="Point1",
Type="Vector3i",
},
{
Name="Point2",
Type="Vector3i",
},
},
Returns=
{
{
Name="IsSuccess",
Type="boolean",
},
},
Notes="Reads the area from World, returns true if successful. baTypes and baMetas are read.",
},
{
Params=
{
{
Name="World",
Type="cWorld",
},
{
Name="Point1",
Type="Vector3i",
},
{
Name="Point2",
Type="Vector3i",
},
{
Name="DataTypes",
Type="number",
},
},
Returns=
{
{
Name="IsSuccess",
Type="boolean",
},
},
Notes="Reads the area from World, returns true if successful. DataTypes is a sum of baXXX datatypes to be read.",
},
{
Params=
{
{
Name="World",
Type="cWorld",
},
{
Name="MinX",
Type="number",
},
{
Name="MaxX",
Type="number",
},
{
Name="MinY",
Type="number",
},
{
Name="MaxY",
Type="number",
},
{
Name="MinZ",
Type="number",
},
{
Name="MaxZ",
Type="number",
},
},
Returns=
{
{
Type="boolean",
},
},
Notes="Reads the area from World, returns true if successful. baTypes and baMetas are read.",
},
{
Params=
{
{
Name="World",
Type="cWorld",
},
{
Name="MinX",
Type="number",
},
{
Name="MaxX",
Type="number",
},
{
Name="MinY",
Type="number",
},
{
Name="MaxY",
Type="number",
},
{
Name="MinZ",
Type="number",
},
{
Name="MaxZ",
Type="number",
},
{
Name="DataTypes",
Type="number",
},
},
Returns=
{
{
Type="boolean",
},
},
Notes="Reads the area from World, returns true if successful. DataTypes is a sum of baXXX datatypes to read.",
},
},
RelLine=
{
{
Params=
{
{
Name="RelPoint1",
Type="Vector3i",
},
{
Name="RelPoint2",
Type="Vector3i",
},
{
Name="DataTypes",
Type="number",
},
{
Name="BlockType",
Type="number",
},
{
Name="BlockMeta",
Type="number",
IsOptional=true,
},
{
Name="BlockLight",
Type="number",
IsOptional=true,
},
{
Name="BlockSkyLight",
Type="number",
IsOptional=true,
},
},
Notes="Draws a line between the two specified points. Sets only datatypes specified by DataTypes (baXXX constants).",
Notes="Sets the skylight at the specified absolute coords",
},
SetBlockType=
{
Params=
{
{
Name="BlockX",
Type="number",
},
{
Name="BlockY",
Type="number",
},
{
Name="BlockZ",
Type="number",
},
{
Name="BlockType",
Type="number",
},
},
Notes="Sets the block type at the specified absolute coords",
},
SetBlockTypeMeta=
{
Params=
{
{
Name="BlockX",
Type="number",
},
{
Name="BlockY",
Type="number",
},
{
Name="BlockZ",
Type="number",
},
{
Name="BlockType",
Type="number",
},
{
Name="BlockMeta",
Type="number",
},
},
Notes="Sets the block type and meta at the specified absolute coords",
},
SetOrigin=
{
{
Params=
{
{
Name="Origin",
Type="Vector3i",
},
},
Notes="Resets the origin for the absolute coords. Only affects how absolute coords are translated into relative coords.",
},
{
Params=
{
{
Name="OriginX",
Type="number",
},
{
Name="OriginY",
Type="number",
},
{
Name="OriginZ",
Type="number",
},
},
Notes="Resets the origin for the absolute coords. Only affects how absolute coords are translated into relative coords.",
},
},
SetRelBlockLight=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
{
Name="BlockLight",
Type="number",
},
},
Notes="Sets the blocklight at the specified relative coords",
},
SetRelBlockMeta=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
{
Name="BlockMeta",
Type="number",
},
},
Notes="Sets the block meta at the specified relative coords",
},
SetRelBlockSkyLight=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
{
Name="BlockSkyLight",
Type="number",
},
},
Notes="Sets the skylight at the specified relative coords",
},
SetRelBlockType=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
{
Name="BlockType",
Type="number",
},
},
Notes="Sets the block type at the specified relative coords",
},
SetRelBlockTypeMeta=
{
Params=
{
{
Name="RelBlockX",
Type="number",
},
{
Name="RelBlockY",
Type="number",
},
{
Name="RelBlockZ",
Type="number",
},
{
Name="BlockType",
Type="number",
},
{
Name="BlockMeta",
Type="number",
},
},
Notes="Sets the block type and meta at the specified relative coords",
},
SetWEOffset=
{
{
Params=
{
{
Name="Offset",
Type="Vector3i",
},
},
Notes="Sets the WE offset, a data value sometimes stored in the schematic files. Mostly used for WorldEdit. Cuberite doesn't use this value, but provides access to it using this method.",
},
{
Params=
{
{
Name="OffsetX",
Type="number",
},
{
Name="OffsetY",
Type="number",
},
{
Name="OffsetZ",
Type="number",
},
},
Notes="Sets the WE offset, a data value sometimes stored in the schematic files. Mostly used for WorldEdit. Cuberite doesn't use this value, but provides access to it using this method.",