LVM: Warn about minetest.get_mapgen_object('voxelmanip')

Fixes #94
This commit is contained in:
rubenwardy 2019-07-01 20:47:26 +01:00
parent 10bf0e31ce
commit 990883c439
2 changed files with 14 additions and 7 deletions

View File

@ -5,6 +5,11 @@ root: ../..
idx: 3.5 idx: 3.5
description: Learn how to use LVMs to speed up map operations. description: Learn how to use LVMs to speed up map operations.
redirect_from: /en/chapters/lvm.html redirect_from: /en/chapters/lvm.html
mapgen_object:
level: warning
title: LVMs and Mapgen
message: Don't use `minetest.get_voxel_manip()` with mapgen, as it can cause glitches.
Use `minetest.get_mapgen_object("voxelmanip")` instead.
--- ---
## Introduction <!-- omit in toc --> ## Introduction <!-- omit in toc -->
@ -16,12 +21,12 @@ the engine. This results in constant individual copying operations between the
engine and your mod, which is slow and will quickly decrease the performance of engine and your mod, which is slow and will quickly decrease the performance of
your game. Using a Lua Voxel Manipulator (LVM) can be a better alternative. your game. Using a Lua Voxel Manipulator (LVM) can be a better alternative.
- [Concepts](#concepts) - [Concepts](#Concepts)
- [Reading into the LVM](#reading-into-the-lvm) - [Reading into the LVM](#Reading-into-the-LVM)
- [Reading Nodes](#reading-nodes) - [Reading Nodes](#Reading-Nodes)
- [Writing Nodes](#writing-nodes) - [Writing Nodes](#Writing-Nodes)
- [Example](#example) - [Example](#Example)
- [Your Turn](#your-turn) - [Your Turn](#Your-Turn)
## Concepts ## Concepts
@ -48,6 +53,8 @@ which stand for *emerged min pos* and *emerged max pos*. An LVM will load the ar
it contains for you - whether that involves loading from memory, from disk, or it contains for you - whether that involves loading from memory, from disk, or
calling the map generator. calling the map generator.
{% include notice.html notice=page.mapgen_object %}
## Reading Nodes ## Reading Nodes
To read the types of nodes at particular positions, you'll need to use `get_data()`. To read the types of nodes at particular positions, you'll need to use `get_data()`.

View File

@ -16,6 +16,6 @@
{% if notice.title %} {% if notice.title %}
<h2>{{ notice.title }}</h2> <h2>{{ notice.title }}</h2>
{% endif %} {% endif %}
{{ notice.message }} {{ notice.message | markdownify }}
</div> </div>
</div> </div>