upgrade beds,boats,bucket,carts,creative,doors,farming,fire,stairs,tnt,wool
* beds https://codeberg.org/minenux/minetest-mod-beds/commit/7b6fae96d5e273dad9a373e63eb958145c9bfbef
* boats https://codeberg.org/minenux/minetest-mod-boats/commit/3832de08f705d5d2e7b5a971760e5fad1653305f
* bucket https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5
* carts https://codeberg.org/minenux/minetest-mod-carts/commit/dcbca916cffdcec281f0129ef350db2686bda933
* creative https://codeberg.org/minenux/minetest-mod-creative/commit/ca09e773701f834fec7de18bf13598b3323778db
* doors https://codeberg.org/minenux/minetest-mod-doors/commit/a89ab0454deb4933b6e4971c57055c40b7938e5b
* farming https://codeberg.org/minenux/minetest-mod-farming/commit/10de84d12d24a87f3aa9abef73f87c6cebb2614c
* fire https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2
* stairs https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110
* tnt https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027
* wool https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a
2022-03-01 23:26:11 -04:00
|
|
|
local is_50 = nil
|
|
|
|
local is_53 = minetest.has_feature("object_step_has_moveresult")
|
|
|
|
local is_54 = minetest.has_feature("direct_velocity_on_players")
|
2015-02-24 11:59:15 +01:00
|
|
|
|
upgrade beds,boats,bucket,carts,creative,doors,farming,fire,stairs,tnt,wool
* beds https://codeberg.org/minenux/minetest-mod-beds/commit/7b6fae96d5e273dad9a373e63eb958145c9bfbef
* boats https://codeberg.org/minenux/minetest-mod-boats/commit/3832de08f705d5d2e7b5a971760e5fad1653305f
* bucket https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5
* carts https://codeberg.org/minenux/minetest-mod-carts/commit/dcbca916cffdcec281f0129ef350db2686bda933
* creative https://codeberg.org/minenux/minetest-mod-creative/commit/ca09e773701f834fec7de18bf13598b3323778db
* doors https://codeberg.org/minenux/minetest-mod-doors/commit/a89ab0454deb4933b6e4971c57055c40b7938e5b
* farming https://codeberg.org/minenux/minetest-mod-farming/commit/10de84d12d24a87f3aa9abef73f87c6cebb2614c
* fire https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2
* stairs https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110
* tnt https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027
* wool https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a
2022-03-01 23:26:11 -04:00
|
|
|
-- Load support for MT game translation.
|
|
|
|
local S
|
|
|
|
if minetest.get_translator ~= nil then
|
|
|
|
S = minetest.get_translator("beds") -- 5.x translation function
|
|
|
|
is_50 = true
|
|
|
|
else
|
|
|
|
if minetest.get_modpath("intllib") then
|
|
|
|
dofile(minetest.get_modpath("intllib") .. "/init.lua")
|
|
|
|
if intllib.make_gettext_pair then
|
|
|
|
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
|
|
|
|
else
|
|
|
|
gettext = intllib.Getter() -- old text file method
|
|
|
|
end
|
|
|
|
S = gettext
|
|
|
|
else -- boilerplate function for 0.4
|
|
|
|
S = function(str, ...)
|
|
|
|
local args = {...}
|
|
|
|
return str:gsub("@%d+", function(match)
|
|
|
|
return args[tonumber(match:sub(2))]
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
beds = {
|
|
|
|
player = {},
|
|
|
|
bed_position = {},
|
|
|
|
pos = {},
|
|
|
|
spawn = {},
|
|
|
|
get_translator = S,
|
|
|
|
formspec = "size[8,11;true]"
|
|
|
|
.. "no_prepend[]"
|
|
|
|
.. "bgcolor[#080808BB;true]"
|
|
|
|
.. "button_exit[2,10;4,0.75;leave;" .. minetest.formspec_escape(S("Leave Bed")) .. "]"
|
|
|
|
}
|
|
|
|
beds.is_50 = is_50
|
|
|
|
beds.is_53 = is_53
|
|
|
|
beds.is_54 = is_54
|
2015-02-24 11:59:15 +01:00
|
|
|
|
2024-04-18 16:44:29 -04:00
|
|
|
beds.day_interval = {
|
|
|
|
start = 0.2,
|
|
|
|
finish = 0.805,
|
|
|
|
}
|
|
|
|
|
2015-02-24 11:59:15 +01:00
|
|
|
local modpath = minetest.get_modpath("beds")
|
|
|
|
|
upgrade beds,boats,bucket,carts,creative,doors,farming,fire,stairs,tnt,wool
* beds https://codeberg.org/minenux/minetest-mod-beds/commit/7b6fae96d5e273dad9a373e63eb958145c9bfbef
* boats https://codeberg.org/minenux/minetest-mod-boats/commit/3832de08f705d5d2e7b5a971760e5fad1653305f
* bucket https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5
* carts https://codeberg.org/minenux/minetest-mod-carts/commit/dcbca916cffdcec281f0129ef350db2686bda933
* creative https://codeberg.org/minenux/minetest-mod-creative/commit/ca09e773701f834fec7de18bf13598b3323778db
* doors https://codeberg.org/minenux/minetest-mod-doors/commit/a89ab0454deb4933b6e4971c57055c40b7938e5b
* farming https://codeberg.org/minenux/minetest-mod-farming/commit/10de84d12d24a87f3aa9abef73f87c6cebb2614c
* fire https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2
* stairs https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110
* tnt https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027
* wool https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a
2022-03-01 23:26:11 -04:00
|
|
|
-- check for minetest 5.x/0.4 compatibility
|
|
|
|
function beds.is_creative(name)
|
|
|
|
if is_53 then
|
|
|
|
return minetest.is_creative_enabled(name)
|
|
|
|
else
|
|
|
|
return creative.is_enabled_for(name) or minetest.settings:get_bool("creative_mode")
|
|
|
|
end
|
|
|
|
end
|
2016-03-08 03:14:29 +00:00
|
|
|
-- Load files
|
|
|
|
|
|
|
|
dofile(modpath .. "/functions.lua")
|
|
|
|
dofile(modpath .. "/api.lua")
|
|
|
|
dofile(modpath .. "/beds.lua")
|
|
|
|
dofile(modpath .. "/spawns.lua")
|
upgrade beds,boats,bucket,carts,creative,doors,farming,fire,stairs,tnt,wool
* beds https://codeberg.org/minenux/minetest-mod-beds/commit/7b6fae96d5e273dad9a373e63eb958145c9bfbef
* boats https://codeberg.org/minenux/minetest-mod-boats/commit/3832de08f705d5d2e7b5a971760e5fad1653305f
* bucket https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5
* carts https://codeberg.org/minenux/minetest-mod-carts/commit/dcbca916cffdcec281f0129ef350db2686bda933
* creative https://codeberg.org/minenux/minetest-mod-creative/commit/ca09e773701f834fec7de18bf13598b3323778db
* doors https://codeberg.org/minenux/minetest-mod-doors/commit/a89ab0454deb4933b6e4971c57055c40b7938e5b
* farming https://codeberg.org/minenux/minetest-mod-farming/commit/10de84d12d24a87f3aa9abef73f87c6cebb2614c
* fire https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2
* stairs https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110
* tnt https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027
* wool https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a
2022-03-01 23:26:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
print("[MOD] Beds loaded")
|