aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
Diffstat (limited to 'games')
-rw-r--r--games/devtest/README.md3
-rw-r--r--games/devtest/mods/basenodes/init.lua63
-rw-r--r--games/devtest/mods/basenodes/textures/default_dirt.pngbin790 -> 7303 bytes
-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/info.txt7
-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.lua19
-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.lua18
-rw-r--r--games/devtest/mods/testentities/armor.lua2
-rw-r--r--games/devtest/mods/testentities/callbacks.lua3
-rw-r--r--games/devtest/mods/testentities/visuals.lua57
-rw-r--r--games/devtest/mods/testfood/init.lua7
-rw-r--r--games/devtest/mods/testfood/textures/testfood_replace.pngbin0 -> 135 bytes
-rw-r--r--games/devtest/mods/testformspec/LICENSE.txt14
-rw-r--r--games/devtest/mods/testformspec/formspec.lua42
-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.lua141
-rw-r--r--games/devtest/mods/testnodes/light.lua6
-rw-r--r--games/devtest/mods/testnodes/liquids.lua16
-rw-r--r--games/devtest/mods/testnodes/mod.conf1
-rw-r--r--games/devtest/mods/testnodes/nodeboxes.lua9
-rw-r--r--games/devtest/mods/testnodes/properties.lua6
-rw-r--r--games/devtest/mods/testnodes/textures.lua18
-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.lua51
-rw-r--r--games/devtest/mods/unittests/mod.conf1
-rw-r--r--games/devtest/mods/unittests/textures/default_dirt.pngbin0 -> 790 bytes
-rw-r--r--games/devtest/mods/util_commands/init.lua66
43 files changed, 686 insertions, 196 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..2c808c35e 100644
--- a/games/devtest/mods/basenodes/init.lua
+++ b/games/devtest/mods/basenodes/init.lua
@@ -1,4 +1,4 @@
-local WATER_ALPHA = 160
+local WATER_ALPHA = "^[opacity:" .. 160
local WATER_VISC = 1
local LAVA_VISC = 7
@@ -124,14 +124,16 @@ minetest.register_node("basenodes:pine_needles", {
})
minetest.register_node("basenodes:water_source", {
- description = "Water Source",
+ description = "Water Source".."\n"..
+ "Drowning damage: 1",
drawtype = "liquid",
- tiles = {"default_water.png"},
+ waving = 3,
+ tiles = {"default_water.png"..WATER_ALPHA},
special_tiles = {
- {name = "default_water.png", backface_culling = false},
- {name = "default_water.png", backface_culling = true},
+ {name = "default_water.png"..WATER_ALPHA, backface_culling = false},
+ {name = "default_water.png"..WATER_ALPHA, backface_culling = true},
},
- alpha = WATER_ALPHA,
+ use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = false,
@@ -148,14 +150,18 @@ 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},
- {name = "default_water_flowing.png", backface_culling = false},
+ {name = "default_water_flowing.png"..WATER_ALPHA,
+ backface_culling = false},
+ {name = "default_water_flowing.png"..WATER_ALPHA,
+ backface_culling = false},
},
- alpha = WATER_ALPHA,
+ use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
@@ -173,14 +179,16 @@ 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",
- tiles = { "default_river_water.png" },
+ waving = 3,
+ tiles = { "default_river_water.png"..WATER_ALPHA },
special_tiles = {
- {name = "default_river_water.png", backface_culling = false},
- {name = "default_river_water.png", backface_culling = true},
+ {name = "default_river_water.png"..WATER_ALPHA, backface_culling = false},
+ {name = "default_river_water.png"..WATER_ALPHA, backface_culling = true},
},
- alpha = WATER_ALPHA,
+ use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = false,
@@ -199,14 +207,18 @@ 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",
- tiles = {"default_river_water_flowing.png"},
+ waving = 3,
+ tiles = {"default_river_water_flowing.png"..WATER_ALPHA},
special_tiles = {
- {name = "default_river_water_flowing.png", backface_culling = false},
- {name = "default_river_water_flowing.png", backface_culling = false},
+ {name = "default_river_water_flowing.png"..WATER_ALPHA,
+ backface_culling = false},
+ {name = "default_river_water_flowing.png"..WATER_ALPHA,
+ backface_culling = false},
},
- alpha = WATER_ALPHA,
+ use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
@@ -226,7 +238,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 +265,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 +306,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/default_dirt.png b/games/devtest/mods/basenodes/textures/default_dirt.png
index 58670305d..aa75bffb6 100644
--- a/games/devtest/mods/basenodes/textures/default_dirt.png
+++ b/games/devtest/mods/basenodes/textures/default_dirt.png
Binary files differ
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/info.txt b/games/devtest/mods/basenodes/textures/info.txt
new file mode 100644
index 000000000..2d4ef7efa
--- /dev/null
+++ b/games/devtest/mods/basenodes/textures/info.txt
@@ -0,0 +1,7 @@
+
+The dirt_with_grass folder is for testing loading textures from subfolders.
+If it works correctly, the default_grass_side.png file in the folder is used but
+default_grass.png is not overwritten by the file in the folder.
+
+default_dirt.png should be overwritten by the default_dirt.png in the unittests
+mod which depends on basenodes.
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..5798c13e7 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"},
@@ -22,6 +23,18 @@ minetest.register_node("chest:chest", {
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
+ allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "Allow put: " .. stack:to_string())
+ return stack:get_count()
+ end,
+ allow_metadata_inventory_take = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "Allow take: " .. stack:to_string())
+ return stack:get_count()
+ end,
+ on_metadata_inventory_put = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "On put: " .. stack:to_string())
+ end,
+ on_metadata_inventory_take = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "On take: " .. stack:to_string())
+ end,
})
-
-
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..b263a3f35 100644
--- a/games/devtest/mods/soundstuff/init.lua
+++ b/games/devtest/mods/soundstuff/init.lua
@@ -60,11 +60,13 @@ minetest.register_node("soundstuff:footstep_liquid", {
description = "Liquid Footstep Sound Node",
drawtype = "liquid",
tiles = {
- "soundstuff_node_sound.png^[colorize:#0000FF:127",
+ "soundstuff_node_sound.png^[colorize:#0000FF:127^[opacity:190",
},
special_tiles = {
- {name = "soundstuff_node_sound.png^[colorize:#0000FF:127", backface_culling = false},
- {name = "soundstuff_node_sound.png^[colorize:#0000FF:127", backface_culling = true},
+ {name = "soundstuff_node_sound.png^[colorize:#0000FF:127^[opacity:190",
+ backface_culling = false},
+ {name = "soundstuff_node_sound.png^[colorize:#0000FF:127^[opacity:190",
+ backface_culling = true},
},
liquids_pointable = true,
liquidtype = "source",
@@ -73,7 +75,7 @@ minetest.register_node("soundstuff:footstep_liquid", {
liquid_renewable = false,
liquid_range = 0,
liquid_viscosity = 0,
- alpha = 190,
+ use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = false,
@@ -92,7 +94,6 @@ minetest.register_node("soundstuff:footstep_climbable", {
tiles = {
"soundstuff_node_climbable.png",
},
- alpha = 120,
paramtype = "light",
sunlight_propagates = true,
walkable = false,
@@ -107,7 +108,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 +118,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/callbacks.lua b/games/devtest/mods/testentities/callbacks.lua
index 711079f87..320690b39 100644
--- a/games/devtest/mods/testentities/callbacks.lua
+++ b/games/devtest/mods/testentities/callbacks.lua
@@ -31,6 +31,9 @@ minetest.register_entity("testentities:callback", {
on_activate = function(self, staticdata, dtime_s)
message("Callback entity: on_activate! pos="..spos(self).."; dtime_s="..dtime_s)
end,
+ on_deactivate = function(self)
+ message("Callback entity: on_deactivate! pos="..spos(self))
+ end,
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)
local name = get_object_name(puncher)
message(
diff --git a/games/devtest/mods/testentities/visuals.lua b/games/devtest/mods/testentities/visuals.lua
index 83f361f16..e382ec44c 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,59 @@ 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,
+})
+
+minetest.register_entity("testentities:nametag", {
+ initial_properties = {
+ visual = "sprite",
+ textures = { "testentities_sprite.png" },
+ },
+
+ on_activate = function(self, staticdata)
+ if staticdata ~= "" then
+ local data = minetest.deserialize(staticdata)
+ self.color = data.color
+ self.bgcolor = data.bgcolor
+ else
+ self.color = {
+ r = math.random(0, 255),
+ g = math.random(0, 255),
+ b = math.random(0, 255),
+ }
+
+ if math.random(0, 10) > 5 then
+ self.bgcolor = {
+ r = math.random(0, 255),
+ g = math.random(0, 255),
+ b = math.random(0, 255),
+ a = math.random(0, 255),
+ }
+ end
+ end
+
+ assert(self.color)
+ self.object:set_properties({
+ nametag = tostring(math.random(1000, 10000)),
+ nametag_color = self.color,
+ nametag_bgcolor = self.bgcolor,
+ })
+ end,
+
+ get_staticdata = function(self)
+ return minetest.serialize({ color = self.color, bgcolor = self.bgcolor })
end,
})
diff --git a/games/devtest/mods/testfood/init.lua b/games/devtest/mods/testfood/init.lua
index a6236ff68..39b121306 100644
--- a/games/devtest/mods/testfood/init.lua
+++ b/games/devtest/mods/testfood/init.lua
@@ -22,3 +22,10 @@ minetest.register_craftitem("testfood:bad5", {
on_use = minetest.item_eat(-5),
})
+minetest.register_craftitem("testfood:replace1", {
+ description = S("Replacing Food (+1)").."\n"..
+ S("Replaced with 'Good Food (+1)' when eaten"),
+ inventory_image = "testfood_replace.png",
+ on_use = minetest.item_eat(1, "testfood:good1"),
+})
+
diff --git a/games/devtest/mods/testfood/textures/testfood_replace.png b/games/devtest/mods/testfood/textures/testfood_replace.png
new file mode 100644
index 000000000..1ef6876e5
--- /dev/null
+++ b/games/devtest/mods/testfood/textures/testfood_replace.png
Binary files differ
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..2a2bdad60 100644
--- a/games/devtest/mods/testformspec/formspec.lua
+++ b/games/devtest/mods/testformspec/formspec.lua
@@ -33,6 +33,34 @@ local tabheaders_fs = [[
tabheader[8,6;10,1.5;tabs_size2;Height=1.5;1;false;false]
]]
+local inv_style_fs = [[
+ style_type[list;noclip=true]
+ list[current_player;main;-0.75,0.75;2,2]
+
+ real_coordinates[false]
+ list[current_player;main;1.5,0;3,2]
+ real_coordinates[true]
+
+ real_coordinates[false]
+ style_type[list;size=1.1;spacing=0.1]
+ list[current_player;main;5,0;3,2]
+ real_coordinates[true]
+
+ style_type[list;size=.001;spacing=0]
+ list[current_player;main;7,3.5;8,4]
+
+ box[3,3.5;1,1;#000000]
+ box[5,3.5;1,1;#000000]
+ box[4,4.5;1,1;#000000]
+ box[3,5.5;1,1;#000000]
+ box[5,5.5;1,1;#000000]
+ style_type[list;spacing=.25,.125;size=.75,.875]
+ list[current_player;main;3,3.5;3,3]
+
+ style_type[list;spacing=0;size=1.1]
+ list[current_player;main;.5,7;8,4]
+]]
+
local hypertext_basic = [[
<bigger>Normal test</bigger>
This is a normal text.
@@ -164,7 +192,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]
@@ -199,6 +227,7 @@ local scroll_fs =
"box[1,1;8,6;#00aa]"..
"scroll_container[1,1;8,6;scrbar;vertical]"..
"button[0,1;1,1;lorem;Lorem]"..
+ "animated_image[0,1;4.5,1;clip_animated_image;testformspec_animation.png;4;100]" ..
"button[0,10;1,1;ipsum;Ipsum]"..
"pwdfield[2,2;1,1;lorem2;Lorem]"..
"list[current_player;main;4,4;1,5;]"..
@@ -211,6 +240,8 @@ local scroll_fs =
"tooltip[0,11;3,2;Buz;#f00;#000]"..
"box[0,11;3,2;#00ff00]"..
"hypertext[3,13;3,3;;" .. hypertext_basic .. "]" ..
+ "hypertext[3,17;3,3;;Hypertext with no scrollbar\\; the scroll container should scroll.]" ..
+ "textarea[3,21;3,1;textarea;;More scroll within scroll]" ..
"container[0,18]"..
"box[1,2;3,2;#0a0a]"..
"scroll_container[1,2;3,2;scrbar2;horizontal;0.06]"..
@@ -310,6 +341,9 @@ local pages = {
"size[12,13]real_coordinates[true]" ..
"container[0.5,1.5]" .. tabheaders_fs .. "container_end[]",
+ -- Inv
+ "size[12,13]real_coordinates[true]" .. inv_style_fs,
+
-- Animation
[[
formspec_version[3]
@@ -327,6 +361,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
@@ -337,7 +375,7 @@ Number]
local function show_test_formspec(pname, page_id)
page_id = page_id or 2
- local fs = pages[page_id] .. "tabheader[0,0;8,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Anim,ScrollC;" .. page_id .. ";false;false]"
+ local fs = pages[page_id] .. "tabheader[0,0;8,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Invs,Anim,ScrollC;" .. page_id .. ";false;false]"
minetest.show_formspec(pname, "testformspec:formspec", fs)
end
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..ff970144d 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",
@@ -331,68 +350,72 @@ minetest.register_node("testnodes:plantlike_rooted_degrotate", {
})
-- Demonstrative liquid nodes, source and flowing form.
-minetest.register_node("testnodes:liquid", {
- description = S("Source Liquid Drawtype Test Node"),
- drawtype = "liquid",
- paramtype = "light",
- tiles = {
- "testnodes_liquidsource.png",
- },
- special_tiles = {
- {name="testnodes_liquidsource.png", backface_culling=false},
- {name="testnodes_liquidsource.png", backface_culling=true},
- },
- use_texture_alpha = true,
-
-
- walkable = false,
- liquidtype = "source",
- liquid_range = 1,
- liquid_viscosity = 0,
- liquid_alternative_flowing = "testnodes:liquid_flowing",
- liquid_alternative_source = "testnodes:liquid",
- groups = { dig_immediate = 3 },
-})
-minetest.register_node("testnodes:liquid_flowing", {
- description = S("Flowing Liquid Drawtype Test Node"),
- drawtype = "flowingliquid",
- paramtype = "light",
- paramtype2 = "flowingliquid",
- tiles = {
- "testnodes_liquidflowing.png",
- },
- special_tiles = {
- {name="testnodes_liquidflowing.png", backface_culling=false},
- {name="testnodes_liquidflowing.png", backface_culling=false},
- },
- use_texture_alpha = true,
+-- DRAWTYPE ONLY, NO LIQUID PHYSICS!
+-- Liquid ranges 0 to 8
+for r = 0, 8 do
+ minetest.register_node("testnodes:liquid_"..r, {
+ description = S("Source Liquid Drawtype Test Node, Range @1", r),
+ drawtype = "liquid",
+ paramtype = "light",
+ tiles = {
+ "testnodes_liquidsource_r"..r..".png^[colorize:#FFFFFF:100",
+ },
+ special_tiles = {
+ {name="testnodes_liquidsource_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=false},
+ {name="testnodes_liquidsource_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=true},
+ },
+ use_texture_alpha = "blend",
+
+
+ walkable = false,
+ liquid_range = r,
+ liquid_viscosity = 0,
+ liquid_alternative_flowing = "testnodes:liquid_flowing_"..r,
+ liquid_alternative_source = "testnodes:liquid_"..r,
+ groups = { dig_immediate = 3 },
+ })
+ minetest.register_node("testnodes:liquid_flowing_"..r, {
+ description = S("Flowing Liquid Drawtype Test Node, Range @1", r),
+ drawtype = "flowingliquid",
+ paramtype = "light",
+ paramtype2 = "flowingliquid",
+ tiles = {
+ "testnodes_liquidflowing_r"..r..".png^[colorize:#FFFFFF:100",
+ },
+ special_tiles = {
+ {name="testnodes_liquidflowing_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=false},
+ {name="testnodes_liquidflowing_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=false},
+ },
+ use_texture_alpha = "blend",
+
+
+ walkable = false,
+ liquid_range = r,
+ liquid_viscosity = 0,
+ liquid_alternative_flowing = "testnodes:liquid_flowing_"..r,
+ liquid_alternative_source = "testnodes:liquid_"..r,
+ groups = { dig_immediate = 3 },
+ })
+end
- walkable = false,
- liquidtype = "flowing",
- liquid_range = 1,
- liquid_viscosity = 0,
- liquid_alternative_flowing = "testnodes:liquid_flowing",
- liquid_alternative_source = "testnodes:liquid",
- groups = { dig_immediate = 3 },
-})
+-- Waving liquid test (drawtype only)
minetest.register_node("testnodes:liquid_waving", {
description = S("Waving Source Liquid Drawtype Test Node"),
drawtype = "liquid",
paramtype = "light",
tiles = {
- "testnodes_liquidsource.png^[brighten",
+ "testnodes_liquidsource.png^[colorize:#0000FF:127",
},
special_tiles = {
- {name="testnodes_liquidsource.png^[brighten", backface_culling=false},
- {name="testnodes_liquidsource.png^[brighten", backface_culling=true},
+ {name="testnodes_liquidsource.png^[colorize:#0000FF:127", backface_culling=false},
+ {name="testnodes_liquidsource.png^[colorize:#0000FF:127", backface_culling=true},
},
- use_texture_alpha = true,
+ use_texture_alpha = "blend",
waving = 3,
walkable = false,
- liquidtype = "source",
liquid_range = 1,
liquid_viscosity = 0,
liquid_alternative_flowing = "testnodes:liquid_flowing_waving",
@@ -405,18 +428,17 @@ minetest.register_node("testnodes:liquid_flowing_waving", {
paramtype = "light",
paramtype2 = "flowingliquid",
tiles = {
- "testnodes_liquidflowing.png^[brighten",
+ "testnodes_liquidflowing.png^[colorize:#0000FF:127",
},
special_tiles = {
- {name="testnodes_liquidflowing.png^[brighten", backface_culling=false},
- {name="testnodes_liquidflowing.png^[brighten", backface_culling=false},
+ {name="testnodes_liquidflowing.png^[colorize:#0000FF:127", backface_culling=false},
+ {name="testnodes_liquidflowing.png^[colorize:#0000FF:127", backface_culling=false},
},
- use_texture_alpha = true,
+ use_texture_alpha = "blend",
waving = 3,
walkable = false,
- liquidtype = "flowing",
liquid_range = 1,
liquid_viscosity = 0,
liquid_alternative_flowing = "testnodes:liquid_flowing_waving",
@@ -424,8 +446,6 @@ minetest.register_node("testnodes:liquid_flowing_waving", {
groups = { dig_immediate = 3 },
})
-
-
-- Invisible node
minetest.register_node("testnodes:airlike", {
description = S("Airlike Drawtype Test Node"),
@@ -514,10 +534,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/liquids.lua b/games/devtest/mods/testnodes/liquids.lua
index e316782ad..3d2ea17f5 100644
--- a/games/devtest/mods/testnodes/liquids.lua
+++ b/games/devtest/mods/testnodes/liquids.lua
@@ -9,11 +9,9 @@ for d=0, 8 do
{name = "testnodes_liquidsource_r"..d..".png", backface_culling = false},
{name = "testnodes_liquidsource_r"..d..".png", backface_culling = true},
},
- alpha = 192,
+ use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
- pointable = false,
- diggable = false,
buildable_to = true,
is_ground_content = false,
liquidtype = "source",
@@ -30,12 +28,10 @@ for d=0, 8 do
{name = "testnodes_liquidflowing_r"..d..".png", backface_culling = false},
{name = "testnodes_liquidflowing_r"..d..".png", backface_culling = false},
},
- alpha = 192,
+ use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
- pointable = false,
- diggable = false,
buildable_to = true,
is_ground_content = false,
liquidtype = "flowing",
@@ -53,11 +49,9 @@ for d=0, 8 do
{name = "testnodes_liquidsource_r"..d..".png"..mod, backface_culling = false},
{name = "testnodes_liquidsource_r"..d..".png"..mod, backface_culling = true},
},
- alpha = 192,
+ use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
- pointable = false,
- diggable = false,
buildable_to = true,
is_ground_content = false,
liquidtype = "source",
@@ -74,12 +68,10 @@ for d=0, 8 do
{name = "testnodes_liquidflowing_r"..d..".png"..mod, backface_culling = false},
{name = "testnodes_liquidflowing_r"..d..".png"..mod, backface_culling = false},
},
- alpha = 192,
+ use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
- pointable = false,
- diggable = false,
buildable_to = true,
is_ground_content = false,
liquidtype = "flowing",
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/nodeboxes.lua b/games/devtest/mods/testnodes/nodeboxes.lua
index ebd858337..7e966fdce 100644
--- a/games/devtest/mods/testnodes/nodeboxes.lua
+++ b/games/devtest/mods/testnodes/nodeboxes.lua
@@ -18,7 +18,7 @@ minetest.register_node("testnodes:nodebox_fixed", {
-- 50% higher than a regular node
minetest.register_node("testnodes:nodebox_overhigh", {
- description = S("Overhigh Nodebox Test Node"),
+ description = S("+50% high Nodebox Test Node"),
tiles = {"testnodes_nodebox.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -30,15 +30,16 @@ minetest.register_node("testnodes:nodebox_overhigh", {
groups = {dig_immediate=3},
})
--- 100% higher than a regular node
+-- 95% higher than a regular node
minetest.register_node("testnodes:nodebox_overhigh2", {
- description = S("Double-height Nodebox Test Node"),
+ description = S("+95% high Nodebox Test Node"),
tiles = {"testnodes_nodebox.png"},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
+ -- Y max: more is possible, but glitchy
+ fixed = {-0.5, -0.5, -0.5, 0.5, 1.45, 0.5},
},
groups = {dig_immediate=3},
diff --git a/games/devtest/mods/testnodes/properties.lua b/games/devtest/mods/testnodes/properties.lua
index 01846a5f0..a52cd1d6f 100644
--- a/games/devtest/mods/testnodes/properties.lua
+++ b/games/devtest/mods/testnodes/properties.lua
@@ -114,11 +114,10 @@ minetest.register_node("testnodes:liquid_nojump", {
{name = "testnodes_liquidsource.png^[colorize:#FF0000:127", backface_culling = false},
{name = "testnodes_liquidsource.png^[colorize:#FF0000:127", backface_culling = true},
},
- use_texture_alpha = true,
+ use_texture_alpha = "blend",
paramtype = "light",
pointable = false,
liquids_pointable = true,
- diggable = false,
buildable_to = true,
is_ground_content = false,
post_effect_color = {a = 70, r = 255, g = 0, b = 200},
@@ -143,12 +142,11 @@ minetest.register_node("testnodes:liquidflowing_nojump", {
{name = "testnodes_liquidflowing.png^[colorize:#FF0000:127", backface_culling = false},
{name = "testnodes_liquidflowing.png^[colorize:#FF0000:127", backface_culling = false},
},
- use_texture_alpha = true,
+ use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
pointable = false,
liquids_pointable = true,
- diggable = false,
buildable_to = true,
is_ground_content = false,
post_effect_color = {a = 70, r = 255, g = 0, b = 200},
diff --git a/games/devtest/mods/testnodes/textures.lua b/games/devtest/mods/testnodes/textures.lua
index 6ffef8fe9..f6e6a0c2a 100644
--- a/games/devtest/mods/testnodes/textures.lua
+++ b/games/devtest/mods/testnodes/textures.lua
@@ -46,28 +46,22 @@ for a=1,#alphas do
tiles = {
"testnodes_alpha"..alpha..".png",
},
- use_texture_alpha = true,
+ use_texture_alpha = "blend",
groups = { dig_immediate = 3 },
})
- -- Transparency set via "alpha" parameter
+ -- Transparency set via texture modifier
minetest.register_node("testnodes:alpha_"..alpha, {
description = S("Alpha Test Node (@1)", alpha),
- -- It seems that only the liquid drawtype supports the alpha parameter
- drawtype = "liquid",
+ drawtype = "glasslike",
paramtype = "light",
tiles = {
- "testnodes_alpha.png",
+ "testnodes_alpha.png^[opacity:" .. alpha,
},
- alpha = alpha,
-
+ use_texture_alpha = "blend",
- liquidtype = "source",
- liquid_range = 0,
- liquid_viscosity = 0,
- liquid_alternative_source = "testnodes:alpha_"..alpha,
- liquid_alternative_flowing = "testnodes:alpha_"..alpha,
groups = { dig_immediate = 3 },
})
end
+
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..d6ee6551a
--- /dev/null
+++ b/games/devtest/mods/unittests/itemdescription.lua
@@ -0,0 +1,51 @@
+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 function get_short_description(item)
+ return ItemStack(item):get_short_description()
+ end
+
+ local stack = ItemStack("unittests:colorful_pick")
+ assert(stack:get_short_description() == "Colorful Pickaxe")
+ assert(get_short_description("unittests:colorful_pick") == "Colorful Pickaxe")
+ assert(minetest.registered_items["unittests:colorful_pick"].short_description == nil)
+ 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() == "Hello World")
+ assert(stack:get_description() == "Hello World")
+ assert(get_short_description(stack) == "Hello World")
+ assert(get_short_description("unittests:colorful_pick") == "Colorful Pickaxe")
+
+ 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/unittests/mod.conf b/games/devtest/mods/unittests/mod.conf
index 0d5e3c959..fa94e01a6 100644
--- a/games/devtest/mods/unittests/mod.conf
+++ b/games/devtest/mods/unittests/mod.conf
@@ -1,2 +1,3 @@
name = unittests
description = Adds automated unit tests for the engine
+depends = basenodes
diff --git a/games/devtest/mods/unittests/textures/default_dirt.png b/games/devtest/mods/unittests/textures/default_dirt.png
new file mode 100644
index 000000000..58670305d
--- /dev/null
+++ b/games/devtest/mods/unittests/textures/default_dirt.png
Binary files differ
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)