mirror of
https://github.com/minetest/minetest.git
synced 2024-11-24 00:23:46 +01:00
92b45b2a18
* client side mods are located in clientmods/ * move builtin/preview.lua to clientmods/preview/init.lua as a preview mod * refactor ModConfiguration class to work properly with client and server using child objects * move some Server constructor mod load code to ModConfiguration to reduce code duplication between client and server * remove mods.{cpp,h} unused functions * use UNORDERED_SET instead of std::set in some modspec storages
23 lines
774 B
Lua
23 lines
774 B
Lua
-- Minetest: builtin/client/init.lua
|
|
local scriptpath = core.get_builtin_path()..DIR_DELIM
|
|
local clientpath = scriptpath.."client"..DIR_DELIM
|
|
local commonpath = scriptpath.."common"..DIR_DELIM
|
|
|
|
dofile(clientpath .. "register.lua")
|
|
dofile(commonpath .. "after.lua")
|
|
dofile(commonpath .. "chatcommands.lua")
|
|
dofile(clientpath .. "chatcommands.lua")
|
|
|
|
core.register_on_death(function()
|
|
core.display_chat_message("You died.")
|
|
local formspec = "size[11,5.5]bgcolor[#320000b4;true]" ..
|
|
"label[4.85,1.35;" .. fgettext("You died.") .. "]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]"
|
|
core.show_formspec("bultin:death", formspec)
|
|
end)
|
|
|
|
core.register_on_formspec_input(function(formname, fields)
|
|
if formname == "bultin:death" then
|
|
core.send_respawn()
|
|
end
|
|
end)
|