mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-27 11:47:32 +01:00
Improve error reporting of /spawnstruct
This commit is contained in:
parent
8e77c897e6
commit
7c85b380b9
@ -262,17 +262,22 @@ minetest.register_chatcommand("spawnstruct", {
|
|||||||
if not pos then
|
if not pos then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if param == "" or param == "help" then
|
local errord = false
|
||||||
minetest.chat_send_player(name, "Please use “/spawnstruct <type>”.")
|
|
||||||
minetest.chat_send_player(name, "Avaiable types: desert_temple, village")
|
|
||||||
end
|
|
||||||
if param == "village" then
|
if param == "village" then
|
||||||
random_struct.generate_village(pos)
|
random_struct.generate_village(pos)
|
||||||
minetest.chat_send_player(name, "Village created.")
|
minetest.chat_send_player(name, "Village created.")
|
||||||
end
|
elseif param == "desert_temple" then
|
||||||
if param == "desert_temple" then
|
|
||||||
random_struct.generate_desert_temple(pos)
|
random_struct.generate_desert_temple(pos)
|
||||||
minetest.chat_send_player(name, "Desert temple created.")
|
minetest.chat_send_player(name, "Desert temple created.")
|
||||||
|
elseif param == "" then
|
||||||
|
minetest.chat_send_player(name, "Error: No structure type given. Please use “/spawnstruct <type>”.")
|
||||||
|
errord = true
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(name, "Error: Unknown structure type. Please use “/spawnstruct <type>”.")
|
||||||
|
errord = true
|
||||||
|
end
|
||||||
|
if errord then
|
||||||
|
minetest.chat_send_player(name, "Avaiable types: desert_temple, village")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user