diff --git a/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.png b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.png new file mode 100644 index 000000000..29fde6b26 Binary files /dev/null and b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.png differ diff --git a/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png new file mode 100644 index 000000000..04770b6f6 Binary files /dev/null and b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png differ diff --git a/games/devtest/mods/basenodes/textures/dirt_with_grass/info.txt b/games/devtest/mods/basenodes/textures/dirt_with_grass/info.txt new file mode 100644 index 000000000..8db21ed9c --- /dev/null +++ b/games/devtest/mods/basenodes/textures/dirt_with_grass/info.txt @@ -0,0 +1,3 @@ +This is for testing loading textures from subfolders. +If it works correctly, the default_grass_side.png file in this folder is used but +default_grass.png is not overwritten by the file in this folder. diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png new file mode 100644 index 000000000..8c787b740 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png new file mode 100644 index 000000000..5ab7865f2 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png new file mode 100644 index 000000000..7e1c32398 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png new file mode 100644 index 000000000..b134699d0 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png differ diff --git a/games/devtest/mods/testtools/light.lua b/games/devtest/mods/testtools/light.lua new file mode 100644 index 000000000..a9458ca6b --- /dev/null +++ b/games/devtest/mods/testtools/light.lua @@ -0,0 +1,22 @@ + +local S = minetest.get_translator("testtools") + +minetest.register_tool("testtools:lighttool", { + description = S("Light tool"), + inventory_image = "testtools_lighttool.png", + groups = { testtool = 1, disable_repair = 1 }, + on_use = function(itemstack, user, pointed_thing) + local pos = pointed_thing.above + if pointed_thing.type ~= "node" or not pos then + return + end + + local node = minetest.get_node(pos) + local time = minetest.get_timeofday() + local sunlight = minetest.get_natural_light(pos) + local artificial = minetest.get_artificial_light(node.param1) + local message = ("param1 0x%02x | time %.5f | sunlight %d | artificial %d") + :format(node.param1, time, sunlight, artificial) + minetest.chat_send_player(user:get_player_name(), message) + end +}) diff --git a/games/devtest/mods/testtools/textures/testtools_lighttool.png b/games/devtest/mods/testtools/textures/testtools_lighttool.png new file mode 100644 index 000000000..6f744b7fa Binary files /dev/null and b/games/devtest/mods/testtools/textures/testtools_lighttool.png differ diff --git a/games/devtest/mods/unittests/itemdescription.lua b/games/devtest/mods/unittests/itemdescription.lua new file mode 100644 index 000000000..1d0826545 --- /dev/null +++ b/games/devtest/mods/unittests/itemdescription.lua @@ -0,0 +1,44 @@ +local full_description = "Colorful Pickaxe\nThe best pick." +minetest.register_tool("unittests:colorful_pick", { + description = full_description, + inventory_image = "basetools_mesepick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=3, + groupcaps={ + cracky={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}, + crumbly={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}, + snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3} + }, + damage_groups = {fleshy=4}, + }, +}) + +minetest.register_chatcommand("item_description", { + param = "", + description = "Show the short and full description of the wielded item.", + func = function(name) + local player = minetest.get_player_by_name(name) + local item = player:get_wielded_item() + return true, string.format("short_description: %s\ndescription: %s", + item:get_short_description(), item:get_description()) + end +}) + +function unittests.test_short_desc() + local stack = ItemStack("unittests:colorful_pick") + assert(stack:get_short_description() == "Colorful Pickaxe") + assert(stack:get_short_description() == minetest.registered_items["unittests:colorful_pick"].short_description) + assert(stack:get_description() == full_description) + assert(stack:get_description() == minetest.registered_items["unittests:colorful_pick"].description) + + stack:get_meta():set_string("description", "Hello World") + assert(stack:get_short_description() == "Colorful Pickaxe") + assert(stack:get_description() == "Hello World") + + stack:get_meta():set_string("short_description", "Foo Bar") + assert(stack:get_short_description() == "Foo Bar") + assert(stack:get_description() == "Hello World") + + return true +end