From 990883c43938565342136cac9d4d0eded7fec27f Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 1 Jul 2019 20:47:26 +0100 Subject: [PATCH] LVM: Warn about minetest.get_mapgen_object('voxelmanip') Fixes #94 --- _en/map/lvm.md | 19 +++++++++++++------ _includes/notice.html | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/_en/map/lvm.md b/_en/map/lvm.md index 5d8802c..7b8bdb7 100644 --- a/_en/map/lvm.md +++ b/_en/map/lvm.md @@ -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 @@ -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()`. diff --git a/_includes/notice.html b/_includes/notice.html index 3a6863f..009a910 100644 --- a/_includes/notice.html +++ b/_includes/notice.html @@ -16,6 +16,6 @@ {% if notice.title %}

{{ notice.title }}

{% endif %} - {{ notice.message }} + {{ notice.message | markdownify }}