diff --git a/mods/bed/init.lua b/mods/bed/init.lua index 66aacf9..14b87a6 100644 --- a/mods/bed/init.lua +++ b/mods/bed/init.lua @@ -350,7 +350,7 @@ minetest.register_node( local put_pos = vector.add(pos, vector.divide( minetest.facedir_to_dir(node.param2), 2)) - if clicker:get_player_name() == meta:get_string("player") then + if name == meta:get_string("player") then put_pos.y = put_pos.y - 0.5 bed.userdata[name].in_bed = false @@ -364,6 +364,12 @@ minetest.register_node( return end + -- No sleeping while moving + if vector.length(clicker:get_player_velocity()) > 0.001 then + minetest.chat_send_player(name, S("You have to stop moving before going to bed!")) + return false + end + put_pos.y = put_pos.y + 0.6 local yaw = 0 diff --git a/mods/bed/locale/bed.de.tr b/mods/bed/locale/bed.de.tr index 6ee33a8..360210e 100644 --- a/mods/bed/locale/bed.de.tr +++ b/mods/bed/locale/bed.de.tr @@ -5,3 +5,4 @@ Craft a bed=Fertigen Sie ein Bett Players have slept, rise and shine!=Spieler haben geschlafen, Raus aus den Federn! In bed=Im Bett You're in a bed=Sie sind in einem Bett +You have to stop moving before going to bed!=Sie müssen stehen bleiben, bevor Sie zu Bett gehen! diff --git a/mods/bed/locale/template.txt b/mods/bed/locale/template.txt index d5e0a8a..7b6d1fb 100644 --- a/mods/bed/locale/template.txt +++ b/mods/bed/locale/template.txt @@ -5,3 +5,4 @@ Craft a bed= Players have slept, rise and shine!= In bed= You're in a bed= +You have to stop moving before going to bed!=