@@ -3804,6 +3804,8 @@ Utilities
3804
3804
httpfetch_binary_data = true,
3805
3805
-- Whether formspec_version[<version>] may be used (5.1.0)
3806
3806
formspec_version_element = true,
3807
+ -- Whether AreaStore's IDs are kept on save/load (5.1.0)
3808
+ area_store_persistent_ids = true,
3807
3809
}
3808
3810
3809
3811
* `minetest.has_feature(arg)`: returns `boolean, missing_features`
@@ -5197,35 +5199,38 @@ A fast access data structure to store areas, and find areas near a given
5197
5199
position or area.
5198
5200
Every area has a `data` string attribute to store additional information.
5199
5201
You can create an empty `AreaStore` by calling `AreaStore()`, or
5200
- `AreaStore(type_name)`.
5202
+ `AreaStore(type_name)`. The mod decides where to save and load AreaStore.
5201
5203
If you chose the parameter-less constructor, a fast implementation will be
5202
5204
automatically chosen for you.
5203
5205
5204
5206
### Methods
5205
5207
5206
- * `get_area(id, include_borders, include_data)`: returns the area with the id
5207
- `id`.
5208
- (optional) Boolean values `include_borders` and `include_data` control what's
5209
- copied.
5210
- Returns nil if specified area id does not exist.
5211
- * `get_areas_for_pos(pos, include_borders, include_data)`: returns all areas
5212
- that contain the position `pos`.
5213
- (optional) Boolean values `include_borders` and `include_data` control what's
5214
- copied.
5215
- * `get_areas_in_area(edge1, edge2, accept_overlap, include_borders, include_data)`:
5216
- returns all areas that contain all nodes inside the area specified by `edge1`
5217
- and `edge2` (inclusive).
5218
- If `accept_overlap` is true, also areas are returned that have nodes in
5219
- common with the specified area.
5220
- (optional) Boolean values `include_borders` and `include_data` control what's
5221
- copied.
5208
+ * `get_area(id, include_borders, include_data)`
5209
+ * Returns the area information about the specified ID.
5210
+ * Returned values are either of these:
5211
+
5212
+ nil -- Area not found
5213
+ true -- Without `include_borders` and `include_data`
5214
+ {
5215
+ min = pos, max = pos -- `include_borders == true`
5216
+ data = string -- `include_data == true`
5217
+ }
5218
+
5219
+ * `get_areas_for_pos(pos, include_borders, include_data)`
5220
+ * Returns all areas as table, indexed by the area ID.
5221
+ * Table values: see `get_area`.
5222
+ * `get_areas_in_area(edge1, edge2, accept_overlap, include_borders, include_data)`
5223
+ * Returns all areas that contain all nodes inside the area specified by `edge1`
5224
+ and `edge2` (inclusive).
5225
+ * `accept_overlap`: if `true`, areas are returned that have nodes in
5226
+ common (intersect) with the specified area.
5227
+ * Returns the same values as `get_areas_for_pos`.
5222
5228
* `insert_area(edge1, edge2, data, [id])`: inserts an area into the store.
5223
- Returns the new area's ID, or nil if the insertion failed.
5224
- The (inclusive) positions `edge1` and `edge2` describe the area.
5225
- `data` is a string stored with the area. If passed, `id` will be used as the
5226
- internal area ID, it must be a unique number between 0 and 2^32-2. If you use
5227
- the `id` parameter you must always use it, or insertions are likely to fail
5228
- due to conflicts.
5229
+ * Returns the new area's ID, or nil if the insertion failed.
5230
+ * The (inclusive) positions `edge1` and `edge2` describe the area.
5231
+ * `data` is a string stored with the area.
5232
+ * `id` (optional): will be used as the internal area ID if it is an unique
5233
+ number between 0 and 2^32-2.
5229
5234
* `reserve(count)`: reserves resources for at most `count` many contained
5230
5235
areas.
5231
5236
Only needed for efficiency, and only some implementations profit.
0 commit comments