Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ashtrayoz
ashtrayoz / includeme.lua
Created December 1, 2017 07:24
Unit test for preserve_metadata
if run_unit_tests then
local test_item_name =
minetest:get_current_modname()..":preserve_metadata_test_node"
minetest.register_node(test_item_name, {
description="test",
groups={cracky=3, attached_node=1},
preserve_metadata = function(pos, node, oldmeta, drops)
drops[1]:get_meta():set_string("test", "metadata_target_string")
end,
@ashtrayoz
ashtrayoz / engraved_stone.bash
Created November 27, 2017 10:57
An example of preserving node metadata in minetest.
--() { cat >>/dev/null <<"SHELL_ARCHIVE_AND_LUA_SCRIPT"
--
-- A block that shows text, and holds its text when it is dug up or falls, by ashtrayoz.
--
-- This is an example to test some new callback stuff.
-- If you want to use it in a game, you should probably read through it and figure out
-- what is not finished first ;-)
-- Code is licensed under the same terms as MinetestGame (basically, LGPL 2.1 or later).
--
-- To install: