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
description: Learn how to use LVMs to speed up map operations.
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 -->
@ -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
your game. Using a Lua Voxel Manipulator (LVM) can be a better alternative.
- [Concepts](#concepts)
- [Reading into the LVM](#reading-into-the-lvm)
- [Reading Nodes](#reading-nodes)
- [Writing Nodes](#writing-nodes)
- [Example](#example)
- [Your Turn](#your-turn)
- [Concepts](#Concepts)
- [Reading into the LVM](#Reading-into-the-LVM)
- [Reading Nodes](#Reading-Nodes)
- [Writing Nodes](#Writing-Nodes)
- [Example](#Example)
- [Your Turn](#Your-Turn)
## 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
calling the map generator.
{% include notice.html notice=page.mapgen_object %}
## Reading Nodes
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 %}
<h2>{{ notice.title }}</h2>
{% endif %}
{{ notice.message }}
{{ notice.message | markdownify }}
</div>
</div>