add metal bed and update beds
|
@ -0,0 +1,3 @@
|
|||
default
|
||||
beds
|
||||
wool
|
|
@ -0,0 +1,57 @@
|
|||
-- Metal bed
|
||||
|
||||
beds.register_bed("bed_metal:bed", {
|
||||
description = ("Metal Bed"),
|
||||
inventory_image = "metal_bed_inv.png",
|
||||
wield_image = "metal_bed_inv.png",
|
||||
tiles = {
|
||||
bottom = {
|
||||
"metal_bed_top1.png",
|
||||
"metal_bed_under.png",
|
||||
"metal_bed_side1.png",
|
||||
"metal_bed_side1.png^[transformFX",
|
||||
"metal_bed_foot.png",
|
||||
"metal_bed_foot.png",
|
||||
},
|
||||
top = {
|
||||
"metal_bed_top2.png",
|
||||
"metal_bed_under.png",
|
||||
"metal_bed_side2.png",
|
||||
"metal_bed_side2.png^[transformFX",
|
||||
"metal_bed_head.png",
|
||||
"metal_bed_head.png",
|
||||
}
|
||||
},
|
||||
nodebox = {
|
||||
bottom = {
|
||||
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
|
||||
{0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
|
||||
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
|
||||
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
||||
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
||||
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
|
||||
},
|
||||
top = {
|
||||
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
|
||||
{0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
|
||||
{-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
|
||||
{-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5},
|
||||
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
||||
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
||||
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
|
||||
}
|
||||
},
|
||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||
groups = {cracky = 1, level = 2, bed = 1},
|
||||
recipe = {
|
||||
{"", "", "default:steel_ingot"},
|
||||
{"wool:white", "wool:white", "wool:white"},
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
},
|
||||
})
|
||||
minetest.override_item('bed_metal:bed_top', {
|
||||
groups = {cracky = 1, level = 2, bed = 1}
|
||||
})
|
||||
minetest.override_item('bed_metal:bed_bottom', {
|
||||
groups = {cracky = 1, level = 2, bed = 1}
|
||||
})
|
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.4 KiB |
|
@ -10,12 +10,16 @@ Various Minetest developers and contributors (MIT)
|
|||
Authors of media (textures)
|
||||
---------------------------
|
||||
BlockMen (CC BY-SA 3.0)
|
||||
All textures unless otherwise noted
|
||||
|
||||
This mod adds a bed to Minetest which allows to skip the night.
|
||||
To sleep, rightclick the bed. If playing in singleplayer mode the night gets skipped
|
||||
TumeniNodes (CC BY-SA 3.0)
|
||||
beds_bed_under.png
|
||||
|
||||
This mod adds a bed to Minetest which allows players to skip the night.
|
||||
To sleep, right click on the bed. If playing in singleplayer mode the night gets skipped
|
||||
immediately. If playing multiplayer you get shown how many other players are in bed too,
|
||||
if all players are sleeping the night gets skipped. The night skip can be forced if more
|
||||
than 50% of the players are lying in bed and use this option.
|
||||
than half of the players are lying in bed and use this option.
|
||||
|
||||
Another feature is a controlled respawning. If you have slept in bed (not just lying in
|
||||
it) your respawn point is set to the beds location and you will respawn there after
|
||||
|
|
|
@ -17,6 +17,8 @@ local function destruct_bed(pos, n)
|
|||
reverse = not reverse
|
||||
minetest.remove_node(other)
|
||||
minetest.check_for_falling(other)
|
||||
beds.remove_spawns_at(pos)
|
||||
beds.remove_spawns_at(other)
|
||||
else
|
||||
reverse = not reverse
|
||||
end
|
||||
|
@ -109,7 +111,7 @@ function beds.register_bed(name, def)
|
|||
return itemstack
|
||||
end,
|
||||
|
||||
on_rotate = function(pos, node, user, mode, new_param2)
|
||||
on_rotate = function(pos, node, user, _, new_param2)
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local p = vector.add(pos, dir)
|
||||
local node2 = minetest.get_node_or_nil(p)
|
||||
|
@ -121,7 +123,7 @@ function beds.register_bed(name, def)
|
|||
minetest.record_protection_violation(p, user:get_player_name())
|
||||
return false
|
||||
end
|
||||
if mode ~= screwdriver.ROTATE_FACE then
|
||||
if new_param2 % 32 > 3 then
|
||||
return false
|
||||
end
|
||||
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
|
||||
|
@ -141,6 +143,9 @@ function beds.register_bed(name, def)
|
|||
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
|
||||
return true
|
||||
end,
|
||||
can_dig = function(pos, player)
|
||||
return beds.can_dig(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node(name .. "_top", {
|
||||
|
@ -160,6 +165,12 @@ function beds.register_bed(name, def)
|
|||
on_destruct = function(pos)
|
||||
destruct_bed(pos, 2)
|
||||
end,
|
||||
can_dig = function(pos, player)
|
||||
local node = minetest.get_node(pos)
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local p = vector.add(pos, dir)
|
||||
return beds.can_dig(p)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_alias(name, name .. "_bottom")
|
||||
|
|
|
@ -1,25 +1,30 @@
|
|||
-- beds/beds.lua
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = beds.get_translator
|
||||
|
||||
-- Fancy shaped bed
|
||||
|
||||
beds.register_bed("beds:fancy_bed", {
|
||||
description = "Fancy Bed",
|
||||
description = S("Fancy Bed"),
|
||||
inventory_image = "beds_bed_fancy.png",
|
||||
wield_image = "beds_bed_fancy.png",
|
||||
tiles = {
|
||||
bottom = {
|
||||
"beds_bed_top1.png",
|
||||
"default_wood.png",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side1.png",
|
||||
"beds_bed_side1.png^[transformFX",
|
||||
"default_wood.png",
|
||||
"beds_bed_foot.png",
|
||||
"beds_bed_foot.png",
|
||||
},
|
||||
top = {
|
||||
"beds_bed_top2.png",
|
||||
"default_wood.png",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side2.png",
|
||||
"beds_bed_side2.png^[transformFX",
|
||||
"beds_bed_head.png",
|
||||
"default_wood.png",
|
||||
"beds_bed_head.png",
|
||||
}
|
||||
},
|
||||
nodebox = {
|
||||
|
@ -44,7 +49,7 @@ beds.register_bed("beds:fancy_bed", {
|
|||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||
recipe = {
|
||||
{"", "", "group:stick"},
|
||||
{"wool:red", "wool:red", "wool:white"},
|
||||
{"wool:white", "wool:white", "wool:white"},
|
||||
{"group:wood", "group:wood", "group:wood"},
|
||||
},
|
||||
})
|
||||
|
@ -52,13 +57,13 @@ beds.register_bed("beds:fancy_bed", {
|
|||
-- Simple shaped bed
|
||||
|
||||
beds.register_bed("beds:bed", {
|
||||
description = "Simple Bed",
|
||||
description = S("Simple Bed"),
|
||||
inventory_image = "beds_bed.png",
|
||||
wield_image = "beds_bed.png",
|
||||
tiles = {
|
||||
bottom = {
|
||||
"beds_bed_top_bottom.png^[transformR90",
|
||||
"default_wood.png",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side_bottom_r.png",
|
||||
"beds_bed_side_bottom_r.png^[transformfx",
|
||||
"beds_transparent.png",
|
||||
|
@ -66,7 +71,7 @@ beds.register_bed("beds:bed", {
|
|||
},
|
||||
top = {
|
||||
"beds_bed_top_top.png^[transformR90",
|
||||
"default_wood.png",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side_top_r.png",
|
||||
"beds_bed_side_top_r.png^[transformfx",
|
||||
"beds_bed_side_top.png",
|
||||
|
@ -74,12 +79,12 @@ beds.register_bed("beds:bed", {
|
|||
}
|
||||
},
|
||||
nodebox = {
|
||||
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||
bottom = {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5},
|
||||
top = {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5},
|
||||
},
|
||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.0625, 1.5},
|
||||
recipe = {
|
||||
{"wool:red", "wool:red", "wool:white"},
|
||||
{"wool:white", "wool:white", "wool:white"},
|
||||
{"group:wood", "group:wood", "group:wood"}
|
||||
},
|
||||
})
|
||||
|
|
|
@ -1,23 +1,28 @@
|
|||
local pi = math.pi
|
||||
local player_in_bed = 0
|
||||
local is_sp = minetest.is_singleplayer()
|
||||
local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
|
||||
if enable_respawn == nil then
|
||||
enable_respawn = true
|
||||
end
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = beds.get_translator
|
||||
|
||||
-- Helper functions
|
||||
|
||||
local function get_look_yaw(pos)
|
||||
local n = minetest.get_node(pos)
|
||||
if n.param2 == 1 then
|
||||
return pi / 2, n.param2
|
||||
elseif n.param2 == 3 then
|
||||
return -pi / 2, n.param2
|
||||
elseif n.param2 == 0 then
|
||||
return pi, n.param2
|
||||
local rotation = minetest.get_node(pos).param2
|
||||
if rotation > 3 then
|
||||
rotation = rotation % 4 -- Mask colorfacedir values
|
||||
end
|
||||
if rotation == 1 then
|
||||
return pi / 2, rotation
|
||||
elseif rotation == 3 then
|
||||
return -pi / 2, rotation
|
||||
elseif rotation == 0 then
|
||||
return pi, rotation
|
||||
else
|
||||
return 0, n.param2
|
||||
return 0, rotation
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -56,60 +61,75 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||
-- stand up
|
||||
if state ~= nil and not state then
|
||||
local p = beds.pos[name] or nil
|
||||
if beds.player[name] ~= nil then
|
||||
beds.player[name] = nil
|
||||
player_in_bed = player_in_bed - 1
|
||||
end
|
||||
beds.player[name] = nil
|
||||
beds.bed_position[name] = nil
|
||||
-- skip here to prevent sending player specific changes (used for leaving players)
|
||||
if skip then
|
||||
return
|
||||
end
|
||||
if p then
|
||||
player:setpos(p)
|
||||
player:set_pos(p)
|
||||
end
|
||||
|
||||
-- physics, eye_offset, etc
|
||||
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||
player:set_look_horizontal(math.random(1, 180) / 100)
|
||||
default.player_attached[name] = false
|
||||
player_api.player_attached[name] = false
|
||||
player:set_physics_override(1, 1, 1)
|
||||
hud_flags.wielditem = true
|
||||
default.player_set_animation(player, "stand" , 30)
|
||||
player_api.set_animation(player, "stand" , 30)
|
||||
|
||||
-- lay down
|
||||
else
|
||||
beds.player[name] = 1
|
||||
beds.pos[name] = pos
|
||||
player_in_bed = player_in_bed + 1
|
||||
beds.bed_position[name] = bed_pos
|
||||
beds.player[name] = 1
|
||||
|
||||
-- physics, eye_offset, etc
|
||||
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
|
||||
local yaw, param2 = get_look_yaw(bed_pos)
|
||||
player:set_look_horizontal(yaw)
|
||||
local dir = minetest.facedir_to_dir(param2)
|
||||
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
|
||||
-- p.y is just above the nodebox height of the 'Simple Bed' (the highest bed),
|
||||
-- to avoid sinking down through the bed.
|
||||
local p = {
|
||||
x = bed_pos.x + dir.x / 2,
|
||||
y = bed_pos.y + 0.07,
|
||||
z = bed_pos.z + dir.z / 2
|
||||
}
|
||||
player:set_physics_override(0, 0, 0)
|
||||
player:setpos(p)
|
||||
default.player_attached[name] = true
|
||||
player:set_pos(p)
|
||||
player_api.player_attached[name] = true
|
||||
hud_flags.wielditem = false
|
||||
default.player_set_animation(player, "lay" , 0)
|
||||
player_api.set_animation(player, "lay" , 0)
|
||||
end
|
||||
|
||||
player:hud_set_flags(hud_flags)
|
||||
end
|
||||
|
||||
local function get_player_in_bed_count()
|
||||
local c = 0
|
||||
for _, _ in pairs(beds.player) do
|
||||
c = c + 1
|
||||
end
|
||||
return c
|
||||
end
|
||||
|
||||
local function update_formspecs(finished)
|
||||
local ges = #minetest.get_connected_players()
|
||||
local form_n
|
||||
local player_in_bed = get_player_in_bed_count()
|
||||
local is_majority = (ges / 2) < player_in_bed
|
||||
|
||||
local form_n
|
||||
local esc = minetest.formspec_escape
|
||||
if finished then
|
||||
form_n = beds.formspec .. "label[2.7,11; Good morning.]"
|
||||
form_n = beds.formspec .. "label[2.7,9;" .. esc(S("Good morning.")) .. "]"
|
||||
else
|
||||
form_n = beds.formspec .. "label[2.2,11;" .. tostring(player_in_bed) ..
|
||||
" of " .. tostring(ges) .. " players are in bed]"
|
||||
form_n = beds.formspec .. "label[2.2,9;" ..
|
||||
esc(S("@1 of @2 players are in bed", player_in_bed, ges)) .. "]"
|
||||
if is_majority and is_night_skip_enabled() then
|
||||
form_n = form_n .. "button_exit[2,8;4,0.75;force;Force night skip]"
|
||||
form_n = form_n .. "button_exit[2,6;4,0.75;force;" ..
|
||||
esc(S("Force night skip")) .. "]"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -134,14 +154,14 @@ end
|
|||
|
||||
function beds.on_rightclick(pos, player)
|
||||
local name = player:get_player_name()
|
||||
local ppos = player:getpos()
|
||||
local ppos = player:get_pos()
|
||||
local tod = minetest.get_timeofday()
|
||||
|
||||
if tod > 0.2 and tod < 0.805 then
|
||||
if beds.player[name] then
|
||||
lay_down(player, nil, nil, false)
|
||||
end
|
||||
minetest.chat_send_player(name, "You can only sleep at night.")
|
||||
minetest.chat_send_player(name, S("You can only sleep at night."))
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -171,6 +191,15 @@ function beds.on_rightclick(pos, player)
|
|||
end
|
||||
end
|
||||
|
||||
function beds.can_dig(bed_pos)
|
||||
-- Check all players in bed which one is at the expected position
|
||||
for _, player_bed_pos in pairs(beds.bed_position) do
|
||||
if vector.equals(bed_pos, player_bed_pos) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- Callbacks
|
||||
-- Only register respawn callback if respawn enabled
|
||||
|
@ -180,7 +209,7 @@ if enable_respawn then
|
|||
local name = player:get_player_name()
|
||||
local pos = beds.spawn[name]
|
||||
if pos then
|
||||
player:setpos(pos)
|
||||
player:set_pos(pos)
|
||||
return true
|
||||
end
|
||||
end)
|
||||
|
@ -205,16 +234,25 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
if formname ~= "beds_form" then
|
||||
return
|
||||
end
|
||||
|
||||
-- Because "Force night skip" button is a button_exit, it will set fields.quit
|
||||
-- and lay_down call will change value of player_in_bed, so it must be taken
|
||||
-- earlier.
|
||||
local last_player_in_bed = get_player_in_bed_count()
|
||||
|
||||
if fields.quit or fields.leave then
|
||||
lay_down(player, nil, nil, false)
|
||||
update_formspecs(false)
|
||||
end
|
||||
|
||||
if fields.force then
|
||||
update_formspecs(is_night_skip_enabled())
|
||||
if is_night_skip_enabled() then
|
||||
local is_majority = (#minetest.get_connected_players() / 2) < last_player_in_bed
|
||||
if is_majority and is_night_skip_enabled() then
|
||||
update_formspecs(true)
|
||||
beds.skip_night()
|
||||
beds.kick_players()
|
||||
else
|
||||
update_formspecs(false)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
-- beds/init.lua
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("beds")
|
||||
local esc = minetest.formspec_escape
|
||||
|
||||
beds = {}
|
||||
beds.player = {}
|
||||
beds.bed_position = {}
|
||||
beds.pos = {}
|
||||
beds.spawn = {}
|
||||
beds.get_translator = S
|
||||
|
||||
beds.formspec = "size[8,15;true]" ..
|
||||
"bgcolor[#080808BB; true]" ..
|
||||
"button_exit[2,12;4,0.75;leave;Leave Bed]"
|
||||
beds.formspec = "size[8,11;true]" ..
|
||||
"no_prepend[]" ..
|
||||
"bgcolor[#080808BB;true]" ..
|
||||
"button_exit[2,10;4,0.75;leave;" .. esc(S("Leave Bed")) .. "]"
|
||||
|
||||
local modpath = minetest.get_modpath("beds")
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ Licenses of media (textures)
|
|||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2014-2016 BlockMen
|
||||
Copyright (C) 2018 TumeniNodes
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Schickes Bett
|
||||
Simple Bed=Schlichtes Bett
|
||||
Leave Bed=Bett verlassen
|
||||
Good morning.=Guten Morgen.
|
||||
@1 of @2 players are in bed=@1 von @2 Spielern sind im Bett
|
||||
Force night skip=Überspringen der Nacht erzwingen
|
||||
You can only sleep at night.=Sie können nur nachts schlafen.
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Cama de lujo
|
||||
Simple Bed=Cama sencilla
|
||||
Leave Bed=Abandonar cama
|
||||
Good morning.=Buenos días.
|
||||
@1 of @2 players are in bed=@1 de @2 jugadores están en cama
|
||||
Force night skip=Forzar evitar noche
|
||||
You can only sleep at night.=Sólo puedes dormir por la noche.
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Lit chic
|
||||
Simple Bed=Lit simple
|
||||
Leave Bed=Se lever du lit
|
||||
Good morning.=Bonjour.
|
||||
@1 of @2 players are in bed=@1 joueur(s) sur @2 sont au lit
|
||||
Force night skip=Forcer le passage de la nuit
|
||||
You can only sleep at night.=Vous ne pouvez dormir que la nuit.
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Leave Bed=Tinggalkan Dipan
|
||||
Good morning.=Selamat pagi.
|
||||
@1 of @2 players are in bed=@1 dari @2 pemain sedang tidur
|
||||
Force night skip=Paksa lewati malam
|
||||
You can only sleep at night.=Anda hanya boleh tidur pada waktu malam.
|
||||
Fancy Bed=Dipan Mewah
|
||||
Simple Bed=Dipan Sederhana
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Letto decorato
|
||||
Simple Bed=Letto semplice
|
||||
Leave Bed=Alzati dal letto
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Katil Beragam
|
||||
Simple Bed=Katil Biasa
|
||||
Leave Bed=Bangun
|
||||
Good morning.=Selamat pagi.
|
||||
@1 of @2 players are in bed=@1 daripada @2 pemain sedang tidur
|
||||
Force night skip=Paksa langkau malam
|
||||
You can only sleep at night.=Anda hanya boleh tidur pada waktu malam.
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Детализированная Кровать
|
||||
Simple Bed=Обычная Кровать
|
||||
Leave Bed=Встать с кровати
|
||||
Good morning.=Доброе утро.
|
||||
@1 of @2 players are in bed=@1 из @2 игроков в кровати
|
||||
Force night skip=Пропустить ночь
|
||||
You can only sleep at night.=Вы можете спать только ночью.
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Fin säng
|
||||
Simple Bed=Enkel Säng
|
||||
Leave Bed=Lämna Säng
|
||||
Good morning.= God morgon.
|
||||
@1 of @2 players are in bed=@1 av @2 spelar försöker sover.
|
||||
Force night skip=Tvinga över natten
|
||||
You can only sleep at night.=Du kan bara sova på natten.
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=花式床
|
||||
Simple Bed=简易床
|
||||
Leave Bed=离开床
|
||||
Good morning.=早安!
|
||||
@1 of @2 players are in bed=@2位玩家中的@1位在床上
|
||||
Force night skip=强制跳过夜晚
|
||||
You can only sleep at night.=你只能在晚上睡觉。
|
|
@ -0,0 +1,9 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=花式床
|
||||
Simple Bed=簡易床
|
||||
Leave Bed=離開床
|
||||
Good morning.=早安!
|
||||
@1 of @2 players are in bed=@2位玩家中的@1位在床上
|
||||
Force night skip=強制跳過夜晚
|
||||
You can only sleep at night.=你只能在晚上睡覺。
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: beds
|
||||
Leave Bed=
|
||||
Good morning.=
|
||||
@1 of @2 players are in bed=
|
||||
Force night skip=
|
||||
You can only sleep at night.=
|
||||
Fancy Bed=
|
||||
Simple Bed=
|
|
@ -0,0 +1,3 @@
|
|||
name = beds
|
||||
description = Minetest Game mod: beds
|
||||
depends = default, wool
|
|
@ -53,11 +53,20 @@ end
|
|||
function beds.set_spawns()
|
||||
for name,_ in pairs(beds.player) do
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local p = player:getpos()
|
||||
local p = player:get_pos()
|
||||
-- but don't change spawn location if borrowing a bed
|
||||
--if not minetest.is_protected(p, name) then
|
||||
if not minetest.is_protected(p, name) then
|
||||
beds.spawn[name] = p
|
||||
--end
|
||||
end
|
||||
end
|
||||
beds.save_spawns()
|
||||
end
|
||||
|
||||
function beds.remove_spawns_at(pos)
|
||||
for name, p in pairs(beds.spawn) do
|
||||
if vector.equals(vector.round(p), pos) then
|
||||
beds.spawn[name] = nil
|
||||
end
|
||||
end
|
||||
beds.save_spawns()
|
||||
end
|
||||
|
|
Before Width: | Height: | Size: 519 B After Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 516 B After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 390 B |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 611 B |
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 596 B |
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 616 B |
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 495 B |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 304 B |
Before Width: | Height: | Size: 84 B After Width: | Height: | Size: 143 B |