aboutsummaryrefslogtreecommitdiff
path: root/games/devtest
diff options
context:
space:
mode:
Diffstat (limited to 'games/devtest')
-rw-r--r--games/devtest/README.md3
-rw-r--r--games/devtest/mods/basenodes/init.lua27
-rw-r--r--games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.pngbin0 -> 829 bytes
-rw-r--r--games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png (renamed from games/devtest/mods/basenodes/textures/default_grass_side.png)bin796 -> 796 bytes
-rw-r--r--games/devtest/mods/basenodes/textures/dirt_with_grass/info.txt3
-rw-r--r--games/devtest/mods/basetools/init.lua132
-rw-r--r--games/devtest/mods/bucket/init.lua3
-rw-r--r--games/devtest/mods/chest/init.lua3
-rw-r--r--games/devtest/mods/chest_of_everything/init.lua3
-rw-r--r--games/devtest/mods/experimental/commands.lua3
-rw-r--r--games/devtest/mods/experimental/items.lua6
-rw-r--r--games/devtest/mods/soundstuff/init.lua7
-rw-r--r--games/devtest/mods/testentities/armor.lua2
-rw-r--r--games/devtest/mods/testentities/visuals.lua16
-rw-r--r--games/devtest/mods/testformspec/LICENSE.txt14
-rw-r--r--games/devtest/mods/testformspec/formspec.lua6
-rw-r--r--games/devtest/mods/testformspec/models/testformspec_character.b3dbin0 -> 73433 bytes
-rw-r--r--games/devtest/mods/testformspec/models/testformspec_chest.obj79
-rw-r--r--games/devtest/mods/testformspec/textures/default_chest_front.pngbin0 -> 423 bytes
-rw-r--r--games/devtest/mods/testformspec/textures/default_chest_inside.pngbin0 -> 102 bytes
-rw-r--r--games/devtest/mods/testformspec/textures/default_chest_side.pngbin0 -> 375 bytes
-rw-r--r--games/devtest/mods/testformspec/textures/default_chest_top.pngbin0 -> 423 bytes
-rw-r--r--games/devtest/mods/testformspec/textures/testformspec_character.pngbin0 -> 2754 bytes
-rw-r--r--games/devtest/mods/testnodes/drawtypes.lua30
-rw-r--r--games/devtest/mods/testnodes/light.lua6
-rw-r--r--games/devtest/mods/testnodes/mod.conf1
-rw-r--r--games/devtest/mods/testnodes/textures.lua49
-rw-r--r--games/devtest/mods/testnodes/textures/testnodes_height_pyramid.pngbin0 -> 90 bytes
-rw-r--r--games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.pngbin0 -> 239 bytes
-rw-r--r--games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.pngbin0 -> 591 bytes
-rw-r--r--games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.pngbin0 -> 143 bytes
-rw-r--r--games/devtest/mods/testpathfinder/init.lua6
-rw-r--r--games/devtest/mods/testtools/init.lua76
-rw-r--r--games/devtest/mods/testtools/light.lua22
-rw-r--r--games/devtest/mods/testtools/textures/testtools_lighttool.pngbin0 -> 1659 bytes
-rw-r--r--games/devtest/mods/unittests/init.lua2
-rw-r--r--games/devtest/mods/unittests/itemdescription.lua44
-rw-r--r--games/devtest/mods/util_commands/init.lua66
38 files changed, 524 insertions, 85 deletions
diff --git a/games/devtest/README.md b/games/devtest/README.md
index a7e93cf11..77e722af7 100644
--- a/games/devtest/README.md
+++ b/games/devtest/README.md
@@ -23,9 +23,8 @@ Basically, just create a world and start. A few important things to note:
* Use the `/infplace` command to toggle infinite node placement in-game
* Use the Param2 Tool to change the param2 of nodes; it's useful to experiment with the various drawtype test nodes
* Check out the game settings and server commands for additional tests and features
-* Creative Mode does nothing (apart from default engine behavior)
-Confused by a certain node or item? Check out for inline code comments.
+Confused by a certain node or item? Check out for inline code comments. The usages of most tools are explained in their tooltips.
### Example tests
diff --git a/games/devtest/mods/basenodes/init.lua b/games/devtest/mods/basenodes/init.lua
index 8156c4bec..0cb85d808 100644
--- a/games/devtest/mods/basenodes/init.lua
+++ b/games/devtest/mods/basenodes/init.lua
@@ -124,8 +124,10 @@ minetest.register_node("basenodes:pine_needles", {
})
minetest.register_node("basenodes:water_source", {
- description = "Water Source",
+ description = "Water Source".."\n"..
+ "Drowning damage: 1",
drawtype = "liquid",
+ waving = 3,
tiles = {"default_water.png"},
special_tiles = {
{name = "default_water.png", backface_culling = false},
@@ -148,8 +150,10 @@ minetest.register_node("basenodes:water_source", {
})
minetest.register_node("basenodes:water_flowing", {
- description = "Flowing Water",
+ description = "Flowing Water".."\n"..
+ "Drowning damage: 1",
drawtype = "flowingliquid",
+ waving = 3,
tiles = {"default_water_flowing.png"},
special_tiles = {
{name = "default_water_flowing.png", backface_culling = false},
@@ -173,8 +177,10 @@ minetest.register_node("basenodes:water_flowing", {
})
minetest.register_node("basenodes:river_water_source", {
- description = "River Water Source",
+ description = "River Water Source".."\n"..
+ "Drowning damage: 1",
drawtype = "liquid",
+ waving = 3,
tiles = { "default_river_water.png" },
special_tiles = {
{name = "default_river_water.png", backface_culling = false},
@@ -199,8 +205,10 @@ minetest.register_node("basenodes:river_water_source", {
})
minetest.register_node("basenodes:river_water_flowing", {
- description = "Flowing River Water",
+ description = "Flowing River Water".."\n"..
+ "Drowning damage: 1",
drawtype = "flowingliquid",
+ waving = 3,
tiles = {"default_river_water_flowing.png"},
special_tiles = {
{name = "default_river_water_flowing.png", backface_culling = false},
@@ -226,7 +234,9 @@ minetest.register_node("basenodes:river_water_flowing", {
})
minetest.register_node("basenodes:lava_flowing", {
- description = "Flowing Lava",
+ description = "Flowing Lava".."\n"..
+ "4 damage per second".."\n"..
+ "Drowning damage: 1",
drawtype = "flowingliquid",
tiles = {"default_lava_flowing.png"},
special_tiles = {
@@ -251,7 +261,9 @@ minetest.register_node("basenodes:lava_flowing", {
})
minetest.register_node("basenodes:lava_source", {
- description = "Lava Source",
+ description = "Lava Source".."\n"..
+ "4 damage per second".."\n"..
+ "Drowning damage: 1",
drawtype = "liquid",
tiles = { "default_lava.png" },
special_tiles = {
@@ -290,7 +302,8 @@ minetest.register_node("basenodes:mossycobble", {
})
minetest.register_node("basenodes:apple", {
- description = "Apple",
+ description = "Apple".."\n"..
+ "Food (+2)",
drawtype = "plantlike",
tiles ={"default_apple.png"},
inventory_image = "default_apple.png",
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
--- /dev/null
+++ b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.png
Binary files differ
diff --git a/games/devtest/mods/basenodes/textures/default_grass_side.png b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png
index 04770b6f6..04770b6f6 100644
--- a/games/devtest/mods/basenodes/textures/default_grass_side.png
+++ b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png
Binary files 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/basetools/init.lua b/games/devtest/mods/basetools/init.lua
index c5b4cd76c..bd7480030 100644
--- a/games/devtest/mods/basetools/init.lua
+++ b/games/devtest/mods/basetools/init.lua
@@ -6,7 +6,7 @@
Tool types:
-* Hand: basic tool/weapon (just for convenience, not optimized for testing)
+* Hand: basic tool/weapon (special capabilities in creative mode)
* Pickaxe: dig cracky
* Axe: dig choppy
* Shovel: dig crumbly
@@ -24,25 +24,54 @@ Tool materials:
]]
-- The hand
-minetest.register_item(":", {
- type = "none",
- wield_image = "wieldhand.png",
- wield_scale = {x=1,y=1,z=2.5},
- tool_capabilities = {
- full_punch_interval = 1.0,
- max_drop_level = 0,
- groupcaps = {
- crumbly = {times={[3]=1.50}, uses=0, maxlevel=0},
- snappy = {times={[3]=1.50}, uses=0, maxlevel=0},
- oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=2.00}, uses=0, maxlevel=0},
- },
- damage_groups = {fleshy=1},
- }
-})
+if minetest.settings:get_bool("creative_mode") then
+ local digtime = 42
+ local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
+
+ minetest.register_item(":", {
+ type = "none",
+ wield_image = "wieldhand.png",
+ wield_scale = {x = 1, y = 1, z = 2.5},
+ range = 10,
+ tool_capabilities = {
+ full_punch_interval = 0.5,
+ max_drop_level = 3,
+ groupcaps = {
+ crumbly = caps,
+ cracky = caps,
+ snappy = caps,
+ choppy = caps,
+ oddly_breakable_by_hand = caps,
+ -- dig_immediate group doesn't use value 1. Value 3 is instant dig
+ dig_immediate =
+ {times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256},
+ },
+ damage_groups = {fleshy = 10},
+ }
+ })
+else
+ minetest.register_item(":", {
+ type = "none",
+ wield_image = "wieldhand.png",
+ wield_scale = {x = 1, y = 1, z = 2.5},
+ tool_capabilities = {
+ full_punch_interval = 0.9,
+ max_drop_level = 0,
+ groupcaps = {
+ crumbly = {times = {[2] = 3.00, [3] = 0.70}, uses = 0, maxlevel = 1},
+ snappy = {times = {[3] = 0.40}, uses = 0, maxlevel = 1},
+ oddly_breakable_by_hand =
+ {times = {[1] = 3.50, [2] = 2.00, [3] = 0.70}, uses = 0}
+ },
+ damage_groups = {fleshy = 1},
+ }
+ })
+end
-- Mese Pickaxe: special tool that digs "everything" instantly
minetest.register_tool("basetools:pick_mese", {
- description = "Mese Pickaxe",
+ description = "Mese Pickaxe".."\n"..
+ "Digs diggable nodes instantly",
inventory_image = "basetools_mesepick.png",
tool_capabilities = {
full_punch_interval = 1.0,
@@ -65,7 +94,9 @@ minetest.register_tool("basetools:pick_mese", {
-- This should break after only 1 use
minetest.register_tool("basetools:pick_dirt", {
- description = "Dirt Pickaxe",
+ description = "Dirt Pickaxe".."\n"..
+ "Digs cracky=3".."\n"..
+ "1 use only",
inventory_image = "basetools_dirtpick.png",
tool_capabilities = {
max_drop_level=0,
@@ -76,7 +107,8 @@ minetest.register_tool("basetools:pick_dirt", {
})
minetest.register_tool("basetools:pick_wood", {
- description = "Wooden Pickaxe",
+ description = "Wooden Pickaxe".."\n"..
+ "Digs cracky=3",
inventory_image = "basetools_woodpick.png",
tool_capabilities = {
max_drop_level=0,
@@ -86,7 +118,8 @@ minetest.register_tool("basetools:pick_wood", {
},
})
minetest.register_tool("basetools:pick_stone", {
- description = "Stone Pickaxe",
+ description = "Stone Pickaxe".."\n"..
+ "Digs cracky=2..3",
inventory_image = "basetools_stonepick.png",
tool_capabilities = {
max_drop_level=0,
@@ -96,7 +129,8 @@ minetest.register_tool("basetools:pick_stone", {
},
})
minetest.register_tool("basetools:pick_steel", {
- description = "Steel Pickaxe",
+ description = "Steel Pickaxe".."\n"..
+ "Digs cracky=1..3",
inventory_image = "basetools_steelpick.png",
tool_capabilities = {
max_drop_level=1,
@@ -106,7 +140,9 @@ minetest.register_tool("basetools:pick_steel", {
},
})
minetest.register_tool("basetools:pick_steel_l1", {
- description = "Steel Pickaxe Level 1",
+ description = "Steel Pickaxe Level 1".."\n"..
+ "Digs cracky=1..3".."\n"..
+ "maxlevel=1",
inventory_image = "basetools_steelpick_l1.png",
tool_capabilities = {
max_drop_level=1,
@@ -116,7 +152,9 @@ minetest.register_tool("basetools:pick_steel_l1", {
},
})
minetest.register_tool("basetools:pick_steel_l2", {
- description = "Steel Pickaxe Level 2",
+ description = "Steel Pickaxe Level 2".."\n"..
+ "Digs cracky=1..3".."\n"..
+ "maxlevel=2",
inventory_image = "basetools_steelpick_l2.png",
tool_capabilities = {
max_drop_level=1,
@@ -131,7 +169,8 @@ minetest.register_tool("basetools:pick_steel_l2", {
--
minetest.register_tool("basetools:shovel_wood", {
- description = "Wooden Shovel",
+ description = "Wooden Shovel".."\n"..
+ "Digs crumbly=3",
inventory_image = "basetools_woodshovel.png",
tool_capabilities = {
max_drop_level=0,
@@ -141,7 +180,8 @@ minetest.register_tool("basetools:shovel_wood", {
},
})
minetest.register_tool("basetools:shovel_stone", {
- description = "Stone Shovel",
+ description = "Stone Shovel".."\n"..
+ "Digs crumbly=2..3",
inventory_image = "basetools_stoneshovel.png",
tool_capabilities = {
max_drop_level=0,
@@ -151,7 +191,8 @@ minetest.register_tool("basetools:shovel_stone", {
},
})
minetest.register_tool("basetools:shovel_steel", {
- description = "Steel Shovel",
+ description = "Steel Shovel".."\n"..
+ "Digs crumbly=1..3",
inventory_image = "basetools_steelshovel.png",
tool_capabilities = {
max_drop_level=1,
@@ -166,7 +207,8 @@ minetest.register_tool("basetools:shovel_steel", {
--
minetest.register_tool("basetools:axe_wood", {
- description = "Wooden Axe",
+ description = "Wooden Axe".."\n"..
+ "Digs choppy=3",
inventory_image = "basetools_woodaxe.png",
tool_capabilities = {
max_drop_level=0,
@@ -176,7 +218,8 @@ minetest.register_tool("basetools:axe_wood", {
},
})
minetest.register_tool("basetools:axe_stone", {
- description = "Stone Axe",
+ description = "Stone Axe".."\n"..
+ "Digs choppy=2..3",
inventory_image = "basetools_stoneaxe.png",
tool_capabilities = {
max_drop_level=0,
@@ -186,7 +229,8 @@ minetest.register_tool("basetools:axe_stone", {
},
})
minetest.register_tool("basetools:axe_steel", {
- description = "Steel Axe",
+ description = "Steel Axe".."\n"..
+ "Digs choppy=1..3",
inventory_image = "basetools_steelaxe.png",
tool_capabilities = {
max_drop_level=1,
@@ -201,7 +245,8 @@ minetest.register_tool("basetools:axe_steel", {
--
minetest.register_tool("basetools:shears_wood", {
- description = "Wooden Shears",
+ description = "Wooden Shears".."\n"..
+ "Digs snappy=3",
inventory_image = "basetools_woodshears.png",
tool_capabilities = {
max_drop_level=0,
@@ -211,7 +256,8 @@ minetest.register_tool("basetools:shears_wood", {
},
})
minetest.register_tool("basetools:shears_stone", {
- description = "Stone Shears",
+ description = "Stone Shears".."\n"..
+ "Digs snappy=2..3",
inventory_image = "basetools_stoneshears.png",
tool_capabilities = {
max_drop_level=0,
@@ -221,7 +267,8 @@ minetest.register_tool("basetools:shears_stone", {
},
})
minetest.register_tool("basetools:shears_steel", {
- description = "Steel Shears",
+ description = "Steel Shears".."\n"..
+ "Digs snappy=1..3",
inventory_image = "basetools_steelshears.png",
tool_capabilities = {
max_drop_level=1,
@@ -236,7 +283,8 @@ minetest.register_tool("basetools:shears_steel", {
--
minetest.register_tool("basetools:sword_wood", {
- description = "Wooden Sword",
+ description = "Wooden Sword".."\n"..
+ "Damage: fleshy=2",
inventory_image = "basetools_woodsword.png",
tool_capabilities = {
full_punch_interval = 1.0,
@@ -244,7 +292,8 @@ minetest.register_tool("basetools:sword_wood", {
}
})
minetest.register_tool("basetools:sword_stone", {
- description = "Stone Sword",
+ description = "Stone Sword".."\n"..
+ "Damage: fleshy=4",
inventory_image = "basetools_stonesword.png",
tool_capabilities = {
full_punch_interval = 1.0,
@@ -253,7 +302,8 @@ minetest.register_tool("basetools:sword_stone", {
}
})
minetest.register_tool("basetools:sword_steel", {
- description = "Steel Sword",
+ description = "Steel Sword".."\n"..
+ "Damage: fleshy=6",
inventory_image = "basetools_steelsword.png",
tool_capabilities = {
full_punch_interval = 1.0,
@@ -264,7 +314,8 @@ minetest.register_tool("basetools:sword_steel", {
-- Fire/Ice sword: Deal damage to non-fleshy damage groups
minetest.register_tool("basetools:sword_fire", {
- description = "Fire Sword",
+ description = "Fire Sword".."\n"..
+ "Damage: icy=6",
inventory_image = "basetools_firesword.png",
tool_capabilities = {
full_punch_interval = 1.0,
@@ -273,12 +324,13 @@ minetest.register_tool("basetools:sword_fire", {
}
})
minetest.register_tool("basetools:sword_ice", {
- description = "Ice Sword",
+ description = "Ice Sword".."\n"..
+ "Damage: fiery=6",
inventory_image = "basetools_icesword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
- damage_groups = {firy=6},
+ damage_groups = {fiery=6},
}
})
@@ -286,7 +338,9 @@ minetest.register_tool("basetools:sword_ice", {
-- Dagger: Low damage, fast punch interval
--
minetest.register_tool("basetools:dagger_steel", {
- description = "Steel Dagger",
+ description = "Steel Dagger".."\n"..
+ "Damage: fleshy=2".."\n"..
+ "Full Punch Interval: 0.5s",
inventory_image = "basetools_steeldagger.png",
tool_capabilities = {
full_punch_interval = 0.5,
diff --git a/games/devtest/mods/bucket/init.lua b/games/devtest/mods/bucket/init.lua
index 3189d4aa6..ff58b0669 100644
--- a/games/devtest/mods/bucket/init.lua
+++ b/games/devtest/mods/bucket/init.lua
@@ -1,7 +1,8 @@
-- Bucket: Punch liquid source or flowing liquid to collect it
minetest.register_tool("bucket:bucket", {
- description = "Bucket",
+ description = "Bucket".."\n"..
+ "Picks up liquid nodes",
inventory_image = "bucket.png",
stack_max = 1,
liquids_pointable = true,
diff --git a/games/devtest/mods/chest/init.lua b/games/devtest/mods/chest/init.lua
index c44522cb9..fc92bfdd1 100644
--- a/games/devtest/mods/chest/init.lua
+++ b/games/devtest/mods/chest/init.lua
@@ -1,5 +1,6 @@
minetest.register_node("chest:chest", {
- description = "Chest",
+ description = "Chest" .. "\n" ..
+ "32 inventory slots",
tiles ={"chest_chest.png^[sheet:2x2:0,0", "chest_chest.png^[sheet:2x2:0,0",
"chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:1,0",
"chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:0,1"},
diff --git a/games/devtest/mods/chest_of_everything/init.lua b/games/devtest/mods/chest_of_everything/init.lua
index 7d61abebf..3e9d2678a 100644
--- a/games/devtest/mods/chest_of_everything/init.lua
+++ b/games/devtest/mods/chest_of_everything/init.lua
@@ -43,7 +43,8 @@ local function get_chest_formspec(page)
end
minetest.register_node("chest_of_everything:chest", {
- description = "Chest of Everything",
+ description = "Chest of Everything" .. "\n" ..
+ "Grants access to all items",
tiles ={"chest_of_everything_chest.png^[sheet:2x2:0,0", "chest_of_everything_chest.png^[sheet:2x2:0,0",
"chest_of_everything_chest.png^[sheet:2x2:1,0", "chest_of_everything_chest.png^[sheet:2x2:1,0",
"chest_of_everything_chest.png^[sheet:2x2:1,0", "chest_of_everything_chest.png^[sheet:2x2:0,1"},
diff --git a/games/devtest/mods/experimental/commands.lua b/games/devtest/mods/experimental/commands.lua
index 158e5039d..132b08b0b 100644
--- a/games/devtest/mods/experimental/commands.lua
+++ b/games/devtest/mods/experimental/commands.lua
@@ -214,3 +214,6 @@ minetest.register_chatcommand("test_place_nodes", {
end,
})
+core.register_on_chatcommand(function(name, command, params)
+ minetest.log("caught command '"..command.."', issued by '"..name.."'. Parameters: '"..params.."'")
+end)
diff --git a/games/devtest/mods/experimental/items.lua b/games/devtest/mods/experimental/items.lua
index 51b063ba2..94be71cf7 100644
--- a/games/devtest/mods/experimental/items.lua
+++ b/games/devtest/mods/experimental/items.lua
@@ -44,7 +44,8 @@ minetest.register_node("experimental:callback_node", {
})
minetest.register_tool("experimental:privatizer", {
- description = "Node Meta Privatizer",
+ description = "Node Meta Privatizer".."\n"..
+ "Punch: Marks 'infotext' and 'formspec' meta fields of chest as private",
inventory_image = "experimental_tester_tool_1.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
@@ -67,7 +68,8 @@ minetest.register_tool("experimental:privatizer", {
})
minetest.register_tool("experimental:particle_spawner", {
- description = "Particle Spawner",
+ description = "Particle Spawner".."\n"..
+ "Punch: Spawn random test particle",
inventory_image = "experimental_tester_tool_1.png^[invert:g",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
diff --git a/games/devtest/mods/soundstuff/init.lua b/games/devtest/mods/soundstuff/init.lua
index 22012ba14..40ad8f562 100644
--- a/games/devtest/mods/soundstuff/init.lua
+++ b/games/devtest/mods/soundstuff/init.lua
@@ -107,7 +107,8 @@ minetest.register_node("soundstuff:footstep_climbable", {
minetest.register_craftitem("soundstuff:eat", {
- description = "Eat Sound Item",
+ description = "Eat Sound Item".."\n"..
+ "Makes a sound when 'eaten' (with punch key)",
inventory_image = "soundstuff_eat.png",
on_use = minetest.item_eat(0),
sound = {
@@ -116,7 +117,9 @@ minetest.register_craftitem("soundstuff:eat", {
})
minetest.register_tool("soundstuff:breaks", {
- description = "Break Sound Tool",
+ description = "Break Sound Tool".."\n"..
+ "Digs cracky=3 and more".."\n"..
+ "Makes a sound when it breaks",
inventory_image = "soundstuff_node_dug.png",
sound = {
breaks = { name = "soundstuff_mono", gain = 1.0 },
diff --git a/games/devtest/mods/testentities/armor.lua b/games/devtest/mods/testentities/armor.lua
index 4c30cec8d..306953d50 100644
--- a/games/devtest/mods/testentities/armor.lua
+++ b/games/devtest/mods/testentities/armor.lua
@@ -3,7 +3,7 @@
local phasearmor = {
[0]={icy=100},
- [1]={firy=100},
+ [1]={fiery=100},
[2]={fleshy=100},
[3]={immortal=1},
[4]={punch_operable=1},
diff --git a/games/devtest/mods/testentities/visuals.lua b/games/devtest/mods/testentities/visuals.lua
index 83f361f16..8848ba49f 100644
--- a/games/devtest/mods/testentities/visuals.lua
+++ b/games/devtest/mods/testentities/visuals.lua
@@ -68,7 +68,7 @@ minetest.register_entity("testentities:mesh_unshaded", {
-- Advanced visual tests
--- A test entity for testing animated and yaw-modulated sprites
+-- An entity for testing animated and yaw-modulated sprites
minetest.register_entity("testentities:yawsprite", {
initial_properties = {
selectionbox = {-0.3, -0.5, -0.3, 0.3, 0.3, 0.3},
@@ -79,6 +79,18 @@ minetest.register_entity("testentities:yawsprite", {
initial_sprite_basepos = {x=0, y=0},
},
on_activate = function(self, staticdata)
- self.object:set_sprite({x=0, y=0}, 1, 0, true)
+ self.object:set_sprite({x=0, y=0}, 3, 0.5, true)
+ end,
+})
+
+-- An entity for testing animated upright sprites
+minetest.register_entity("testentities:upright_animated", {
+ initial_properties = {
+ visual = "upright_sprite",
+ textures = {"testnodes_anim.png"},
+ spritediv = {x = 1, y = 4},
+ },
+ on_activate = function(self)
+ self.object:set_sprite({x=0, y=0}, 4, 1.0, false)
end,
})
diff --git a/games/devtest/mods/testformspec/LICENSE.txt b/games/devtest/mods/testformspec/LICENSE.txt
new file mode 100644
index 000000000..07696cc30
--- /dev/null
+++ b/games/devtest/mods/testformspec/LICENSE.txt
@@ -0,0 +1,14 @@
+License of media files
+----------------------
+Content imported from minetest_game.
+
+
+BlockMen (CC BY-SA 3.0)
+ default_chest_front.png
+ default_chest_lock.png
+ default_chest_side.png
+ default_chest_top.png
+
+stujones11 (CC BY-SA 3.0)
+An0n3m0us (CC BY-SA 3.0)
+ testformspec_character.b3d
diff --git a/games/devtest/mods/testformspec/formspec.lua b/games/devtest/mods/testformspec/formspec.lua
index 08c1b6dc0..5495896ce 100644
--- a/games/devtest/mods/testformspec/formspec.lua
+++ b/games/devtest/mods/testformspec/formspec.lua
@@ -164,7 +164,7 @@ local style_fs = [[
style[one_btn14:hovered+pressed;textcolor=purple]
image_button[0,9.6;1,1;testformspec_button_image.png;one_btn14;Bg]
- style[one_btn15;border=false;bgimg=testformspec_bg.png;bgimg_hovered=testformspec_bg_hovered.png;bgimg_pressed=testformspec_bg_pressed.png]
+ style[one_btn15;border=false;bgcolor=#1cc;bgimg=testformspec_bg.png;bgimg_hovered=testformspec_bg_hovered.png;bgimg_pressed=testformspec_bg_pressed.png]
item_image_button[1.25,9.6;1,1;testformspec:item;one_btn15;Bg]
style[one_btn16;border=false;bgimg=testformspec_bg_9slice.png;bgimg_hovered=testformspec_bg_9slice_hovered.png;bgimg_pressed=testformspec_bg_9slice_pressed.png;bgimg_middle=4,6]
@@ -327,6 +327,10 @@ Number]
animated_image[3,4.25;1,1;;testformspec_animation.png;4;0;3]
animated_image[5.5,0.5;5,2;;testformspec_animation.png;4;100]
animated_image[5.5,2.75;5,2;;testformspec_animation.jpg;4;100]
+
+ style[m1;bgcolor=black]
+ model[0.5,6;4,4;m1;testformspec_character.b3d;testformspec_character.png]
+ model[5,6;4,4;m2;testformspec_chest.obj;default_chest_top.png,default_chest_top.png,default_chest_side.png,default_chest_side.png,default_chest_front.png,default_chest_inside.png;30,1;true;true]
]],
-- Scroll containers
diff --git a/games/devtest/mods/testformspec/models/testformspec_character.b3d b/games/devtest/mods/testformspec/models/testformspec_character.b3d
new file mode 100644
index 000000000..8edbaf637
--- /dev/null
+++ b/games/devtest/mods/testformspec/models/testformspec_character.b3d
Binary files differ
diff --git a/games/devtest/mods/testformspec/models/testformspec_chest.obj b/games/devtest/mods/testformspec/models/testformspec_chest.obj
new file mode 100644
index 000000000..72ba175a0
--- /dev/null
+++ b/games/devtest/mods/testformspec/models/testformspec_chest.obj
@@ -0,0 +1,79 @@
+# Blender v2.78 (sub 0) OBJ File: 'chest-open.blend'
+# www.blender.org
+o Top_Cube.002_None_Top_Cube.002_None_bottom
+v -0.500000 0.408471 0.720970
+v -0.500000 1.115578 0.013863
+v -0.500000 0.894607 -0.207108
+v -0.500000 0.187501 0.499999
+v 0.500000 1.115578 0.013863
+v 0.500000 0.408471 0.720970
+v 0.500000 0.187501 0.499999
+v 0.500000 0.894607 -0.207108
+v -0.500000 0.187500 -0.500000
+v -0.500000 -0.500000 -0.500000
+v -0.500000 -0.500000 0.500000
+v 0.500000 0.187500 -0.500000
+v 0.500000 -0.500000 0.500000
+v 0.500000 -0.500000 -0.500000
+vt 0.0000 1.0000
+vt 0.0000 0.0000
+vt 1.0000 0.0000
+vt 1.0000 1.0000
+vt 1.0000 0.0000
+vt 1.0000 1.0000
+vt 0.0000 1.0000
+vt 0.0000 0.0000
+vt 0.0000 1.0000
+vt 1.0000 1.0000
+vt 1.0000 0.6875
+vt 0.0000 0.6875
+vt 1.0000 1.0000
+vt 0.0000 0.6875
+vt 1.0000 0.6875
+vt 1.0000 0.6875
+vt 1.0000 0.0000
+vt 0.0000 0.0000
+vt 1.0000 0.6875
+vt 1.0000 0.0000
+vt 1.0000 1.0000
+vt 1.0000 0.6875
+vt 1.0000 0.0000
+vt 0.0000 1.0000
+vt 0.0000 0.6875
+vt 0.0000 0.6875
+vt 0.0000 0.0000
+vt 1.0000 0.5000
+vt 1.0000 1.0000
+vt 0.0000 1.0000
+vt 0.0000 0.5000
+vt 0.0000 0.0000
+vt 1.0000 0.0000
+vn 0.0000 0.7071 0.7071
+vn -0.0000 -1.0000 -0.0000
+vn -1.0000 0.0000 0.0000
+vn 1.0000 0.0000 -0.0000
+vn 0.0000 -0.7071 0.7071
+vn 0.0000 0.0000 1.0000
+vn -0.0000 0.7071 -0.7071
+vn -0.0000 0.0000 -1.0000
+vn -0.0000 -0.7071 -0.7071
+vn -0.0000 1.0000 -0.0000
+g Top_Cube.002_None_Top_Cube.002_None_bottom_Top_Cube.002_None_Top_Cube.002_None_bottom_Top
+s off
+f 6/1/1 5/2/1 2/3/1 1/4/1
+g Top_Cube.002_None_Top_Cube.002_None_bottom_Top_Cube.002_None_Top_Cube.002_None_bottom_Bottom
+f 11/5/2 10/6/2 14/7/2 13/8/2
+g Top_Cube.002_None_Top_Cube.002_None_bottom_Top_Cube.002_None_Top_Cube.002_None_bottom_Right-Left
+f 1/9/3 2/10/3 3/11/3 4/12/3
+f 5/13/4 6/1/4 7/14/4 8/15/4
+f 4/12/3 9/16/3 10/17/3 11/18/3
+f 12/19/4 7/14/4 13/8/4 14/20/4
+g Top_Cube.002_None_Top_Cube.002_None_bottom_Top_Cube.002_None_Top_Cube.002_None_bottom_Back
+f 6/21/5 1/9/5 4/12/5 7/22/5
+f 7/22/6 4/12/6 11/18/6 13/23/6
+g Top_Cube.002_None_Top_Cube.002_None_bottom_Top_Cube.002_None_Top_Cube.002_None_bottom_Front
+f 2/10/7 5/24/7 8/25/7 3/11/7
+f 9/16/8 12/26/8 14/27/8 10/17/8
+g Top_Cube.002_None_Top_Cube.002_None_bottom_Top_Cube.002_None_Top_Cube.002_None_bottom_Inside
+f 4/28/9 3/29/9 8/30/9 7/31/9
+f 7/31/10 12/32/10 9/33/10 4/28/10
diff --git a/games/devtest/mods/testformspec/textures/default_chest_front.png b/games/devtest/mods/testformspec/textures/default_chest_front.png
new file mode 100644
index 000000000..85227d8fd
--- /dev/null
+++ b/games/devtest/mods/testformspec/textures/default_chest_front.png
Binary files differ
diff --git a/games/devtest/mods/testformspec/textures/default_chest_inside.png b/games/devtest/mods/testformspec/textures/default_chest_inside.png
new file mode 100644
index 000000000..5f7b6b132
--- /dev/null
+++ b/games/devtest/mods/testformspec/textures/default_chest_inside.png
Binary files differ
diff --git a/games/devtest/mods/testformspec/textures/default_chest_side.png b/games/devtest/mods/testformspec/textures/default_chest_side.png
new file mode 100644
index 000000000..44a65a43d
--- /dev/null
+++ b/games/devtest/mods/testformspec/textures/default_chest_side.png
Binary files differ
diff --git a/games/devtest/mods/testformspec/textures/default_chest_top.png b/games/devtest/mods/testformspec/textures/default_chest_top.png
new file mode 100644
index 000000000..f4a92ee07
--- /dev/null
+++ b/games/devtest/mods/testformspec/textures/default_chest_top.png
Binary files differ
diff --git a/games/devtest/mods/testformspec/textures/testformspec_character.png b/games/devtest/mods/testformspec/textures/testformspec_character.png
new file mode 100644
index 000000000..05021781e
--- /dev/null
+++ b/games/devtest/mods/testformspec/textures/testformspec_character.png
Binary files differ
diff --git a/games/devtest/mods/testnodes/drawtypes.lua b/games/devtest/mods/testnodes/drawtypes.lua
index 6bf57fa37..b3ab2b322 100644
--- a/games/devtest/mods/testnodes/drawtypes.lua
+++ b/games/devtest/mods/testnodes/drawtypes.lua
@@ -145,6 +145,23 @@ minetest.register_node("testnodes:fencelike", {
})
minetest.register_node("testnodes:torchlike", {
+ description = S("Torchlike Drawtype Test Node"),
+ drawtype = "torchlike",
+ paramtype = "light",
+ tiles = {
+ "testnodes_torchlike_floor.png",
+ "testnodes_torchlike_ceiling.png",
+ "testnodes_torchlike_wall.png",
+ },
+
+
+ walkable = false,
+ sunlight_propagates = true,
+ groups = { dig_immediate = 3 },
+ inventory_image = fallback_image("testnodes_torchlike_floor.png"),
+})
+
+minetest.register_node("testnodes:torchlike_wallmounted", {
description = S("Wallmounted Torchlike Drawtype Test Node"),
drawtype = "torchlike",
paramtype = "light",
@@ -162,6 +179,8 @@ minetest.register_node("testnodes:torchlike", {
inventory_image = fallback_image("testnodes_torchlike_floor.png"),
})
+
+
minetest.register_node("testnodes:signlike", {
description = S("Wallmounted Signlike Drawtype Test Node"),
drawtype = "signlike",
@@ -514,10 +533,19 @@ local scale = function(subname, desc_double, desc_half)
minetest.register_node("testnodes:"..subname.."_half", def)
end
+scale("allfaces",
+ S("Double-sized Allfaces Drawtype Test Node"),
+ S("Half-sized Allfaces Drawtype Test Node"))
+scale("allfaces_optional",
+ S("Double-sized Allfaces Optional Drawtype Test Node"),
+ S("Half-sized Allfaces Optional Drawtype Test Node"))
+scale("allfaces_optional_waving",
+ S("Double-sized Waving Allfaces Optional Drawtype Test Node"),
+ S("Half-sized Waving Allfaces Optional Drawtype Test Node"))
scale("plantlike",
S("Double-sized Plantlike Drawtype Test Node"),
S("Half-sized Plantlike Drawtype Test Node"))
-scale("torchlike",
+scale("torchlike_wallmounted",
S("Double-sized Wallmounted Torchlike Drawtype Test Node"),
S("Half-sized Wallmounted Torchlike Drawtype Test Node"))
scale("signlike",
diff --git a/games/devtest/mods/testnodes/light.lua b/games/devtest/mods/testnodes/light.lua
index 94409e83f..8ab4416d9 100644
--- a/games/devtest/mods/testnodes/light.lua
+++ b/games/devtest/mods/testnodes/light.lua
@@ -22,7 +22,8 @@ end
-- Lets light through, but not sunlight, leading to a
-- reduction in light level when light passes through
minetest.register_node("testnodes:sunlight_filter", {
- description = S("Sunlight Filter"),
+ description = S("Sunlight Filter") .."\n"..
+ S("Lets light through, but weakens sunlight"),
paramtype = "light",
@@ -35,7 +36,8 @@ minetest.register_node("testnodes:sunlight_filter", {
-- Lets light and sunlight through without obstruction
minetest.register_node("testnodes:sunlight_propagator", {
- description = S("Sunlight Propagator"),
+ description = S("Sunlight Propagator") .."\n"..
+ S("Lets all light through"),
paramtype = "light",
sunlight_propagates = true,
diff --git a/games/devtest/mods/testnodes/mod.conf b/games/devtest/mods/testnodes/mod.conf
index 4824c6ed0..d894c3452 100644
--- a/games/devtest/mods/testnodes/mod.conf
+++ b/games/devtest/mods/testnodes/mod.conf
@@ -1,2 +1,3 @@
name = testnodes
description = Contains a bunch of basic example nodes for demonstrative purposes, development and testing
+depends = stairs
diff --git a/games/devtest/mods/testnodes/textures.lua b/games/devtest/mods/testnodes/textures.lua
index 6ffef8fe9..e0724c229 100644
--- a/games/devtest/mods/testnodes/textures.lua
+++ b/games/devtest/mods/testnodes/textures.lua
@@ -71,3 +71,52 @@ for a=1,#alphas do
groups = { dig_immediate = 3 },
})
end
+
+
+-- Bumpmapping and Parallax Occlusion
+
+-- This node has a normal map which corresponds to a pyramid with sides tilted
+-- by an angle of 45°, i.e. the normal map contains four vectors which point
+-- diagonally away from the surface (e.g. (0.7, 0.7, 0)),
+-- and the heights in the height map linearly increase towards the centre,
+-- so that the surface corresponds to a simple pyramid.
+-- The node can help to determine if e.g. tangent space transformations work
+-- correctly.
+-- If, for example, the light comes from above, then the (tilted) pyramids
+-- should look like they're lit from this light direction on all node faces.
+-- The white albedo texture has small black indicators which can be used to see
+-- how it is transformed ingame (and thus see if there's rotation around the
+-- normal vector).
+minetest.register_node("testnodes:height_pyramid", {
+ description = "Bumpmapping and Parallax Occlusion Tester (height pyramid)",
+ tiles = {"testnodes_height_pyramid.png"},
+ groups = {dig_immediate = 3},
+})
+
+-- The stairs nodes should help to validate if shading works correctly for
+-- rotated nodes (which have rotated textures).
+stairs.register_stair_and_slab("height_pyramid", "experimantal:height_pyramid",
+ {dig_immediate = 3},
+ {"testnodes_height_pyramid.png"},
+ "Bumpmapping and Parallax Occlusion Tester Stair (height pyramid)",
+ "Bumpmapping and Parallax Occlusion Tester Slab (height pyramid)")
+
+-- This node has a simple heightmap for parallax occlusion testing and flat
+-- normalmap.
+-- When parallax occlusion is enabled, the yellow scrawl should stick out of
+-- the texture when viewed at an angle.
+minetest.register_node("testnodes:parallax_extruded", {
+ description = "Parallax Occlusion Tester",
+ tiles = {"testnodes_parallax_extruded.png"},
+ groups = {dig_immediate = 3},
+})
+
+-- Analogously to the height pyramid stairs nodes,
+-- these nodes should help to validate if parallax occlusion works correctly for
+-- rotated nodes (which have rotated textures).
+stairs.register_stair_and_slab("parallax_extruded",
+ "experimantal:parallax_extruded",
+ {dig_immediate = 3},
+ {"testnodes_parallax_extruded.png"},
+ "Parallax Occlusion Tester Stair",
+ "Parallax Occlusion Tester Slab")
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
--- /dev/null
+++ b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png
Binary files 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
--- /dev/null
+++ b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png
Binary files 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
--- /dev/null
+++ b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png
Binary files 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
--- /dev/null
+++ b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png
Binary files differ
diff --git a/games/devtest/mods/testpathfinder/init.lua b/games/devtest/mods/testpathfinder/init.lua
index f94848236..67748afca 100644
--- a/games/devtest/mods/testpathfinder/init.lua
+++ b/games/devtest/mods/testpathfinder/init.lua
@@ -121,7 +121,11 @@ end
-- Sneak+punch: Select pathfinding algorithm
-- Place: Select destination node
minetest.register_tool("testpathfinder:testpathfinder", {
- description = S("Pathfinder Tester"),
+ description = S("Pathfinder Tester") .."\n"..
+ S("Finds path between 2 points") .."\n"..
+ S("Place on node: Select destination") .."\n"..
+ S("Punch: Find path from here") .."\n"..
+ S("Sneak+Punch: Change algorithm"),
inventory_image = "testpathfinder_testpathfinder.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = find_path_or_set_algorithm,
diff --git a/games/devtest/mods/testtools/init.lua b/games/devtest/mods/testtools/init.lua
index d68a086b9..d578b264a 100644
--- a/games/devtest/mods/testtools/init.lua
+++ b/games/devtest/mods/testtools/init.lua
@@ -1,15 +1,17 @@
local S = minetest.get_translator("testtools")
local F = minetest.formspec_escape
+dofile(minetest.get_modpath("testtools") .. "/light.lua")
+
-- TODO: Add a Node Metadata tool
--- Param 2 Tool: Set param2 value of tools
--- Punch: +1
--- Punch+Shift: +8
--- Place: -1
--- Place+Shift: -8
minetest.register_tool("testtools:param2tool", {
- description = S("Param2 Tool"),
+ description = S("Param2 Tool") .."\n"..
+ S("Modify param2 value of nodes") .."\n"..
+ S("Punch: +1") .."\n"..
+ S("Sneak+Punch: +8") .."\n"..
+ S("Place: -1") .."\n"..
+ S("Sneak+Place: -8"),
inventory_image = "testtools_param2tool.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
@@ -47,7 +49,11 @@ minetest.register_tool("testtools:param2tool", {
})
minetest.register_tool("testtools:node_setter", {
- description = S("Node Setter"),
+ description = S("Node Setter") .."\n"..
+ S("Replace pointed node with something else") .."\n"..
+ S("Punch: Select pointed node") .."\n"..
+ S("Place on node: Replace node with selected node") .."\n"..
+ S("Place in air: Manually select a node"),
inventory_image = "testtools_node_setter.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
@@ -125,7 +131,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end)
minetest.register_tool("testtools:remover", {
- description = S("Remover"),
+ description = S("Remover") .."\n"..
+ S("Punch: Remove pointed node or object"),
inventory_image = "testtools_remover.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
@@ -136,13 +143,17 @@ minetest.register_tool("testtools:remover", {
local obj = pointed_thing.ref
if not obj:is_player() then
obj:remove()
+ else
+ minetest.chat_send_player(user:get_player_name(), S("Can't remove players!"))
end
end
end,
})
minetest.register_tool("testtools:falling_node_tool", {
- description = S("Falling Node Tool"),
+ description = S("Falling Node Tool") .."\n"..
+ S("Punch: Make pointed node fall") .."\n"..
+ S("Place: Move pointed node 2 units upwards, then make it fall"),
inventory_image = "testtools_falling_node_tool.png",
groups = { testtool = 1, disable_repair = 1 },
on_place = function(itemstack, user, pointed_thing)
@@ -191,7 +202,11 @@ minetest.register_tool("testtools:falling_node_tool", {
})
minetest.register_tool("testtools:rotator", {
- description = S("Entity Rotator"),
+ description = S("Entity Rotator") .. "\n" ..
+ S("Rotate pointed entity") .."\n"..
+ S("Punch: Yaw") .."\n"..
+ S("Sneak+Punch: Pitch") .."\n"..
+ S("Aux1+Punch: Roll"),
inventory_image = "testtools_entity_rotator.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
@@ -244,7 +259,12 @@ local mover_config = function(itemstack, user, pointed_thing)
end
minetest.register_tool("testtools:object_mover", {
- description = S("Object Mover"),
+ description = S("Object Mover") .."\n"..
+ S("Move pointed object towards or away from you") .."\n"..
+ S("Punch: Move by distance").."\n"..
+ S("Sneak+Punch: Move by negative distance").."\n"..
+ S("Place: Increase distance").."\n"..
+ S("Sneak+Place: Decrease distance"),
inventory_image = "testtools_object_mover.png",
groups = { testtool = 1, disable_repair = 1 },
on_place = mover_config,
@@ -287,7 +307,10 @@ minetest.register_tool("testtools:object_mover", {
minetest.register_tool("testtools:entity_scaler", {
- description = S("Entity Visual Scaler"),
+ description = S("Entity Visual Scaler") .."\n"..
+ S("Scale visual size of entities") .."\n"..
+ S("Punch: Increase size") .."\n"..
+ S("Sneak+Punch: Decrease scale"),
inventory_image = "testtools_entity_scaler.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
@@ -342,14 +365,21 @@ local function get_entity_list()
return entity_list
end
minetest.register_tool("testtools:entity_spawner", {
- description = S("Entity Spawner"),
+ description = S("Entity Spawner") .."\n"..
+ S("Spawns entities") .."\n"..
+ S("Punch: Select entity to spawn") .."\n"..
+ S("Place: Spawn selected entity"),
inventory_image = "testtools_entity_spawner.png",
groups = { testtool = 1, disable_repair = 1 },
on_place = function(itemstack, user, pointed_thing)
local name = user:get_player_name()
- if selections[name] and pointed_thing.type == "node" then
- local pos = pointed_thing.above
- minetest.add_entity(pos, get_entity_list()[selections[name]])
+ if pointed_thing.type == "node" then
+ if selections[name] then
+ local pos = pointed_thing.above
+ minetest.add_entity(pos, get_entity_list()[selections[name]])
+ else
+ minetest.chat_send_player(name, S("Select an entity first (with punch key)!"))
+ end
end
end,
on_use = function(itemstack, user, pointed_thing)
@@ -435,7 +465,10 @@ local editor_formspec = function(playername, obj, value, sel)
end
minetest.register_tool("testtools:object_editor", {
- description = S("Object Property Editor"),
+ description = S("Object Property Editor") .."\n"..
+ S("Edit properties of objects") .."\n"..
+ S("Punch object: Edit object") .."\n"..
+ S("Punch air: Edit yourself"),
inventory_image = "testtools_object_editor.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
@@ -515,7 +548,14 @@ local attacher_config = function(itemstack, user, pointed_thing)
end
minetest.register_tool("testtools:object_attacher", {
- description = S("Object Attacher"),
+ description = S("Object Attacher") .."\n"..
+ S("Attach object to another") .."\n"..
+ S("Punch objects to first select parent object, then the child object to attach") .."\n"..
+ S("Punch air to select yourself") .."\n"..
+ S("Place: Incease attachment Y offset") .."\n"..
+ S("Sneak+Place: Decease attachment Y offset") .."\n"..
+ S("Aux1+Place: Incease attachment rotation") .."\n"..
+ S("Aux1+Sneak+Place: Decrease attachment rotation"),
inventory_image = "testtools_object_attacher.png",
groups = { testtool = 1, disable_repair = 1 },
on_place = attacher_config,
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
--- /dev/null
+++ b/games/devtest/mods/testtools/textures/testtools_lighttool.png
Binary files differ
diff --git a/games/devtest/mods/unittests/init.lua b/games/devtest/mods/unittests/init.lua
index 6c1728420..12c67f78b 100644
--- a/games/devtest/mods/unittests/init.lua
+++ b/games/devtest/mods/unittests/init.lua
@@ -5,10 +5,12 @@ dofile(modpath .. "/random.lua")
dofile(modpath .. "/player.lua")
dofile(modpath .. "/crafting_prepare.lua")
dofile(modpath .. "/crafting.lua")
+dofile(modpath .. "/itemdescription.lua")
if minetest.settings:get_bool("devtest_unittests_autostart", false) then
unittests.test_random()
unittests.test_crafting()
+ unittests.test_short_desc()
minetest.register_on_joinplayer(function(player)
unittests.test_player(player)
end)
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
diff --git a/games/devtest/mods/util_commands/init.lua b/games/devtest/mods/util_commands/init.lua
index 3a0e91a41..ca5dca2d9 100644
--- a/games/devtest/mods/util_commands/init.lua
+++ b/games/devtest/mods/util_commands/init.lua
@@ -36,8 +36,12 @@ minetest.register_chatcommand("hp", {
end,
})
-minetest.register_chatcommand("zoom", {
- params = "[<zoom_fov>]",
+minetest.register_on_joinplayer(function(player)
+ player:set_properties({zoom_fov = 15})
+end)
+
+minetest.register_chatcommand("zoomfov", {
+ params = "[<FOV>]",
description = "Set or display your zoom_fov",
func = function(name, param)
local player = minetest.get_player_by_name(name)
@@ -58,8 +62,6 @@ minetest.register_chatcommand("zoom", {
end,
})
-
-
local s_infplace = minetest.settings:get("devtest_infplace")
if s_infplace == "true" then
infplace = true
@@ -112,6 +114,62 @@ minetest.register_chatcommand("detach", {
end,
})
+-- Use this to test waypoint capabilities
+minetest.register_chatcommand("test_waypoints", {
+ params = "[change_immediate]",
+ description = "tests waypoint capabilities",
+ func = function(name, params)
+ local player = minetest.get_player_by_name(name)
+ local regular = player:hud_add {
+ hud_elem_type = "waypoint",
+ name = "regular waypoint",
+ text = "m",
+ number = 0xFF0000,
+ world_pos = vector.add(player:get_pos(), {x = 0, y = 1.5, z = 0})
+ }
+ local reduced_precision = player:hud_add {
+ hud_elem_type = "waypoint",
+ name = "better waypoint",
+ text = "m (0.5 steps, precision = 2)",
+ precision = 10,
+ number = 0xFFFF00,
+ world_pos = vector.add(player:get_pos(), {x = 0, y = 1, z = 0})
+ }
+ local function change()
+ if regular then
+ player:hud_change(regular, "world_pos", vector.add(player:get_pos(), {x = 0, y = 3, z = 0}))
+ end
+ if reduced_precision then
+ player:hud_change(reduced_precision, "precision", 2)
+ end
+ end
+ if params ~= "" then
+ -- change immediate
+ change()
+ else
+ minetest.after(0.5, change)
+ end
+ regular = regular or "error"
+ reduced_precision = reduced_precision or "error"
+ local hidden_distance = player:hud_add {
+ hud_elem_type = "waypoint",
+ name = "waypoint with hidden distance",
+ text = "this text is hidden as well (precision = 0)",
+ precision = 0,
+ number = 0x0000FF,
+ world_pos = vector.add(player:get_pos(), {x = 0, y = 0.5, z = 0})
+ } or "error"
+ local image_waypoint = player:hud_add {
+ hud_elem_type = "image_waypoint",
+ text = "wieldhand.png",
+ world_pos = player:get_pos(),
+ scale = {x = 10, y = 10},
+ offset = {x = 0, y = -32}
+ } or "error"
+ minetest.chat_send_player(name, "Waypoint IDs: regular: " .. regular .. ", reduced precision: " .. reduced_precision ..
+ ", hidden distance: " .. hidden_distance .. ", image waypoint: " .. image_waypoint)
+ end
+})
-- Unlimited node placement
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)