mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Improve error reporting of /spawnstruct
This commit is contained in:
parent
8e77c897e6
commit
7c85b380b9
1 changed files with 11 additions and 6 deletions
|
@ -262,17 +262,22 @@ minetest.register_chatcommand("spawnstruct", {
|
|||
if not pos then
|
||||
return
|
||||
end
|
||||
if param == "" or param == "help" then
|
||||
minetest.chat_send_player(name, "Please use “/spawnstruct <type>”.")
|
||||
minetest.chat_send_player(name, "Avaiable types: desert_temple, village")
|
||||
end
|
||||
local errord = false
|
||||
if param == "village" then
|
||||
random_struct.generate_village(pos)
|
||||
minetest.chat_send_player(name, "Village created.")
|
||||
end
|
||||
if param == "desert_temple" then
|
||||
elseif param == "desert_temple" then
|
||||
random_struct.generate_desert_temple(pos)
|
||||
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
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue