Add TNT test structure

This patch adds a new test structure to the “/spawnstruct” command which
can be spawned with this command: /spawnstruct test_structure_tnt

The structure was added to reduce manual work when examining or
verifying TNT explosion results after changes to TNT drop rate.
This commit is contained in:
Nils Dagsson Moskopp 2022-04-17 17:20:45 +02:00
parent d2c335d8fb
commit 32d89d6d5f
Signed by untrusted user who does not match committer: erlehmann
GPG Key ID: A3BC671C35191080
2 changed files with 8 additions and 1 deletions

View File

@ -542,9 +542,14 @@ mcl_structures.generate_test_structure_fireproof = function(pos, rotation, pr)
mcl_structures.place_schematic(pos, path, rotation, nil, true, nil, nil, pr)
end
mcl_structures.generate_test_structure_tnt = function(pos, rotation, pr)
local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_test_structure_tnt.mts"
mcl_structures.place_schematic(pos, path, rotation, nil, true, nil, nil, pr)
end
-- Debug command
minetest.register_chatcommand("spawnstruct", {
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_portal_shrine | test_structure_comparator | test_structure_fireproof",
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_portal_shrine | test_structure_comparator | test_structure_fireproof | test_structure_tnt",
description = S("Generate a pre-defined structure near your position."),
privs = {debug = true},
func = function(name, param)
@ -582,6 +587,8 @@ minetest.register_chatcommand("spawnstruct", {
mcl_structures.generate_test_structure_comparator(pos, rot, pr)
elseif param == "test_structure_fireproof" then
mcl_structures.generate_test_structure_fireproof(pos, rot, pr)
elseif param == "test_structure_tnt" then
mcl_structures.generate_test_structure_tnt(pos, rot, pr)
elseif param == "" then
message = S("Error: No structure type given. Please use “/spawnstruct <type>”.")
errord = true