From 93cbabc61ea54ffa1130b0e00b46712f3c698019 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Feb 2017 02:53:32 +0100 Subject: [PATCH] Set Minecraft sleeping times for bed --- mods/ITEMS/beds/functions.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/beds/functions.lua b/mods/ITEMS/beds/functions.lua index 7598ed7d8..ff315ff7b 100644 --- a/mods/ITEMS/beds/functions.lua +++ b/mods/ITEMS/beds/functions.lua @@ -129,15 +129,16 @@ function beds.kick_players() end function beds.skip_night() - minetest.set_timeofday(0.23) + minetest.set_timeofday(0.25) -- tod = 6000 end function beds.on_rightclick(pos, player) local name = player:get_player_name() local ppos = player:getpos() - local tod = minetest.get_timeofday() + local tod = minetest.get_timeofday() * 24000 - if tod > 0.2 and tod < 0.805 then + -- Values taken from Minecraft Wiki with offset of +6000 + if tod < 18541 and tod > 5458 then if beds.player[name] then lay_down(player, nil, nil, false) end