# Area Management

Before using the area interface, please create the area management object. The method is as follows:

local Area = class.Area.new()

The specific function name and description are as follows:

Serial number Function name Description
1 createAreaRect(...) Create a rectangular area
2 createAreaRectByRange(...) Create a rectangular area(through range) 1.1+
3 destroyArea(...) Destroy area
4 getAreaByPos(...) Find area via location
5 offsetArea(...) Area Offset
6 expandArea(...) Expand the area
7 getAreaCenter(...) Obtain the center point of the area
8 getAreaRectLength(...) Obtain the length of the area 1.1+
9 getAreaRectRange(...) Obtain the range of area 1.1+
10 getRandomPos(...) Location in random area
11 objInArea(...) detect if the object in the area
12 blockInArea(...) detect if the block in the area
13 posInArea(...) If location is in the area
14 getAreaPlayers(...) Obtain all players in area
15 getAreaCreatures(...) Obtain all creatures in area
16 fillBlock(...) Fill the area with blocks
17 clearAllBlock(...) Clear all the blocks in area
18 cloneArea(...) Clone the block to another area
19 getPosOffset(...) Position offset
20 replaceAreaBlock(...) Replace the old blocks with new ones

# createAreaRect

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Create a rectangular area
  • The specific use cases are as follows:
local result = Area:createAreaRect(pos, dim)

# createAreaRectByRange 1.1+

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Create a rectangular area(through range)
  • The specific use cases are as follows:
local result = Area:createAreaRectByRange(posBeg, posEnd)

# destroyArea

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Destroy area
  • The specific use cases are as follows:
local result = Area:destroyArea(areaid)

# getAreaByPos

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Find area via location
  • The specific use cases are as follows:
local result = Area:getAreaByPos(pos)

# offsetArea

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Area Offset
  • The specific use cases are as follows:
local result = Area:offsetArea(areaid, x, y, z)

# expandArea

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Expand the area
  • The specific use cases are as follows:
local result = Area:expandArea(areaid, x, y, z)

# getAreaCenter

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Obtain the center point of the area
  • The specific use cases are as follows:
local result = Area:getAreaCenter(areaid)

# getAreaRectLength 1.1+

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Obtain the length of the area
  • The specific use cases are as follows:
local result = Area:getAreaRectLength(areaid)

# getAreaRectRange 1.1+

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Obtain the range of area
  • The specific use cases are as follows:
local result = Area:getAreaRectRange(areaid)

# getRandomPos

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Location in random area
  • The specific use cases are as follows:
local result = Area:getRandomPos(areaid)

# objInArea

  • Parameters and types:
  • Return value and types:
  • The main role of this method: detect if the object in the area
  • The specific use cases are as follows:
local result = Area:objInArea(areaid, objid)

# blockInArea

  • Parameters and types:
  • Return value and types:
  • The main role of this method: detect if the block in the area
  • The specific use cases are as follows:
local result = Area:blockInArea(areaid, blockid)

# posInArea

  • Parameters and types:
  • Return value and types:
  • The main role of this method: If location is in the area
  • The specific use cases are as follows:
local result = Area:posInArea(pos, areaid)

# getAreaPlayers

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Obtain all players in area
  • The specific use cases are as follows:
local result = Area:getAreaPlayers(areaid)

# getAreaCreatures

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Obtain all creatures in area
  • The specific use cases are as follows:
local result = Area:getAreaCreatures(areaid)

# fillBlock

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Fill the area with blocks
  • The specific use cases are as follows:
local result = Area:fillBlock(areaid, blockid, face)

# clearAllBlock

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Clear all the blocks in area
  • The specific use cases are as follows:
local result = Area:clearAllBlock(areaid, blockid)

# cloneArea

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Clone the block to another area
  • The specific use cases are as follows:
local result = Area:cloneArea(areaid, deststartpos)

# getPosOffset

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Position offset
  • The specific use cases are as follows:
local result = Area:getPosOffset(srcpos, dim)

# replaceAreaBlock

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Replace the old blocks with new ones
  • The specific use cases are as follows:
local result = Area:replaceAreaBlock(areaid, srcblockid, destblockid, face)
Last Update: 11/22/2019, 2:31:59 PM