Module mapmanipulator

The MapManipulator is a thin wrapper around the VoxelManip object provided by minetest.

It only capsules the VoxelManip and VoxelArea behind a few functions to minimize code.

Functions

MapManipulator:new (minp, maxp) Creates a new instance of MapManipulator.
MapManipulator:get_area () Gets the VoxelArea for the current VoxelManip.
MapManipulator:get_data () Gets the data from the VoxelManip object.
MapManipulator:get_node (x, z, y) Gets the node and param2 at the given location.
MapManipulator:set_data (data, param2_data) Sets the data into the VoxelManip object.
MapManipulator:set_node (x, z, y, node, param2) Sets the node at the given location.


Functions

MapManipulator:new (minp, maxp)
Creates a new instance of MapManipulator.

The parameters only need to be used if you want to read from a certain area of the map. They are not needed if called from on_generated function.

Parameters:

  • minp Optional. The minimum point to read the data from.
  • maxp Optional. The maximum point to read the data from.

Returns:

    A new instance.
MapManipulator:get_area ()
Gets the VoxelArea for the current VoxelManip.

Returns:

    The VoxelArea.
MapManipulator:get_data ()
Gets the data from the VoxelManip object. The data is an array that can be accessed by using the VoxelArea object.

Returns:

    Two values, the data and the param2 data.
MapManipulator:get_node (x, z, y)
Gets the node and param2 at the given location.

Parameters:

  • x The x coordinate (width).
  • z the z coordinate (depth).
  • y The y coordinate (height).

Returns:

    Two values, the node at the given location and the param2 value.
MapManipulator:set_data (data, param2_data)
Sets the data into the VoxelManip object. Will also correct and update the lighting, the liquids and flush the map.

Parameters:

  • data Optional. The data to set. If nil the cached data will be used.
  • param2_data Optional. The param2 data to set. If nil the cached data will be used.
MapManipulator:set_node (x, z, y, node, param2)
Sets the node at the given location.

Parameters:

  • x The x coordinate (width).
  • z the z coordinate (depth).
  • y The y coordinate (height).
  • node The node to set.
  • param2 Optional. The param2 data to set for this node.
generated by LDoc 1.4.2