Add command to generate Nether portal (“/spawnstruct nether_portal”)

This commit is contained in:
Nils Dagsson Moskopp 2021-05-13 15:08:44 +02:00
parent 56a8736149
commit ed1849ed81
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
1 changed files with 3 additions and 1 deletions

View File

@ -534,7 +534,7 @@ 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",
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_portal_shrine | nether_portal",
description = S("Generate a pre-defined structure near your position."),
privs = {debug = true},
func = function(name, param)
@ -568,6 +568,8 @@ minetest.register_chatcommand("spawnstruct", {
mcl_structures.generate_end_exit_portal(pos, rot, pr)
elseif param == "end_portal_shrine" then
mcl_structures.generate_end_portal_shrine(pos, rot, pr)
elseif param == "nether_portal" and mcl_portals and mcl_portals.spawn_nether_portal then
mcl_portals.spawn_nether_portal(pos, rot, pr, name)
elseif param == "" then
message = S("Error: No structure type given. Please use “/spawnstruct <type>”.")
errord = true