Add option to disable bed respawn, better recipe for fancy bed
authorBlockMen <nmuelll@web.de>
Fri, 6 Mar 2015 09:46:05 +0000 (10:46 +0100)
committerBlockMen <nmuelll@web.de>
Fri, 6 Mar 2015 09:46:05 +0000 (10:46 +0100)
mods/beds/README.txt
mods/beds/beds.lua
mods/beds/functions.lua

index 20893b815194e0a23d8b49a023aee92ec825b71d..21d4433f382143da651e84996a1c753869958b45 100644 (file)
@@ -12,32 +12,16 @@ players are in bed too. If all players are sleeping the night gets skipped aswel
 if more than 50% of the players are lying in bed and use this option.
 
 Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point
-is set to the beds location. If dying you will respawn there.
+is set to the beds location and you will respawn there after death.
+You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf
 
 
 
-You can craft two types of beds:
-
-
-Simple shaped bed:
-
-wool wool wool
-wood wood wood
-
-Fancy shaped bed:
-
-wool wool stick
-wood wood wood
-
-Notice: You can use any color of wood or wool, mixing different is also possible.
-
-
 License of source code, textures: WTFPL
 ---------------------------------------
 (c) Copyright BlockMen (2014-2015)
 
 
-
 This program is free software. It comes without any warranty, to
 the extent permitted by applicable law. You can redistribute it
 and/or modify it under the terms of the Do What The Fuck You Want
index acff444c1f84f342bf3db7894be1cf19d82715fb..43bf98edfdae843a2eaa5bc37fbddfc2b5db2f27 100644 (file)
@@ -42,7 +42,8 @@ beds.register_bed("beds:fancy_bed", {
        },
        selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
        recipe = {
-               {"wool:red", "wool:white", "group:stick"},
+               {"", "", "group:stick"},
+               {"wool:red", "wool:red", "wool:white"},
                {"group:wood", "group:wood", "group:wood"},
        },
 })
index ea3d3af8f3ddb01b7e55a8213dd547d16b467ce6..87a930e20e5f381ddac39d96e20fd8939972fa32 100644 (file)
@@ -1,5 +1,6 @@
 local player_in_bed = 0
 local is_sp = minetest.is_singleplayer()
+local enable_respawn = minetest.setting_getbool("enable_bed_respawn") or true
 
 
 -- helper functions
@@ -166,7 +167,11 @@ minetest.register_on_joinplayer(function(player)
        beds.read_spawns()
 end)
 
+-- respawn player at bed if enabled and valid position is found
 minetest.register_on_respawnplayer(function(player)
+       if not enable_respawn then
+               return false
+       end
        local name = player:get_player_name()
        local pos = beds.spawn[name] or nil
        if pos then